From 0580b60ec1f583e2edd579b214cb4bc333fc4778 Mon Sep 17 00:00:00 2001 From: nopeppermint Date: Sun, 19 Apr 2020 23:25:53 +0200 Subject: [PATCH] add Show All Inner Layer button to layer selector --- pcbnew/pcb_layer_widget.cpp | 39 +++++++++++++++++++++++++++++++++++++ pcbnew/pcb_layer_widget.h | 1 + 2 files changed, 40 insertions(+) diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index 0736cfb238..8568a475bd 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -184,6 +184,9 @@ void PCB_LAYER_WIDGET::AddRightClickMenuItems( wxMenu& menu ) AddMenuItem( &menu, ID_SHOW_ALL_FRONT, _( "Show All Front Layers" ), KiBitmap( show_all_front_layers_xpm ) ); + AddMenuItem( &menu, ID_SHOW_ALL_INNER, _( "Show All Inner Layers" ), + KiBitmap( show_all_copper_layers_xpm ) ); + AddMenuItem( &menu, ID_SHOW_ALL_BACK, _( "Show All Back Layers" ), KiBitmap( show_all_back_layers_xpm ) ); } @@ -326,6 +329,42 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event ) } break; } + case ID_SHOW_ALL_INNER: + { + visible = false; + rowCount = GetLayerRowCount(); + + for( int row=0; rowGetId() ) ); + isLast = ( row == rowCount-1 ); + + if( layer == In1_Cu || layer == In2_Cu || layer == In3_Cu || layer == In4_Cu || + layer == In5_Cu || layer == In6_Cu || layer == In7_Cu || layer == In8_Cu || + layer == In9_Cu || layer == In10_Cu || layer == In11_Cu || layer == In12_Cu || + layer == In13_Cu || layer == In14_Cu || layer == In15_Cu || layer == In16_Cu || + layer == In17_Cu || layer == In18_Cu || layer == In19_Cu || layer == In20_Cu || + layer == In21_Cu || layer == In22_Cu || layer == In23_Cu || layer == In24_Cu || + layer == In25_Cu || layer == In26_Cu || layer == In27_Cu || layer == In28_Cu || + layer == In29_Cu || layer == In30_Cu ) + { + visible = true; + } + else + { + visible = false; + } + + cb->SetValue( visible ); + OnLayerVisible( layer, visible, isLast ); + + if( isLast ) + break; + } + break; + } case ID_SHOW_ALL_BACK: { visible = false; diff --git a/pcbnew/pcb_layer_widget.h b/pcbnew/pcb_layer_widget.h index 3c36bc0fc3..ea6284b85d 100644 --- a/pcbnew/pcb_layer_widget.h +++ b/pcbnew/pcb_layer_widget.h @@ -131,6 +131,7 @@ protected: ID_SHOW_NO_LAYERS, ID_SHOW_ALL_LAYERS, ID_SHOW_ALL_FRONT, + ID_SHOW_ALL_INNER, ID_SHOW_ALL_BACK, ID_HIDE_ALL_NON_COPPER, ID_SHOW_ALL_NON_COPPER,