Commit 0ae29fc1 authored by charras's avatar charras

Revert to previous dialog_layer_setup_base, and added (conditional...

Revert to previous dialog_layer_setup_base, and added (conditional compilation) option to hide/show no used inner copper layers and define inner layers order (see changelog) in dialog layer setup.
parent 89159f75
...@@ -4,6 +4,23 @@ KiCad ChangeLog 2010 ...@@ -4,6 +4,23 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-Feb-19 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
Added (see dialog_layers_setup.cpp) compilation options to
-hide non active copper layers
-show inner layers in same order than the layer manager
Currently these options are 2 define
HIDE_INACTIVE_LAYERS
// if defined, displays only active copper layers
// if not displays always 1=the full set (16 layers)
USE_LAYER_MANAGER_COPPER_LAYERS_ORDER
//if defined, used the layer manager copper layers order
// (from FRONT to BACK) to display inner layers.
// if not, use the default order (from BACK to FRONT)
Currently not active, can be changed if the correponding lines are uncommented in dialog_layers_setup.cpp
2010-Mar-3 UPDATE Dick Hollenbeck <dick@softplc.com> 2010-Mar-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
++common ++common
......
...@@ -36,6 +36,17 @@ ...@@ -36,6 +36,17 @@
#include "class_board_design_settings.h" #include "class_board_design_settings.h"
// some define to choose how copper layers widgets are shown
// if defined, displays only active copper layers
// if not displays always 1=the full set (16 layers)
//#define HIDE_INACTIVE_LAYERS
//if defined, uses the layer manager copper layers order (from FRONT to BACK)
// to display inner layers.
// if not, use the default order (from BACK to FRONT)
//#define USE_LAYER_MANAGER_COPPER_LAYERS_ORDER
/** /**
* Struct CTLs * Struct CTLs
...@@ -43,11 +54,12 @@ ...@@ -43,11 +54,12 @@
*/ */
struct CTLs struct CTLs
{ {
CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc ) CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc, wxPanel * aPanel = NULL)
{ {
name = aName; name = aName;
checkbox = aCheckBox; checkbox = aCheckBox;
choice = aChoiceOrDesc; choice = aChoiceOrDesc;
panel = aPanel;
} }
wxControl* name; wxControl* name;
...@@ -197,8 +209,8 @@ static const int presets[] = ...@@ -197,8 +209,8 @@ static const int presets[] =
CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber ) CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
{ {
#define RETCOP(x) return CTLs( x##Name, x##CheckBox, x##Choice ); #define RETCOP(x) return CTLs( x##Name, x##CheckBox, x##Choice, x##Panel );
#define RETAUX(x) return CTLs( x##Name, x##CheckBox, x##StaticText ); #define RETAUX(x) return CTLs( x##Name, x##CheckBox, x##StaticText, x##Panel );
switch( aLayerNumber ) switch( aLayerNumber )
{ {
...@@ -207,6 +219,22 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber ) ...@@ -207,6 +219,22 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
case SILKSCREEN_N_FRONT: RETAUX( m_SilkSFront ); case SILKSCREEN_N_FRONT: RETAUX( m_SilkSFront );
case SOLDERMASK_N_FRONT: RETAUX( m_MaskFront ); case SOLDERMASK_N_FRONT: RETAUX( m_MaskFront );
case LAYER_N_FRONT: RETCOP( m_Front ); case LAYER_N_FRONT: RETCOP( m_Front );
#ifdef USE_LAYER_MANAGER_COPPER_LAYERS_ORDER
case LAYER_N_15: RETCOP( m_Inner2 );
case LAYER_N_14: RETCOP( m_Inner3 );
case LAYER_N_13: RETCOP( m_Inner4 );
case LAYER_N_12: RETCOP( m_Inner5 );
case LAYER_N_11: RETCOP( m_Inner6 );
case LAYER_N_10: RETCOP( m_Inner7 );
case LAYER_N_9: RETCOP( m_Inner8 );
case LAYER_N_8: RETCOP( m_Inner9 );
case LAYER_N_7: RETCOP( m_Inner10 );
case LAYER_N_6: RETCOP( m_Inner11 );
case LAYER_N_5: RETCOP( m_Inner12 );
case LAYER_N_4: RETCOP( m_Inner13 );
case LAYER_N_3: RETCOP( m_Inner14 );
case LAYER_N_2: RETCOP( m_Inner15 );
#else
case LAYER_N_2: RETCOP( m_Inner2 ); case LAYER_N_2: RETCOP( m_Inner2 );
case LAYER_N_3: RETCOP( m_Inner3 ); case LAYER_N_3: RETCOP( m_Inner3 );
case LAYER_N_4: RETCOP( m_Inner4 ); case LAYER_N_4: RETCOP( m_Inner4 );
...@@ -221,6 +249,7 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber ) ...@@ -221,6 +249,7 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
case LAYER_N_13: RETCOP( m_Inner13 ); case LAYER_N_13: RETCOP( m_Inner13 );
case LAYER_N_14: RETCOP( m_Inner14 ); case LAYER_N_14: RETCOP( m_Inner14 );
case LAYER_N_15: RETCOP( m_Inner15 ); case LAYER_N_15: RETCOP( m_Inner15 );
#endif
case LAYER_N_BACK: RETCOP( m_Back ); case LAYER_N_BACK: RETCOP( m_Back );
case SOLDERMASK_N_BACK: RETAUX( m_MaskBack ); case SOLDERMASK_N_BACK: RETAUX( m_MaskBack );
case SILKSCREEN_N_BACK: RETAUX( m_SilkSBack ); case SILKSCREEN_N_BACK: RETAUX( m_SilkSBack );
...@@ -434,19 +463,27 @@ void DIALOG_LAYERS_SETUP::setCopperLayerCheckBoxes( int copperCount ) ...@@ -434,19 +463,27 @@ void DIALOG_LAYERS_SETUP::setCopperLayerCheckBoxes( int copperCount )
int layer; int layer;
for( layer=LAYER_N_2; layer < NB_COPPER_LAYERS-1; ++layer, --copperCount ) for( layer=LAYER_N_2; layer < NB_COPPER_LAYERS-1; ++layer, --copperCount )
{ {
CTLs ctl = getCTLs(layer);
bool state = copperCount > 0; bool state = copperCount > 0;
#ifdef HIDE_INACTIVE_LAYERS
// This code hide non active copper layers
CTLs ctl = getCTLs(layer);
ctl.name->Show( state ); ctl.name->Show( state );
ctl.checkbox->Show( state ); ctl.checkbox->Show( state );
ctl.choice->Show( state ); ctl.choice->Show( state );
if( ctl.panel )
ctl.panel->Show( state );
#endif
setLayerCheckBox( layer, state ); setLayerCheckBox( layer, state );
} }
#ifdef HIDE_INACTIVE_LAYERS
// Send an size event to force sizers to be updated, // Send an size event to force sizers to be updated,
// because the number of copper layers can have changed. // because the number of copper layers can have changed.
wxSizeEvent evt_size(m_LayersListPanel->GetSize() ); wxSizeEvent evt_size(m_LayersListPanel->GetSize() );
m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size ); m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size );
#endif
} }
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -146,51 +146,67 @@ class DIALOG_LAYERS_SETUP_BASE : public wxDialog ...@@ -146,51 +146,67 @@ class DIALOG_LAYERS_SETUP_BASE : public wxDialog
wxCheckBox* m_MaskFrontCheckBox; wxCheckBox* m_MaskFrontCheckBox;
wxStaticText* m_MaskFrontStaticText; wxStaticText* m_MaskFrontStaticText;
wxTextCtrl* m_FrontName; wxTextCtrl* m_FrontName;
wxPanel* m_FrontPanel;
wxCheckBox* m_FrontCheckBox; wxCheckBox* m_FrontCheckBox;
wxChoice* m_FrontChoice; wxChoice* m_FrontChoice;
wxTextCtrl* m_Inner15Name;
wxCheckBox* m_Inner15CheckBox;
wxChoice* m_Inner15Choice;
wxTextCtrl* m_Inner14Name;
wxCheckBox* m_Inner14CheckBox;
wxChoice* m_Inner14Choice;
wxTextCtrl* m_Inner13Name;
wxCheckBox* m_Inner13CheckBox;
wxChoice* m_Inner13Choice;
wxTextCtrl* m_Inner12Name;
wxCheckBox* m_Inner12CheckBox;
wxChoice* m_Inner12Choice;
wxTextCtrl* m_Inner11Name;
wxCheckBox* m_Inner11CheckBox;
wxChoice* m_Inner11Choice;
wxTextCtrl* m_Inner10Name;
wxCheckBox* m_Inner10CheckBox;
wxChoice* m_Inner10Choice;
wxTextCtrl* m_Inner9Name;
wxCheckBox* m_Inner9CheckBox;
wxChoice* m_Inner9Choice;
wxTextCtrl* m_Inner8Name;
wxCheckBox* m_Inner8CheckBox;
wxChoice* m_Inner8Choice;
wxTextCtrl* m_Inner7Name;
wxCheckBox* m_Inner7CheckBox;
wxChoice* m_Inner7Choice;
wxTextCtrl* m_Inner6Name;
wxCheckBox* m_Inner6CheckBox;
wxChoice* m_Inner6Choice;
wxTextCtrl* m_Inner5Name;
wxCheckBox* m_Inner5CheckBox;
wxChoice* m_Inner5Choice;
wxTextCtrl* m_Inner4Name;
wxCheckBox* m_Inner4CheckBox;
wxChoice* m_Inner4Choice;
wxTextCtrl* m_Inner3Name;
wxCheckBox* m_Inner3CheckBox;
wxChoice* m_Inner3Choice;
wxTextCtrl* m_Inner2Name; wxTextCtrl* m_Inner2Name;
wxPanel* m_Inner2Panel;
wxCheckBox* m_Inner2CheckBox; wxCheckBox* m_Inner2CheckBox;
wxChoice* m_Inner2Choice; wxChoice* m_Inner2Choice;
wxTextCtrl* m_Inner3Name;
wxPanel* m_Inner3Panel;
wxCheckBox* m_Inner3CheckBox;
wxChoice* m_Inner3Choice;
wxTextCtrl* m_Inner4Name;
wxPanel* m_Inner4Panel;
wxCheckBox* m_Inner4CheckBox;
wxChoice* m_Inner4Choice;
wxTextCtrl* m_Inner5Name;
wxPanel* m_Inner5Panel;
wxCheckBox* m_Inner5CheckBox;
wxChoice* m_Inner5Choice;
wxTextCtrl* m_Inner6Name;
wxPanel* m_Inner6Panel;
wxCheckBox* m_Inner6CheckBox;
wxChoice* m_Inner6Choice;
wxTextCtrl* m_Inner7Name;
wxPanel* m_Inner7Panel;
wxCheckBox* m_Inner7CheckBox;
wxChoice* m_Inner7Choice;
wxTextCtrl* m_Inner8Name;
wxPanel* m_Inner8Panel;
wxCheckBox* m_Inner8CheckBox;
wxChoice* m_Inner8Choice;
wxTextCtrl* m_Inner9Name;
wxPanel* m_Inner9Panel;
wxCheckBox* m_Inner9CheckBox;
wxChoice* m_Inner9Choice;
wxTextCtrl* m_Inner10Name;
wxPanel* m_Inner10Panel;
wxCheckBox* m_Inner10CheckBox;
wxChoice* m_Inner10Choice;
wxTextCtrl* m_Inner11Name;
wxPanel* m_Inner11Panel;
wxCheckBox* m_Inner11CheckBox;
wxChoice* m_Inner11Choice;
wxTextCtrl* m_Inner12Name;
wxPanel* m_Inner12Panel;
wxCheckBox* m_Inner12CheckBox;
wxChoice* m_Inner12Choice;
wxTextCtrl* m_Inner13Name;
wxPanel* m_Inner13Panel;
wxCheckBox* m_Inner13CheckBox;
wxChoice* m_Inner13Choice;
wxTextCtrl* m_Inner14Name;
wxPanel* m_Inner14Panel;
wxCheckBox* m_Inner14CheckBox;
wxChoice* m_Inner14Choice;
wxTextCtrl* m_Inner15Name;
wxPanel* m_Inner15Panel;
wxCheckBox* m_Inner15CheckBox;
wxChoice* m_Inner15Choice;
wxTextCtrl* m_BackName; wxTextCtrl* m_BackName;
wxPanel* m_BackPanel;
wxCheckBox* m_BackCheckBox; wxCheckBox* m_BackCheckBox;
wxChoice* m_BackChoice; wxChoice* m_BackChoice;
wxStaticText* m_MaskBackName; wxStaticText* m_MaskBackName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment