コード例 #1
0
ファイル: ODSelect.cpp プロジェクト: Hakansv/ocpn_draw_pi
bool ODSelect::DeleteSelectablePoint( void *pdata, int SeltypeToDelete )
{
    SelectItem *pFindSel;

    if( NULL != pdata ) {
//    Iterate on the list
        wxSelectableItemListNode *node = pSelectList->GetFirst();

        while( node ) {
            pFindSel = node->GetData();
            if( pFindSel->m_seltype == SeltypeToDelete ) {
                if( pdata == pFindSel->m_pData1 ) {
                    delete pFindSel;
                    delete node;
                    g_pRolloverPoint = NULL;
                    
                    if( SELTYPE_ODPOINT == SeltypeToDelete ){
                        ODPoint *prp = (ODPoint *)pdata;
                        prp->SetSelectNode( NULL );
                    }
                    
                    return true;
                }
            }
            node = node->GetNext();
        }
    }
    return false;
}
コード例 #2
0
ファイル: ODSelect.cpp プロジェクト: Hakansv/ocpn_draw_pi
bool ODSelect::DeleteAllSelectableTypePoints( int SeltypeToDelete )
{
    SelectItem *pFindSel;

//    Iterate on the list
    wxSelectableItemListNode *node = pSelectList->GetFirst();

    while( node ) {
        pFindSel = node->GetData();
        if( pFindSel->m_seltype == SeltypeToDelete ) {
            delete node;
            
            if( SELTYPE_ODPOINT == SeltypeToDelete ){
                ODPoint *prp = (ODPoint *)pFindSel->m_pData1;
                prp->SetSelectNode( NULL );
            }
            delete pFindSel;
            
            node = pSelectList->GetFirst();
            goto got_next_node;
        }

        node = node->GetNext();
        got_next_node: continue;
    }
    return true;
}
コード例 #3
0
ファイル: ODSelect.cpp プロジェクト: Hakansv/ocpn_draw_pi
bool ODSelect::DeleteAllSelectableODPoints( ODPath *pr )
{
    SelectItem *pFindSel;

//    Iterate on the select list
    wxSelectableItemListNode *node = pSelectList->GetFirst();

    while( node ) {
        pFindSel = node->GetData();
        if( pFindSel->m_seltype == SELTYPE_ODPOINT ) {
            ODPoint *ps = (ODPoint *) pFindSel->m_pData1;

            //    inner loop iterates on the path's point list
            wxODPointListNode *pnode = ( pr->m_pODPointList )->GetFirst();
            while( pnode ) {
                ODPoint *prp = pnode->GetData();

                if( prp == ps ) {
                    delete pFindSel;
                    pSelectList->DeleteNode( node );   //delete node;
                    prp->SetSelectNode( NULL );
                    
                    node = pSelectList->GetFirst();

                    goto got_next_outer_node;
                }
                pnode = pnode->GetNext();
            }
        }

        node = node->GetNext();
got_next_outer_node: continue;
    }
    return true;
}