void BOARD_DESIGN_SETTINGS::SetLayerVisibility( LAYER_NUM aLayer, bool aNewState )
{
    if( aNewState && IsLayerEnabled( aLayer ) )
        m_VisibleLayers |= GetLayerMask( aLayer );
    else
        m_VisibleLayers &= ~GetLayerMask( aLayer );
}
void GBR_LAYER_BOX_SELECTOR::Resync()
{
    #define BM_SIZE 14
    Freeze();
    Clear();

    GERBER_FILE_IMAGE_LIST& images = GERBER_FILE_IMAGE_LIST::GetImagesList();

    for( unsigned layerid = 0; layerid < images.ImagesMaxCount(); ++layerid )
    {
        wxBitmap    layerbmp( BM_SIZE, BM_SIZE );
        wxString    layername;

        if( !IsLayerEnabled( layerid ) )
            continue;

        // Prepare Bitmap
        SetBitmapLayer( layerbmp, layerid );

        layername = GetLayerName( layerid );

        Append( layername, layerbmp, (void*)(intptr_t) layerid );
    }

    // Ensure the width of the widget is enough to show the text and the icon
    SetMinSize( wxSize( -1, -1 ) );
    int minwidth = GetBestSize().x + BM_SIZE + 10;
    SetMinSize( wxSize( minwidth, -1 ) );

    Thaw();
}
void BOARD_DESIGN_SETTINGS::SetLayerVisibility( LAYER_ID aLayer, bool aNewState )
{
    if( aNewState && IsLayerEnabled( aLayer ) )
        m_visibleLayers.set( aLayer, true );
    else
        m_visibleLayers.set( aLayer, false );
}
// Reload the Layers
void PCB_LAYER_BOX_SELECTOR::Resync()
{
    Clear();

    static DECLARE_LAYERS_ORDER_LIST( layertranscode );
    static DECLARE_LAYERS_HOTKEY( layerhk );

    // Tray to fix a minimum width fot the BitmapComboBox
    int minwidth = 80, h;
    wxClientDC dc( GetParent() );   // The DC for "this" is not always initialized

    #define BM_SIZE 14
    for( LAYER_NUM i = FIRST_LAYER; i < NB_LAYERS; ++i )
    {
        wxBitmap   layerbmp( BM_SIZE, BM_SIZE );
        wxString   layername;
        LAYER_NUM  layerid = i;

        if( m_layerorder )
            layerid = layertranscode[i];

        if( ! IsLayerEnabled( layerid ) )
            continue;

        if( ( m_layerMaskDisable & GetLayerMask( layerid ) ) )
            continue;

        SetBitmapLayer( layerbmp, layerid );

        layername = GetLayerName( layerid );

        if( m_layerhotkeys && m_hotkeys != NULL )
            layername = AddHotkeyName( layername, m_hotkeys,
                                       layerhk[layerid], IS_COMMENT );

        Append( layername, layerbmp, (void*)(intptr_t) layerid );
        int w;
        dc.GetTextExtent ( layername, &w, &h );
        minwidth = std::max( minwidth, w );
    }

    minwidth += BM_SIZE + 35;    // Take in account the bitmap size and margins
    SetMinSize( wxSize( minwidth, -1 ) );
}
void GBR_LAYER_BOX_SELECTOR::Resync()
{
    Clear();

    for( int layerid = 0; layerid < GERBER_DRAWLAYERS_COUNT; ++layerid )
    {
        wxBitmap    layerbmp( 14, 14 );
        wxString    layername;

        if( !IsLayerEnabled( layerid ) )
            continue;

        // Prepare Bitmap
        SetBitmapLayer( layerbmp, layerid );

        layername = GetLayerName( layerid );

        Append( layername, layerbmp, (void*)(intptr_t) layerid );
    }
}
Пример #6
0
void BOARD_DESIGN_SETTINGS::SetLayerVisibility( PCB_LAYER_ID aLayer, bool aNewState )
{
    m_visibleLayers.set( aLayer, aNewState && IsLayerEnabled( aLayer ));
}