예제 #1
0
/* Handles the selection of tools, menu, and popup menu commands.
 */
void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
{
    wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
    cmd.SetEventObject( this );

    switch( event.GetId() )
    {
    case wxID_PREFERENCES:
        ShowPreferences( PlEditorHotkeysDescr, PlEditorHotkeysDescr, wxT( "pl_editor" ) );
        break;

    case ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST:
        DisplayHotkeyList( this, PlEditorHotkeysDescr );
        break;

    case ID_SELECT_PAGE_NUMBER:
    {
        KIGFX::VIEW* view = GetGalCanvas()->GetView();
        view->SetLayerVisible( LAYER_WORKSHEET_PAGE1, m_pageSelectBox->GetSelection() == 0 );
        view->SetLayerVisible( LAYER_WORKSHEET_PAGEn, m_pageSelectBox->GetSelection() == 1 );
        m_canvas->Refresh();
    }
        break;

    default:
        wxMessageBox( wxT( "PL_EDITOR_FRAME::Process_Special_Functions error" ) );
        break;
    }
}
예제 #2
0
파일: pcbframe.cpp 프로젝트: jerkey/kicad
void PCB_EDIT_FRAME::syncLayerVisibilities()
{
    m_Layers->SyncLayerVisibilities();

    KIGFX::VIEW* view = GetGalCanvas()->GetView();

    // Load layer & elements visibility settings
    for( LAYER_NUM i = 0; i < NB_LAYERS; ++i )
    {
        view->SetLayerVisible( i, m_Pcb->IsLayerVisible( i ) );

        // Synchronize netname layers as well
        if( IsCopperLayer( i ) )
            view->SetLayerVisible( GetNetnameLayer( i ), m_Pcb->IsLayerVisible( i ) );
    }

    for( LAYER_NUM i = 0; i < END_PCB_VISIBLE_LIST; ++i )
    {
        view->SetLayerVisible( ITEM_GAL_LAYER( i ), m_Pcb->IsElementVisible( i ) );
    }

    // Enable some layers that are GAL specific
    view->SetLayerVisible( ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), true );
    view->SetLayerVisible( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), true );
    view->SetLayerVisible( ITEM_GAL_LAYER( WORKSHEET ), true );
    view->SetLayerVisible( ITEM_GAL_LAYER( GP_OVERLAY ), true );
}
void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
{
    BOARD* brd = myframe->GetBoard();

    LSET visibleLayers = brd->GetVisibleLayers();

    visibleLayers.set( aLayer, isVisible );

    brd->SetVisibleLayers( visibleLayers );

    EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
    if( galCanvas )
    {
        KIGFX::VIEW* view = galCanvas->GetView();
        view->SetLayerVisible( aLayer, isVisible );
        view->RecacheAllItems( true );
    }

    if( isFinal )
        myframe->GetCanvas()->Refresh();
}
void PCB_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool isFinal )
{
    BOARD* brd = myframe->GetBoard();

    LAYER_MSK visibleLayers = brd->GetVisibleLayers();

    if( isVisible )
        visibleLayers |= GetLayerMask( aLayer );
    else
        visibleLayers &= ~GetLayerMask( aLayer );

    brd->SetVisibleLayers( visibleLayers );

    EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
    if( galCanvas )
    {
        KIGFX::VIEW* view = galCanvas->GetView();
        view->SetLayerVisible( aLayer, isVisible );
    }

    if( isFinal )
        myframe->GetCanvas()->Refresh();
}