Fix crash in Pcbnew and Gerbview when seceting (in layers manager) "always hide all layers but activer"
This commit is contained in:
parent
2196ed21c9
commit
680ca22279
|
@ -186,7 +186,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|||
rowCount = GetLayerRowCount();
|
||||
for( int row=0; row < rowCount; ++row )
|
||||
{
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
|
||||
int layer = getDecodedId( cb->GetId() );
|
||||
bool loc_visible = visible;
|
||||
|
||||
|
@ -317,7 +317,7 @@ void GERBER_LAYER_WIDGET::UpdateLayerIcons()
|
|||
int row_count = GetLayerRowCount();
|
||||
for( int row = 0; row < row_count ; row++ )
|
||||
{
|
||||
wxStaticBitmap* bm = (wxStaticBitmap*) getLayerComp( row, 0 );
|
||||
wxStaticBitmap* bm = (wxStaticBitmap*) getLayerComp( row, COLUMN_ICON_ACTIVE );
|
||||
if( bm == NULL)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|||
rowCount = GetLayerRowCount();
|
||||
for( int row = rowCount-1; row>=0; --row )
|
||||
{
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
|
||||
LAYER_ID layer = ToLAYER_ID( getDecodedId( cb->GetId() ) );
|
||||
|
||||
if( IsCopperLayer( layer ) )
|
||||
|
@ -180,7 +180,7 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|||
// Enable/disable the copper layers visibility:
|
||||
for( int row=0; row<rowCount; ++row )
|
||||
{
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
|
||||
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
|
||||
LAYER_ID layer = ToLAYER_ID( getDecodedId( cb->GetId() ) );
|
||||
|
||||
if( IsCopperLayer( layer ) )
|
||||
|
@ -264,7 +264,7 @@ void PCB_LAYER_WIDGET::SyncLayerVisibilities()
|
|||
// this utilizes more implementation knowledge than ideal, eventually
|
||||
// add member ROW getRow() or similar to base LAYER_WIDGET.
|
||||
|
||||
wxWindow* w = getLayerComp( row, 0 );
|
||||
wxWindow* w = getLayerComp( row, COLUMN_ICON_ACTIVE );
|
||||
|
||||
LAYER_ID layerId = ToLAYER_ID( getDecodedId( w->GetId() ) );
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#define LYR_COLUMN_COUNT 4 ///< Layer tab column count
|
||||
#define RND_COLUMN_COUNT 2 ///< Rendering tab column count
|
||||
|
||||
#define COLUMN_ICON_ACTIVE 0
|
||||
#define COLUMN_COLORBM 1
|
||||
#define COLUMN_COLOR_LYR_CB 2
|
||||
#define COLUMN_COLOR_LYRNAME 3
|
||||
|
|
Loading…
Reference in New Issue