示例#1
0
void DIALOG_DRC_CONTROL::doSelectionMenu( const DRC_ITEM* aItem )
{
    // popup menu to go to either of the items listed in the DRC_ITEM.

    BOARD_ITEM* first = aItem->GetMainItem( m_brdEditor->GetBoard() );
    BOARD_ITEM* second = nullptr;

    GENERAL_COLLECTOR items;

    items.Append( first );

    if( aItem->HasSecondItem() )
    {
        second = aItem->GetAuxiliaryItem( m_brdEditor->GetBoard() );
        items.Append( second );
    }

    WINDOW_THAWER thawer( m_brdEditor );
    m_brdEditor->GetToolManager()->VetoContextMenuMouseWarp();
    m_brdEditor->GetToolManager()->RunAction( PCB_ACTIONS::selectionMenu, true, &items );

    // If we got an item, focus on it
    BOARD_ITEM* selection = m_brdEditor->GetCurItem();

    if( selection && ( selection == first || selection == second ) )
        m_brdEditor->GetToolManager()->GetView()->SetCenter( selection->GetPosition() );

    m_brdEditor->GetCanvas()->Refresh();
}
void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem( wxCommandEvent& event )
{
    int selection = event.GetSelection();

    if( selection != wxNOT_FOUND )
    {
        // Find the selected DRC_ITEM in the listbox, position cursor there.
        const DRC_ITEM* item = m_ItemsListBox->GetItem( selection );

        if( item )
        {
            m_parentFrame->FocusOnLocation( item->GetPointA(), false, true );

            WINDOW_THAWER thawer( m_parentFrame );
            m_parentFrame->GetCanvas()->Refresh();
        }
    }

    event.Skip();
}
void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem( wxMouseEvent& event )
{
    // popup menu to go to either of the items listed in the DRC_ITEM.

    int selection = m_ItemsListBox->GetSelection();

    if( selection != wxNOT_FOUND )
    {
        // popup menu to go to either of the items listed in the DRC_ITEM.
        const DRC_ITEM* item = m_ItemsListBox->GetItem( selection );
        GENERAL_COLLECTOR items;

        items.Append( item->GetMainItem( m_parentFrame->GetBoard() ) );

        if( item->HasSecondItem() )
            items.Append( item->GetAuxiliaryItem( m_parentFrame->GetBoard() ) );

        WINDOW_THAWER thawer( m_parentFrame );
        m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionMenu, true, &items );
        m_parentFrame->GetCanvas()->Refresh();
    }
}
示例#4
0
void DIALOG_DRC_CONTROL::RedrawDrawPanel()
{
    WINDOW_THAWER thawer( m_brdEditor );

    m_brdEditor->GetCanvas()->Refresh();
}