Commit 00935021 authored by dickelbeck's avatar dickelbeck

++pcbnew

    Renamed dialog_layers_setup* files.
    Got rid of the header file since there was only one file including it.
parent 0b41d484
...@@ -4,6 +4,13 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,13 @@ KiCad ChangeLog 2009
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.
2009-Dec-20 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
Renamed dialog_layers_setup* files.
Got rid of the header file since there was only one file including it.
2009-Dec-11 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Dec-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
++pcbnew ++pcbnew
......
...@@ -53,12 +53,8 @@ set(PCBNEW_SRCS ...@@ -53,12 +53,8 @@ set(PCBNEW_SRCS
dialog_graphic_item_properties_base.cpp dialog_graphic_item_properties_base.cpp
# dialog_initpcb.cpp # dialog_initpcb.cpp
# Bear with us temporarily while we play with a couple of strategies, Dick. dialog_layers_setup.cpp
# Eventually these filenames will get changed. dialog_layers_setup_base.cpp
# dialog_layers_setup.cpp
dialog_layers_setup2.cpp
dialog_layers_setup_base2.cpp
dialog_netlist.cpp dialog_netlist.cpp
dialog_netlist_fbp.cpp dialog_netlist_fbp.cpp
dialog_pcb_text_properties.cpp dialog_pcb_text_properties.cpp
......
/////////////////////////////////////////////////////////////////////////// /*
// C++ code generated with wxFormBuilder (version Apr 16 2008) * This program source code file is part of KICAD, a free EDA CAD application.
// http://www.wxformbuilder.org/ *
/////////////////////////////////////////////////////////////////////////// * Copyright (C) 2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2009 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* functions relatives to the design rules editor
*/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
...@@ -10,1026 +33,589 @@ ...@@ -10,1026 +33,589 @@
#include "confirm.h" #include "confirm.h"
#include "pcbnew.h" #include "pcbnew.h"
#include "wxPcbStruct.h" #include "wxPcbStruct.h"
#include "class_board_design_settings.h"
#include "pcbnew_id.h" #include "dialog_layers_setup_base.h"
#include "dialog_layers_setup.h" #include "class_board_design_settings.h"
///////////////////////////////////////////////////////////////////////////
//==============================================================================
//
// CHANGE HERE IF YOU WANT TO CHANGE THE DIALOG'S APEARANCE
//
//==============================================================================
// Define as 1 to show the layers in Pcbnew's original order /**
#define ORIGINAL_KICAD_LAYER_ORDER 0 * Struct CTLs
* holds the 3 ui control pointers for a single board layer.
*/
struct CTLs
{
CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc )
{
name = aName;
checkbox = aCheckBox;
choice = aChoiceOrDesc;
}
// Define as 1 to show colored rows backgrounds in the list panel wxControl* name;
#define PANEL_BACKGROUND_COLORED 1 wxCheckBox* checkbox;
wxControl* choice;
};
// Setting this to 1 gives insteresting (and odd) results, some may like
#define CONTROL_BACKGROUND_COLORED 0
// Works best when LIST_CONTROLS_FLAGS includes wxALL class DIALOG_LAYERS_SETUP : public DIALOG_LAYERS_SETUP_BASE
#define HIGHLIGHT_BACKGROUND_OTHER_THAN_CHECBOXES 0 {
private:
static wxPoint s_LastPos;
static wxSize s_LastSize;
// Uncommenting wxSIMPLE_BORDER will create a visibled grid WinEDA_PcbFrame* m_Parent;
#define LIST_PANELS_STYLE (wxTAB_TRAVERSAL/*|wxSIMPLE_BORDER*/)
// Uncommenting wxALL will add a margin between rows, but waste some visual space int m_CopperLayerCount;
#define LIST_CONTROLS_FLAGS (wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL/*|wxALL*/) int m_EnabledLayers;
//============================================================================== BOARD* m_Pcb;
// IDs for the dialog controls
enum void init();
{
ID_LAYERNAMES = ( wxID_HIGHEST + 1 ),
ID_CHECKBOXES = ( ID_LAYERNAMES + NB_LAYERS ),
ID_LAYERTYPES = ( ID_CHECKBOXES + NB_LAYERS ),
};
//============================================================================== void setLayerCheckBox( int layer, bool isChecked );
// We want our dialog to remember its previous screen position void setCopperLayerCheckBoxes( int copperCount );
wxPoint DialogLayerSetup::m_DialogLastPosition( -1, -1 ); void showCopperChoice( int copperCount );
void showBoardLayerNames();
void showSelectedLayerCheckBoxes( int enableLayerMask );
void showLayerTypes();
void showPresets( int enabledLayerMask );
//============================================================================== /** return the selected layer mask within the UI checkboxes */
// Layer order on the list panel int getUILayerMask();
wxString getLayerName( int layer );
int getLayerTypeIndex( int layer );
#if ORIGINAL_KICAD_LAYER_ORDER
// Kicad's original order void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnCheckBox( wxCommandEvent& event );
void DenyChangeCheckBox( wxCommandEvent& event );
void OnPresetsChoice( wxCommandEvent& event );
void OnCopperLayersChoice( wxCommandEvent& event );
static const int LayerOrder[NB_LAYERS] = bool testLayerNames();
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 };
#else /**
* Function getCTLs
* maps \a aLayerNumber to the wx IDs for that layer which are
* the layer name control ID, checkbox control ID, and choice control ID
*/
CTLs getCTLs( int aLayerNumber );
// Real board order wxControl* getName( int aLayer )
{
return getCTLs( aLayer ).name;
}
static const int LayerOrder[NB_LAYERS] = wxCheckBox* getCheckBox( int aLayer )
{ 17, 19, 21, 23, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, {
3, 2, 1, 0, 22, 20, 18, 16, 28, 27, 26, 25, 24 }; return getCTLs( aLayer ).checkbox;
}
#endif wxChoice* getChoice( int aLayer )
{
return (wxChoice*) getCTLs( aLayer ).choice;
}
//==============================================================================
// Categories for coloring the rows backgrounds (0 means default dialog color).
static const int LayerCategories[NB_LAYERS] = public:
{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 2, 2, 2, 2, 5, 5, 5, 5, 4 }; DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent );
~DIALOG_LAYERS_SETUP( ) { };
//============================================================================== bool Show( bool show ); // overload stock function
// Colors for the rows backgrounds in layer list
static const wxColour LayerCategoriesColors[5] =
{
wxColour( 236, 233, 236 ), // 1
wxColour( 255, 252, 235 ), // 2
wxColour( 236, 253, 216 ), // 3
wxColour( 255, 253, 216 ), // 4
wxColour( 236, 233, 255 ) // 5
}; };
//==============================================================================
// Descriptive types for non-copper layers
static const wxString LayerCategoriesNames[NB_LAYERS] = // We want our dialog to remember its previous screen position
{ wxPoint DIALOG_LAYERS_SETUP::s_LastPos( -1, -1 );
_( "Unknown" ), // Not used wxSize DIALOG_LAYERS_SETUP::s_LastSize;
_( "Off-board, manufacturing" ), // 1
_( "On-board, non-copper" ), // 2
_( "On-board, copper" ), // 3
_( "Board contour" ), // 4
_( "Auxiliary" ) // 5
};
//==============================================================================
// Names for the presets
static const wxString m_PresetsChoiceChoices[] = // Layer bit masks for each defined "Preset Layer Grouping"
static const int presets[] =
{ {
_("All Layers On"), #define FRONT_AUX (SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CMP | ADHESIVE_LAYER_CMP | SOLDERPASTE_LAYER_CMP)
_("Single Side"), #define BACK_AUX (SILKSCREEN_LAYER_CU | SOLDERMASK_LAYER_CU | ADHESIVE_LAYER_CU | SOLDERPASTE_LAYER_CU)
_("Single Side, SMD on Back"),
_("Two Layers, Parts on Front"),
_("Two Layers, Parts on Both Faces"),
_("Four Layers, Parts on Front"),
_("Four Layers, Parts on Both Faces")
};
#define PRESETS_CHOICE_N_CHOICES ((int)(sizeof m_PresetsChoiceChoices/sizeof m_PresetsChoiceChoices[0]))
//============================================================================== 0, // shift the array index up by one, matches with "Custom".
// Bit masks (for all layers) for each defined preset
static const int Presets[] = // "Two layers, parts on Front only"
{ EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | FRONT_AUX,
ALL_LAYERS, // 0x1fffffff
SILKSCREEN_LAYER_CMP | CUIVRE_LAYER | SOLDERMASK_LAYER_CU | EDGE_LAYER, // 0x10600001
SILKSCREEN_LAYER_CMP | CUIVRE_LAYER | SOLDERMASK_LAYER_CU |
ADHESIVE_LAYER_CU | EDGE_LAYER, // 0x10610001
SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CMP | CMP_LAYER | CUIVRE_LAYER |
SOLDERMASK_LAYER_CU | EDGE_LAYER, // 0x10e08001
SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CMP | CMP_LAYER | CUIVRE_LAYER |
SOLDERMASK_LAYER_CU | SILKSCREEN_LAYER_CU | EDGE_LAYER, // 0x10f08001
SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CMP | CMP_LAYER | LAYER_3 |
LAYER_2 | CUIVRE_LAYER | SOLDERMASK_LAYER_CU | EDGE_LAYER, // 0x10e08007
SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CMP | CMP_LAYER | LAYER_3 | LAYER_2 |
CUIVRE_LAYER | SOLDERMASK_LAYER_CU | SILKSCREEN_LAYER_CU | EDGE_LAYER // 0x10f08007
};
//============================================================================== // "Two layers, parts on Back only",
// Options to show in the copper layer choice widget EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX,
static const wxString m_LayerNumberChoiceChoices[] = // "Two layers, parts on Front and Back",
{ EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX | FRONT_AUX,
wxT("1"),
wxT("2"),
wxT("4"),
wxT("6"),
wxT("8"),
wxT("10"),
wxT("12"),
wxT("14"),
wxT("16")
};
#define LAYER_NUMBER_CHOICE_N_CHOICES ((int)(sizeof m_LayerNumberChoiceChoices/sizeof m_LayerNumberChoiceChoices[0])) // "Four layers, parts on Front only"
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX,
//============================================================================== // "Four layers, parts on Front and Back"
// Bit masks for copper layers, one for each option in the copper layer choice widget EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX | BACK_AUX,
static const int CopperMasks[] = // "All layers on",
{ ALL_LAYERS,
0x00000001,
0x00008001,
0x00008007,
0x0000801f,
0x0000807f,
0x000081ff,
0x000087ff,
0x00009fff,
0x0000ffff
}; };
//==============================================================================
// Names for the types of copper layers
static const wxString m_LayerTypeChoiceChoices[] = CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
{ {
wxT("Signal"), #define RETCOP(x) return CTLs( x##Name, x##CheckBox, x##Choice );
wxT("Power"), #define RETAUX(x) return CTLs( x##Name, x##CheckBox, x##StaticText );
wxT("Mixed"),
wxT("Jumper")
};
#define LAYER_TYPE_CHOICE_N_CHOICES ( sizeof m_LayerTypeChoiceChoices / sizeof m_LayerTypeChoiceChoices[0] ) switch( aLayerNumber )
{
//============================================================================== case ADHESIVE_N_CMP: RETAUX( m_AdhesFront );
// Helper function, only needed if we are goint to color the rows case SOLDERPASTE_N_CMP: RETAUX( m_SoldPFront );
case SILKSCREEN_N_CMP: RETAUX( m_SilkSFront );
#if PANEL_BACKGROUND_COLORED case SOLDERMASK_N_CMP: RETAUX( m_MaskFront );
case LAYER_N_FRONT: RETCOP( m_Front );
case LAYER_N_2: RETCOP( m_Inner2 );
case LAYER_N_3: RETCOP( m_Inner3 );
case LAYER_N_4: RETCOP( m_Inner4 );
case LAYER_N_5: RETCOP( m_Inner5 );
case LAYER_N_6: RETCOP( m_Inner6 );
case LAYER_N_7: RETCOP( m_Inner7 );
case LAYER_N_8: RETCOP( m_Inner8 );
case LAYER_N_9: RETCOP( m_Inner9 );
case LAYER_N_10: RETCOP( m_Inner10 );
case LAYER_N_11: RETCOP( m_Inner11 );
case LAYER_N_12: RETCOP( m_Inner12 );
case LAYER_N_13: RETCOP( m_Inner13 );
case LAYER_N_14: RETCOP( m_Inner14 );
case LAYER_N_15: RETCOP( m_Inner15 );
case LAYER_N_BACK: RETCOP( m_Back );
case SOLDERMASK_N_CU: RETAUX( m_MaskBack );
case SILKSCREEN_N_CU: RETAUX( m_SilkSBack );
case SOLDERPASTE_N_CU: RETAUX( m_SoldPBack );
case ADHESIVE_N_CU: RETAUX( m_AdhesBack );
case EDGE_N: RETAUX( m_PCBEdges );
case ECO2_N: RETAUX( m_Eco2 );
case ECO1_N: RETAUX( m_Eco1 );
case COMMENT_N: RETAUX( m_Comments );
case DRAW_N: RETAUX( m_Drawings );
default:
// wxDEBUGMSG( "bad layer id" );
return CTLs( 0, 0, 0 );
}
static wxColour GetRowColor( int Layer ) #undef RETCOP
{ #undef RETAUX
if( ! IsValidLayerIndex( Layer ) || LayerCategories[Layer] == 0 )
return wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE );
else
return LayerCategoriesColors[LayerCategories[Layer]-1];
} }
#endif // PANEL_BACKGROUND_COLORED
//==============================================================================
static wxString GetCategoryName( int Layer ) /***********************************************************************************/
DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ) :
DIALOG_LAYERS_SETUP_BASE( parent )
/***********************************************************************************/
{ {
if( ! IsValidLayerIndex( Layer )) m_Parent = parent;
return wxEmptyString; m_Pcb = m_Parent->GetBoard();
int Category = LayerCategories[Layer]; init();
if( Category < 0 || Category >= (int)( sizeof LayerCategoriesNames / sizeof LayerCategoriesNames[0] )) SetAutoLayout( true );
return wxEmptyString; Layout();
else
return LayerCategoriesNames[Category];
}
//============================================================================== Center();
// We will get the names for all the layers here, it will ease things if in the
// future the non-copper layers names can be changed.
wxString DialogLayerSetup::GetLayerName( int Layer ) m_sdbSizer2OK->SetFocus();
{
return m_Pcb->GetLayerName( Layer );
/*
if( Layer < 0 || Layer >= NB_LAYERS )
return wxEmptyString;
else if( Layer < NB_COPPER_LAYERS )
return m_Pcb->GetLayerName( Layer );
else
return LayerNames[Layer];
*/
} }
//==============================================================================
void DialogLayerSetup::SetLayerName( int Layer, wxString Name ) bool DIALOG_LAYERS_SETUP::Show( bool show )
{ {
m_Pcb->SetLayerName( Layer, Name ); bool ret;
}
//============================================================================== if( show )
{
if( s_LastPos.x != -1 )
{
SetSize( s_LastPos.x, s_LastPos.y, s_LastSize.x, s_LastSize.y, 0 );
}
ret = DIALOG_LAYERS_SETUP_BASE::Show( show );
}
else
{
// Save the dialog's position before hiding
s_LastPos = GetPosition();
s_LastSize = GetSize();
int DialogLayerSetup::GetLayerType( int Layer ) ret = DIALOG_LAYERS_SETUP_BASE::Show( show );
{ }
return m_Pcb->GetLayerType( Layer );
}
//============================================================================== return ret;
void DialogLayerSetup::SetLayerType( int Layer, LAYER_T Type )
{
m_Pcb->SetLayerType( Layer, Type );
} }
//==============================================================================
// The layer mask for non-copper layers is obtained from the new
// EDA_BoardDesignSettings::m_EnabledLayers, but for compatibility, the mask
// for the copper-layers is obtained from g_DesignSettings::m_CopperLayerCount
// Hopefully in the future we may unify them, perhaps saving only the mask and
// at load time calculating the number, or dropping the number completely if
// possible.
int DialogLayerSetup::GetLayersMask() void DIALOG_LAYERS_SETUP::showCopperChoice( int copperCount )
{ {
int Aux = m_Pcb->m_BoardSettings->GetCopperLayerCount(); static const int copperCounts[] = { 2,4,6,8,10,12,14,16 };
// Here we transform the number of copper layers in an index to the table
// CopperMasks, and also do some consistency check.
if( Aux <= 1 )
Aux = 0;
else if( Aux > 16 )
Aux = 8;
else
Aux /= 2;
return CopperMasks[Aux] | ( m_Pcb->GetEnabledLayers() & ALL_NO_CU_LAYERS );
}
//============================================================================== D(printf("boardsCopperCount=%d\n", copperCount );)
// This function translates from the dialog's layer order to Kicad's layer order.
static int GetLayerNumber( int Row ) for( unsigned i = 0; i<sizeof(copperCounts); ++i )
{ {
return LayerOrder[Row]; // note this will change a one layer board to 2:
if( copperCount <= copperCounts[i] )
{
m_CopperLayersChoice->SetSelection(i);
break;
}
}
} }
//==============================================================================
DialogLayerSetup::DialogLayerSetup( WinEDA_PcbFrame* parent, const wxPoint& pos, wxWindowID id, const wxString& title, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
m_Parent = parent;
m_Pcb = m_Parent->GetBoard();
if( pos == wxDefaultPosition )
SetPosition( m_DialogLastPosition );
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* m_MainSizer;
m_MainSizer = new wxBoxSizer( wxVERTICAL );
m_MainPanel = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* m_MainPanelSizer;
m_MainPanelSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_ChoicesSizer;
m_ChoicesSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_PresetsSizer;
m_PresetsSizer = new wxBoxSizer( wxVERTICAL );
m_PresetsCaption = new wxStaticText( m_MainPanel, wxID_ANY, wxT("Presets"), wxDefaultPosition, wxDefaultSize, 0 );
m_PresetsCaption->Wrap( -1 );
m_PresetsSizer->Add( m_PresetsCaption, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
m_PresetsChoice = new wxChoice( m_MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, PRESETS_CHOICE_N_CHOICES, m_PresetsChoiceChoices, 0 );
m_PresetsChoice->SetSelection( 0 );
m_PresetsChoice->SetToolTip( wxT("Choose the type which better describes your board") );
m_PresetsSizer->Add( m_PresetsChoice, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_ChoicesSizer->Add( m_PresetsSizer, 1, wxEXPAND, 5 );
wxBoxSizer* m_LayerNumberSizer;
m_LayerNumberSizer = new wxBoxSizer( wxVERTICAL );
m_LayerNumberCaption = new wxStaticText( m_MainPanel, wxID_ANY, wxT("Copper Layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerNumberCaption->Wrap( -1 );
m_LayerNumberSizer->Add( m_LayerNumberCaption, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LayerNumberChoice = new wxChoice( m_MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, LAYER_NUMBER_CHOICE_N_CHOICES, m_LayerNumberChoiceChoices, 0 );
m_LayerNumberChoice->SetSelection( 8 );
m_LayerNumberChoice->SetToolTip( wxT("Choose how many copper layers you need") );
m_LayerNumberSizer->Add( m_LayerNumberChoice, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_ChoicesSizer->Add( m_LayerNumberSizer, 0, wxEXPAND, 5 );
m_MainPanelSizer->Add( m_ChoicesSizer, 0, wxEXPAND, 5 );
m_Separator1 = new wxStaticLine( m_MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
m_MainPanelSizer->Add( m_Separator1, 0, wxEXPAND | wxALL, 5 );
m_LayersCaptionText = new wxStaticText( m_MainPanel, wxID_ANY, wxT("Layers"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayersCaptionText->Wrap( -1 );
m_MainPanelSizer->Add( m_LayersCaptionText, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_LayersPanel = new wxPanel( m_MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* m_LayersPanelSizer;
m_LayersPanelSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_LayerCaptionsSizer;
m_LayerCaptionsSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_LayerNameCaptionSizer;
m_LayerNameCaptionSizer = new wxBoxSizer( wxVERTICAL );
m_LayerNameCaptionText = new wxStaticText( m_LayersPanel, wxID_ANY, wxT("Name"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerNameCaptionText->Wrap( -1 );
m_LayerNameCaptionText->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
m_LayerNameCaptionSizer->Add( m_LayerNameCaptionText, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5 );
m_LayerCaptionsSizer->Add( m_LayerNameCaptionSizer, 0, wxEXPAND, 5 );
wxBoxSizer* m_LayerEnabledCaptionSizer;
m_LayerEnabledCaptionSizer = new wxBoxSizer( wxVERTICAL );
m_LayerEnabledCaptionText = new wxStaticText( m_LayersPanel, wxID_ANY, wxT("Enabled"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerEnabledCaptionText->Wrap( -1 );
m_LayerEnabledCaptionText->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
m_LayerEnabledCaptionSizer->Add( m_LayerEnabledCaptionText, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5 );
m_LayerCaptionsSizer->Add( m_LayerEnabledCaptionSizer, 0, wxEXPAND, 5 );
wxBoxSizer* m_LayerTypeCaptionSizer;
m_LayerTypeCaptionSizer = new wxBoxSizer( wxVERTICAL );
m_LayerTypeCaptionText = new wxStaticText( m_LayersPanel, wxID_ANY, wxT("Type"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerTypeCaptionText->Wrap( -1 );
m_LayerTypeCaptionText->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
m_LayerTypeCaptionSizer->Add( m_LayerTypeCaptionText, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, 5 );
m_LayerCaptionsSizer->Add( m_LayerTypeCaptionSizer, 0, wxEXPAND, 5 ); void DIALOG_LAYERS_SETUP::showBoardLayerNames()
{
m_LayersPanelSizer->Add( m_LayerCaptionsSizer, 0, wxEXPAND, 5 ); // Establish all the board's layer names into the dialog presentation, by
// obtaining them from BOARD::GetLayerName() which calls
m_LayerListScroller = new wxScrolledWindow( m_LayersPanel, wxID_ANY, wxDefaultPosition, wxSize( -1, 300 )/* wxDefaultSize */, wxALWAYS_SHOW_SB|wxVSCROLL ); // BOARD::GetDefaultLayerName() for non-coppers.
m_LayerListScroller->SetMinSize( wxSize( -1, 300 ) );
wxBoxSizer* bSizer18;
bSizer18 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* m_LayerListSizer;
m_LayerListSizer = new wxBoxSizer( wxHORIZONTAL );
//--------------------------------------------------------------------------
// Create the controls inside the scrolled window
wxGridSizer* m_LayerNameListSizer;
m_LayerNameListSizer = new wxGridSizer( 32, 1, 0, 0 );
for( int Row = 0; Row < NB_LAYERS; Row++ ) for( int layer=0; layer<NB_LAYERS; ++layer )
{ {
int Layer = GetLayerNumber( Row ); wxControl* ctl = getName( layer );
//----------------------------------------------------------------------
// Create a panel and sizer for each layer name
m_LayerNamePanel[Layer] = new wxPanel( m_LayerListScroller, wxID_ANY, wxDefaultPosition, wxDefaultSize, LIST_PANELS_STYLE );
#if PANEL_BACKGROUND_COLORED wxASSERT( ctl );
m_LayerNamePanel[Layer]->SetBackgroundColour( GetRowColor( Layer ));
#endif // PANEL_BACKGROUND_COLORED
wxBoxSizer* m_LayerNameSizer = new wxBoxSizer( wxHORIZONTAL ); if( ctl )
if( Layer >= NB_COPPER_LAYERS )
{ {
//---------------------------------------------------------------------- wxString lname = m_Pcb->GetLayerName( layer );
// The non-copper layer names canot be changed, we use just a static text
m_LayerNameStaticText[Layer-NB_COPPER_LAYERS] = new wxStaticText( m_LayerNamePanel[Layer], ID_LAYERNAMES + Layer, GetLayerName( Layer ), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerNameStaticText[Layer-NB_COPPER_LAYERS]->Wrap( -1 );
m_LayerNameStaticText[Layer-NB_COPPER_LAYERS]->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
m_LayerNameSizer->Add( m_LayerNameStaticText[Layer-NB_COPPER_LAYERS], 1, LIST_CONTROLS_FLAGS, 5 ); D(printf("layerName[%d]=%s\n", layer, CONV_TO_UTF8( lname ) );)
m_LayerNamePanel[Layer]->SetSizer( m_LayerNameSizer ); if( ctl->IsKindOf( CLASSINFO(wxTextCtrl) ) )
m_LayerNamePanel[Layer]->Layout(); ((wxTextCtrl*)ctl)->SetValue( lname ); // wxTextCtrl
m_LayerNameSizer->Fit( m_LayerNamePanel[Layer] );
m_LayerNameListSizer->Add( m_LayerNamePanel[Layer], 0, wxEXPAND, 5 );
}
else else
{ ctl->SetLabel( lname ); // wxStaticText
//----------------------------------------------------------------------
// The copper layer names can be changed, we need a text control
m_LayerNameTextCtrl[Layer] = new wxTextCtrl( m_LayerNamePanel[Layer], ID_LAYERNAMES + Layer, GetLayerName( Layer ), wxDefaultPosition, wxDefaultSize, 0 /*|wxNO_BORDER*/ );
m_LayerNameTextCtrl[Layer]->SetMaxLength( 20 );
#if CONTROL_BACKGROUND_COLORED
m_LayerNameTextCtrl[Layer]->SetBackgroundColour( GetRowColor( Layer ));
#endif // CONTROL_BACKGROUND_COLORED
m_LayerNameTextCtrl[Layer]->SetToolTip( wxT("Edit Copper Layer Name") );
m_LayerNameSizer->Add( m_LayerNameTextCtrl[Layer], 1, LIST_CONTROLS_FLAGS, 5 );
m_LayerNamePanel[Layer]->SetSizer( m_LayerNameSizer );
m_LayerNamePanel[Layer]->Layout();
m_LayerNameSizer->Fit( m_LayerNamePanel[Layer] );
m_LayerNameListSizer->Add( m_LayerNamePanel[Layer], 0, wxEXPAND, 5 );
} }
} }
}
m_LayerListSizer->Add( m_LayerNameListSizer, 0, wxEXPAND, 5 );
//--------------------------------------------------------------------------
// Create the controls inside the scrolled window
wxGridSizer* m_LayerEnabledListSizer;
m_LayerEnabledListSizer = new wxGridSizer( 32, 1, 0, 0 );
for( int Row = 0; Row < NB_LAYERS; Row++ ) void DIALOG_LAYERS_SETUP::showSelectedLayerCheckBoxes( int enabledLayers )
{
for( int layer=0; layer<NB_LAYERS; ++layer )
{ {
int Layer = GetLayerNumber( Row ); setLayerCheckBox( layer, (1<<layer) & enabledLayers );
//----------------------------------------------------------------------
// Create a panel and sizer for each layer enable check-box
m_LayerEnabledPanel[Layer] = new wxPanel( m_LayerListScroller, wxID_ANY, wxDefaultPosition, wxDefaultSize, LIST_PANELS_STYLE );
#if PANEL_BACKGROUND_COLORED
m_LayerEnabledPanel[Layer]->SetBackgroundColour( GetRowColor( Layer ));
#endif // PANEL_BACKGROUND_COLORED
wxBoxSizer* m_LayerEnabledSizer;
m_LayerEnabledSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* m_LayerEnabledSizerInt;
m_LayerEnabledSizerInt = new wxBoxSizer( wxHORIZONTAL );
m_LayerEnabledCheckBox[Layer] = new wxCheckBox( m_LayerEnabledPanel[Layer], ID_CHECKBOXES + Layer, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_LayerEnabledCheckBox[Layer]->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
m_LayerEnabledCheckBox[Layer]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DDKSHADOW ) );
m_LayerEnabledCheckBox[Layer]->SetToolTip( wxT("Enable/Disable Layer") );
m_LayerEnabledSizerInt->Add( m_LayerEnabledCheckBox[Layer], 0, LIST_CONTROLS_FLAGS, 5 );
m_LayerEnabledSizer->Add( m_LayerEnabledSizerInt, 1, wxALIGN_CENTER_HORIZONTAL, 5 );
m_LayerEnabledPanel[Layer]->SetSizer( m_LayerEnabledSizer );
m_LayerEnabledPanel[Layer]->Layout();
m_LayerEnabledSizer->Fit( m_LayerEnabledPanel[Layer] );
m_LayerEnabledListSizer->Add( m_LayerEnabledPanel[Layer], 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
} }
}
m_LayerListSizer->Add( m_LayerEnabledListSizer, 0, wxEXPAND, 5 );
//--------------------------------------------------------------------------
// Create the controls inside the scrolled window
wxGridSizer* m_LayerTypeListSizer;
m_LayerTypeListSizer = new wxGridSizer( 32, 1, 0, 0 );
for( int Row = 0; Row < NB_LAYERS; Row++ )
{
int Layer = GetLayerNumber( Row );
//----------------------------------------------------------------------
// Create a panel and sizer for each layer enable chack-box
m_LayerTypePanel[Layer] = new wxPanel( m_LayerListScroller, wxID_ANY, wxDefaultPosition, wxDefaultSize, LIST_PANELS_STYLE );
#if PANEL_BACKGROUND_COLORED
m_LayerTypePanel[Layer]->SetBackgroundColour( GetRowColor( Layer ));
#endif // PANEL_BACKGROUND_COLORED
wxBoxSizer* m_LayerTypeSizer; void DIALOG_LAYERS_SETUP::showPresets( int enabledLayers )
m_LayerTypeSizer = new wxBoxSizer( wxHORIZONTAL ); {
int presetsNdx = 0; // the "Custom" setting, matches nothing
if( Layer >= NB_COPPER_LAYERS ) for( unsigned i=1; i<DIM(presets); ++i )
{ {
//---------------------------------------------------------------------- if( enabledLayers == presets[i] )
// The non-copper layer types canot be changed, we use just a static text
m_LayerTypeStaticText[Layer-NB_COPPER_LAYERS] = new wxStaticText( m_LayerTypePanel[Layer], ID_LAYERTYPES + Layer, GetCategoryName( Layer ), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerTypeStaticText[Layer-NB_COPPER_LAYERS]->Wrap( -1 );
m_LayerTypeStaticText[Layer-NB_COPPER_LAYERS]->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
m_LayerTypeSizer->Add( m_LayerTypeStaticText[Layer-NB_COPPER_LAYERS], 1, LIST_CONTROLS_FLAGS, 5 );
m_LayerTypePanel[Layer]->SetSizer( m_LayerTypeSizer );
m_LayerTypePanel[Layer]->Layout();
m_LayerTypeSizer->Fit( m_LayerTypePanel[Layer] );
m_LayerTypeListSizer->Add( m_LayerTypePanel[Layer], 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
}
else
{ {
//---------------------------------------------------------------------- presetsNdx = i;
// The copper layer names can be changed, we need a choice control break;
m_LayerTypeChoice[Layer] = new wxChoice( m_LayerTypePanel[Layer], ID_LAYERTYPES + Layer, wxDefaultPosition, wxDefaultSize, LAYER_TYPE_CHOICE_N_CHOICES, m_LayerTypeChoiceChoices, 0 );
m_LayerTypeChoice[Layer]->SetSelection( GetLayerType( Layer ));
m_LayerTypeChoice[Layer]->SetToolTip( wxT("Choose Copper Layer Type") );
#if CONTROL_BACKGROUND_COLORED
m_LayerTypeChoice[Layer]->SetBackgroundColour( GetRowColor( Layer ));
#endif // CONTROL_BACKGROUND_COLORED
m_LayerTypeSizer->Add( m_LayerTypeChoice[Layer], 1, LIST_CONTROLS_FLAGS, 5 );
m_LayerTypePanel[Layer]->SetSizer( m_LayerTypeSizer );
m_LayerTypePanel[Layer]->Layout();
m_LayerTypeSizer->Fit( m_LayerTypePanel[Layer] );
m_LayerTypeListSizer->Add( m_LayerTypePanel[Layer], 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
} }
} }
m_LayerListSizer->Add( m_LayerTypeListSizer, 0, wxEXPAND, 5 ); m_PresetsChoice->SetSelection( presetsNdx );
}
//--------------------------------------------------------------------------
// Adjust the width of the columns and column captions
int w;
w = max( m_LayerNameListSizer->CalcMin().x, m_LayerNameCaptionSizer->CalcMin().x );
m_LayerNameListSizer->SetMinSize( w, -1 );
m_LayerNameCaptionSizer->SetMinSize( w, -1 );
w = max( m_LayerEnabledListSizer->CalcMin().x, m_LayerEnabledCaptionSizer->CalcMin().x );
m_LayerEnabledListSizer->SetMinSize( w, -1 );
m_LayerEnabledCaptionSizer->SetMinSize( w, -1 );
w = max( m_LayerTypeListSizer->CalcMin().x, m_LayerTypeCaptionSizer->CalcMin().x );
m_LayerTypeListSizer->SetMinSize( w, -1 );
m_LayerTypeCaptionSizer->SetMinSize( w, -1 );
//--------------------------------------------------------------------------
// Make the scroll step be exactly one row
wxSize s = m_LayerNamePanel[0]->GetSize();
m_LayerListScroller->SetScrollRate( 0, s.y );
//--------------------------------------------------------------------------
bSizer18->Add( m_LayerListSizer, 1, 0, 5 );
m_LayerListScroller->SetSizer( bSizer18 );
m_LayerListScroller->Layout();
bSizer18->Fit( m_LayerListScroller );
m_LayersPanelSizer->Add( m_LayerListScroller, 1, wxEXPAND, 5 );
m_LayersPanel->SetSizer( m_LayersPanelSizer );
m_LayersPanel->Layout();
m_LayersPanelSizer->Fit( m_LayersPanel );
m_MainPanelSizer->Add( m_LayersPanel, 1, /*wxEXPAND|*/ wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_Separator2 = new wxStaticLine( m_MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); void DIALOG_LAYERS_SETUP::showLayerTypes()
m_MainPanelSizer->Add( m_Separator2, 0, wxEXPAND | wxALL, 5 ); {
for( int copperLayer = FIRST_COPPER_LAYER;
copperLayer <= LAST_COPPER_LAYER; ++copperLayer )
{
wxChoice* ctl = getChoice( copperLayer );
ctl->SetSelection( m_Pcb->GetLayerType( copperLayer ) );
}
}
m_StdButtonsSizer = new wxStdDialogButtonSizer();
m_StdButtonsSizerOK = new wxButton( m_MainPanel, wxID_OK );
m_StdButtonsSizer->AddButton( m_StdButtonsSizerOK );
m_StdButtonsSizerCancel = new wxButton( m_MainPanel, wxID_CANCEL );
m_StdButtonsSizer->AddButton( m_StdButtonsSizerCancel );
m_StdButtonsSizer->Realize();
m_MainPanelSizer->Add( m_StdButtonsSizer, 0, wxALL|wxEXPAND, 5 );
m_MainPanel->SetSizer( m_MainPanelSizer ); /********************************************************************/
m_MainPanel->Layout(); void DIALOG_LAYERS_SETUP::init()
m_MainPanelSizer->Fit( m_MainPanel ); /********************************************************************/
m_MainSizer->Add( m_MainPanel, 1, wxEXPAND | wxALL, 5 ); {
m_CopperLayerCount = m_Pcb->GetCopperLayerCount();
showCopperChoice( m_CopperLayerCount );
this->SetSizer( m_MainSizer ); showBoardLayerNames();
this->Layout();
m_MainSizer->Fit( this );
m_EnabledLayers = m_Pcb->GetEnabledLayers();
showSelectedLayerCheckBoxes( m_EnabledLayers );
showPresets( m_EnabledLayers );
showLayerTypes();
// @todo overload a layout function so we can reposition the column titles,
// which should probably not go in a sizer of their own so that we do not have
// to fight to position them, Dick. Will work this out next.
m_LayersMask = GetLayersMask();
UpdatePresetsChoice(); // Adjust the vertical scroll rate so our list scrolls always one full line each time.
UpdateCopperLayersChoice(); // m_LayersListPanel->SetScrollRate( 0, m_textCtrl1[0]->GetSize().y );
UpdateCheckBoxes(); }
// Connect Events
m_StdButtonsSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLayerSetup::OnCancelClick ), NULL, this );
m_StdButtonsSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLayerSetup::OnOKClick ), NULL, this );
m_PresetsChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DialogLayerSetup::OnPresetChoice ), NULL, this ); int DIALOG_LAYERS_SETUP::getUILayerMask()
m_LayerNumberChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DialogLayerSetup::OnCopperLayersChoice ), NULL, this ); {
int layerMaskResult = 0;
for( int i = 0; i < NB_COPPER_LAYERS; i++ ) for( int layer=0; layer<NB_LAYERS; ++layer )
{ {
m_LayerTypeChoice[i]->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DialogLayerSetup::OnLayerTypeChoice ), NULL, this ); wxCheckBox* ctl = getCheckBox( layer );
#if HIGHLIGHT_BACKGROUND_OTHER_THAN_CHECBOXES if( ctl->GetValue() )
m_LayerTypeChoice[i]->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerTypeKillFocus ), NULL, this );
m_LayerTypeChoice[i]->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerTypeSetFocus ), NULL, this );
m_LayerNameTextCtrl[i]->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerNameKillFocus ), NULL, this );
m_LayerNameTextCtrl[i]->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerNameSetFocus ), NULL, this );
#endif // HIGHLIGHT_BACKGROUND_OTHER_THAN_CHECBOXES
}
for( int i = 0; i < NB_LAYERS; i++ )
{ {
m_LayerEnabledCheckBox[i]->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DialogLayerSetup::OnLayerEnabledCheckBox ), NULL, this ); layerMaskResult |= (1 << layer);
m_LayerEnabledCheckBox[i]->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerEnabledKillFocus ), NULL, this ); }
m_LayerEnabledCheckBox[i]->Connect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerEnabledSetFocus ), NULL, this );
} }
Centre(); return layerMaskResult;
} }
//==============================================================================
DialogLayerSetup::~DialogLayerSetup() void DIALOG_LAYERS_SETUP::setLayerCheckBox( int aLayer, bool isChecked )
{ {
// Disconnect Events wxCheckBox* ctl = getCheckBox( aLayer );
m_StdButtonsSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLayerSetup::OnCancelClick ), NULL, this ); ctl->SetValue( isChecked );
m_StdButtonsSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DialogLayerSetup::OnOKClick ), NULL, this );
m_PresetsChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DialogLayerSetup::OnPresetChoice ), NULL, this );
m_LayerNumberChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DialogLayerSetup::OnCopperLayersChoice ), NULL, this );
for( int i = 0; i < NB_COPPER_LAYERS; i++ )
{
m_LayerTypeChoice[i]->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DialogLayerSetup::OnLayerTypeChoice ), NULL, this );
#if HIGHLIGHT_BACKGROUND_OTHER_THAN_CHECBOXES
m_LayerTypeChoice[i]->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerTypeKillFocus ), NULL, this );
m_LayerTypeChoice[i]->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerTypeSetFocus ), NULL, this );
m_LayerNameTextCtrl[i]->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerNameKillFocus ), NULL, this );
m_LayerNameTextCtrl[i]->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerNameSetFocus ), NULL, this );
#endif // HIGHLIGHT_BACKGROUND_OTHER_THAN_CHECBOXES
}
for( int i = 0; i < NB_LAYERS; i++ )
{
m_LayerEnabledCheckBox[i]->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DialogLayerSetup::OnLayerEnabledCheckBox ), NULL, this );
m_LayerEnabledCheckBox[i]->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerEnabledKillFocus ), NULL, this );
m_LayerEnabledCheckBox[i]->Disconnect( wxEVT_SET_FOCUS, wxFocusEventHandler( DialogLayerSetup::OnLayerEnabledSetFocus ), NULL, this );
}
} }
//==============================================================================
void DialogLayerSetup::UpdateCheckBoxes() void DIALOG_LAYERS_SETUP::setCopperLayerCheckBoxes( int copperCount )
{ {
int i; if( copperCount > 0 )
for( i = 0; i < NB_COPPER_LAYERS; i++ )
{ {
m_LayerEnabledCheckBox[i]->Disable(); setLayerCheckBox( LAYER_N_BACK, true );
--copperCount;
}
if( m_LayersMask >> i & 0x00000001 ) if( copperCount > 0 )
{ {
m_LayerEnabledCheckBox[i]->SetValue( true ); setLayerCheckBox( LAYER_N_FRONT, true );
m_LayerNameTextCtrl[i]->Enable(); --copperCount;
m_LayerTypeChoice[i]->Enable();
} }
else else
{ {
m_LayerEnabledCheckBox[i]->SetValue( false ); setLayerCheckBox( LAYER_N_FRONT, false );
m_LayerNameTextCtrl[i]->Disable();
m_LayerTypeChoice[i]->Disable();
}
m_LayerEnabledCheckBox[i]->Refresh();
} }
for( ; i < NB_LAYERS; i++ ) int layer;
for( layer=LAYER_N_2; copperCount > 0; ++layer, --copperCount )
{ {
m_LayerEnabledCheckBox[i]->SetValue( m_LayersMask >> i & 0x00000001 ); setLayerCheckBox( layer, true );
m_LayerEnabledCheckBox[i]->Refresh();
} }
if( m_LayersMask & CUIVRE_LAYER ) for( ; layer < NB_COPPER_LAYERS-1; ++layer )
{
m_LayerNameStaticText[SOLDERPASTE_N_CU-NB_COPPER_LAYERS]->Enable();
m_LayerEnabledCheckBox[SOLDERPASTE_N_CU]->Enable();
m_LayerTypeStaticText[SOLDERPASTE_N_CU-NB_COPPER_LAYERS]->Enable();
m_LayerNameStaticText[SOLDERMASK_N_CU-NB_COPPER_LAYERS]->Enable();
m_LayerEnabledCheckBox[SOLDERMASK_N_CU]->Enable();
m_LayerTypeStaticText[SOLDERMASK_N_CU-NB_COPPER_LAYERS]->Enable();
}
else
{ {
m_LayerEnabledCheckBox[SOLDERPASTE_N_CU]->SetValue( false ); setLayerCheckBox( layer, false );
m_LayerEnabledCheckBox[SOLDERMASK_N_CU]->SetValue( false );
m_LayerNameStaticText[SOLDERPASTE_N_CU-NB_COPPER_LAYERS]->Disable();
m_LayerEnabledCheckBox[SOLDERPASTE_N_CU]->Disable();
m_LayerTypeStaticText[SOLDERPASTE_N_CU-NB_COPPER_LAYERS]->Disable();
m_LayerNameStaticText[SOLDERMASK_N_CU-NB_COPPER_LAYERS]->Disable();
m_LayerEnabledCheckBox[SOLDERMASK_N_CU]->Disable();
m_LayerTypeStaticText[SOLDERMASK_N_CU-NB_COPPER_LAYERS]->Disable();
} }
}
if( m_LayersMask & CMP_LAYER )
{
m_LayerNameStaticText[SOLDERPASTE_N_CMP-NB_COPPER_LAYERS]->Enable();
m_LayerEnabledCheckBox[SOLDERPASTE_N_CMP]->Enable();
m_LayerTypeStaticText[SOLDERPASTE_N_CMP-NB_COPPER_LAYERS]->Enable();
m_LayerNameStaticText[SOLDERMASK_N_CMP-NB_COPPER_LAYERS]->Enable();
m_LayerEnabledCheckBox[SOLDERMASK_N_CMP]->Enable();
m_LayerTypeStaticText[SOLDERMASK_N_CMP-NB_COPPER_LAYERS]->Enable();
}
else
{
m_LayerEnabledCheckBox[SOLDERPASTE_N_CMP]->SetValue( false );
m_LayerEnabledCheckBox[SOLDERMASK_N_CMP]->SetValue( false );
m_LayerNameStaticText[SOLDERPASTE_N_CMP-NB_COPPER_LAYERS]->Disable(); void DIALOG_LAYERS_SETUP::OnCheckBox( wxCommandEvent& event )
m_LayerEnabledCheckBox[SOLDERPASTE_N_CMP]->Disable(); {
m_LayerTypeStaticText[SOLDERPASTE_N_CMP-NB_COPPER_LAYERS]->Disable(); m_EnabledLayers = getUILayerMask();
m_LayerNameStaticText[SOLDERMASK_N_CMP-NB_COPPER_LAYERS]->Disable(); showPresets( m_EnabledLayers );
m_LayerEnabledCheckBox[SOLDERMASK_N_CMP]->Disable();
m_LayerTypeStaticText[SOLDERMASK_N_CMP-NB_COPPER_LAYERS]->Disable();
}
} }
//==============================================================================
void DialogLayerSetup::UpdateCopperLayersChoice() void DIALOG_LAYERS_SETUP::DenyChangeCheckBox( wxCommandEvent& event )
{ {
int NumberOfCopperLayers = 0; // user may not change copper layer checkboxes from anything other than
// the one place, the drop down m_CopperLayersChoice control.
// Count the copper layers // I tried to simply diable the copper CheckBoxes but they look like crap,
for( int i = 0; i < NB_COPPER_LAYERS; i++ ) // so leave them enabled and reverse the user's attempt to toggle them.
{
if( m_LayersMask >> i & 0x00000001 )
NumberOfCopperLayers++;
}
m_LayerNumberChoice->SetSelection( NumberOfCopperLayers / 2 ); setCopperLayerCheckBoxes( m_CopperLayerCount );
} }
//==============================================================================
void DialogLayerSetup::UpdatePresetsChoice() void DIALOG_LAYERS_SETUP::OnPresetsChoice( wxCommandEvent& event )
{ {
int Selection = -1; unsigned presetNdx = m_PresetsChoice->GetCurrentSelection();
for( int i = 0; i < NB_LAYERS; i++ ) if( presetNdx == 0 ) // the Custom setting controls nothing.
return;
if( presetNdx < DIM(presets) )
{ {
if( m_LayersMask == Presets[i] ) m_EnabledLayers = presets[ presetNdx ];
int coppersMask = m_EnabledLayers & ALL_CU_LAYERS;
int copperCount = 0;
while( coppersMask )
{ {
Selection = i; if( coppersMask & 1 )
break; ++copperCount;
}
coppersMask >>= 1;
} }
m_PresetsChoice->SetSelection( Selection ); m_CopperLayerCount = copperCount;
m_PresetsChoice->Refresh(); showCopperChoice( m_CopperLayerCount );
showSelectedLayerCheckBoxes( m_EnabledLayers );
}
} }
//==============================================================================
void DialogLayerSetup::OnPresetChoice( wxCommandEvent& event ) void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event )
{ {
int Selection = m_PresetsChoice->GetSelection(); m_CopperLayerCount = m_CopperLayersChoice->GetCurrentSelection() * 2 + 2;
if( Selection < 0 || Selection >= PRESETS_CHOICE_N_CHOICES ) setCopperLayerCheckBoxes( m_CopperLayerCount );
return;
m_LayersMask = Presets[Selection];
UpdateCopperLayersChoice();
UpdateCheckBoxes();
// event.Skip(); // event.Skip();
} }
//==============================================================================
void DialogLayerSetup::OnCopperLayersChoice( wxCommandEvent& event )
{
int Selection = m_LayerNumberChoice->GetSelection();
if( Selection < 0 || Selection >= LAYER_NUMBER_CHOICE_N_CHOICES )
return;
m_LayersMask = ( m_LayersMask & ALL_NO_CU_LAYERS ) | CopperMasks[Selection];
UpdatePresetsChoice(); /*****************************************************************/
UpdateCheckBoxes(); void DIALOG_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event )
/*****************************************************************/
// event.Skip(); {
EndModal( 0 );
} }
//==============================================================================
void DialogLayerSetup::OnLayerEnabledCheckBox( wxCommandEvent& event ) /**************************************************************************/
void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
/**************************************************************************/
{ {
int Id = event.GetId(); if( testLayerNames() )
if( Id >= ID_CHECKBOXES && Id < ID_CHECKBOXES + NB_LAYERS )
{ {
int Index = Id - ID_CHECKBOXES; wxString name;
if( m_LayerEnabledCheckBox[Index]->GetValue() )
m_LayersMask |= 1 << Index;
else
m_LayersMask &= ~( 1 << Index );
UpdatePresetsChoice(); m_EnabledLayers = getUILayerMask();
UpdateCheckBoxes(); m_Pcb->SetEnabledLayers( m_EnabledLayers );
}
// event.Skip(); for( int layer = FIRST_COPPER_LAYER;
} layer <= LAST_COPPER_LAYER; ++layer )
{
if( (1<<layer) & m_EnabledLayers )
{
name = getLayerName( layer );
//============================================================================== m_Pcb->SetLayerName( layer, name );
// Checkboxes without captions dont show when they have focus, we will change the color
// of the panel where they reside to allow navigating the dialog by keyboard
void DialogLayerSetup::OnLayerEnabledSetFocus( wxFocusEvent& event ) LAYER_T t = (LAYER_T) getLayerTypeIndex(layer);
{
int Id = event.GetId();
if( Id >= ID_CHECKBOXES && Id < ID_CHECKBOXES + NB_LAYERS ) m_Pcb->SetLayerType( layer, t );
{ }
int Index = Id - ID_CHECKBOXES;
m_LayerEnabledPanel[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
m_LayerEnabledPanel[Index]->Refresh();
} }
// event.Skip(); m_Parent->ReCreateLayerBox( NULL );
}
//==============================================================================
void DialogLayerSetup::OnLayerEnabledKillFocus( wxFocusEvent& event )
{
int Id = event.GetId();
if( Id >= ID_CHECKBOXES && Id < ID_CHECKBOXES + NB_LAYERS ) EndModal( wxID_OK );
{
int Index = Id - ID_CHECKBOXES;
#if PANEL_BACKGROUND_COLORED
m_LayerEnabledPanel[Index]->SetBackgroundColour( GetRowColor( Index ));
#else // PANEL_BACKGROUND_COLORED
m_LayerEnabledPanel[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ));
#endif // PANEL_BACKGROUND_COLORED
m_LayerEnabledPanel[Index]->Refresh();
} }
// event.Skip();
} }
//==============================================================================
void DialogLayerSetup::OnLayerNameSetFocus( wxFocusEvent& event ) int DIALOG_LAYERS_SETUP::getLayerTypeIndex( int aLayer )
{ {
int Id = event.GetId(); wxChoice* ctl = getChoice( aLayer );
if( Id >= ID_LAYERNAMES && Id < ID_LAYERNAMES + NB_COPPER_LAYERS ) int ret = ctl->GetCurrentSelection(); // indices must have same sequence as LAYER_T
{
int Index = Id - ID_LAYERNAMES;
#if CONTROL_BACKGROUND_COLORED
m_LayerNameTextCtrl[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
#endif // CONTROL_BACKGROUND_COLORED
m_LayerNamePanel[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
m_LayerNamePanel[Index]->Refresh();
}
// event.Skip(); return ret;
} }
//==============================================================================
void DialogLayerSetup::OnLayerNameKillFocus( wxFocusEvent& event ) wxString DIALOG_LAYERS_SETUP::getLayerName( int aLayer )
{ {
int Id = event.GetId(); wxString ret;
if( Id >= ID_LAYERNAMES && Id < ID_LAYERNAMES + NB_COPPER_LAYERS ) wxASSERT( aLayer >= FIRST_COPPER_LAYER && aLayer <= LAST_COPPER_LAYER );
{
int Index = Id - ID_LAYERNAMES;
#if CONTROL_BACKGROUND_COLORED
m_LayerNameTextCtrl[Index]->SetBackgroundColour( GetRowColor( Index ));
#endif // CONTROL_BACKGROUND_COLORED
#if PANEL_BACKGROUND_COLORED
m_LayerNamePanel[Index]->SetBackgroundColour( GetRowColor( Index ));
#else // PANEL_BACKGROUND_COLORED
m_LayerNamePanel[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ));
#endif // PANEL_BACKGROUND_COLORED
m_LayerNamePanel[Index]->Refresh();
}
// event.Skip(); wxTextCtrl* ctl = (wxTextCtrl*) getName( aLayer );
}
//==============================================================================
void DialogLayerSetup::OnLayerTypeSetFocus( wxFocusEvent& event )
{
int Id = event.GetId();
if( Id >= ID_LAYERTYPES && Id < ID_LAYERTYPES + NB_COPPER_LAYERS ) ret = ctl->GetValue().Trim();
{
int Index = Id - ID_LAYERTYPES;
#if CONTROL_BACKGROUND_COLORED
m_LayerTypeChoice[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
#endif // CONTROL_BACKGROUND_COLORED
m_LayerTypePanel[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) );
m_LayerTypePanel[Index]->Refresh();
}
// event.Skip(); return ret;
}
static bool hasOneOf( const wxString& str, const wxString& chars )
{
for( unsigned i=0; i<chars.Len(); ++i )
if( str.Find( chars[i] ) != wxNOT_FOUND )
return true;
return false;
} }
//==============================================================================
void DialogLayerSetup::OnLayerTypeKillFocus( wxFocusEvent& event ) bool DIALOG_LAYERS_SETUP::testLayerNames()
{ {
int Id = event.GetId(); std::vector<wxString> names;
wxTextCtrl* ctl;
if( Id >= ID_LAYERTYPES && Id < ID_LAYERTYPES + NB_COPPER_LAYERS ) for( int layer=0; layer<=LAST_COPPER_LAYER; ++layer )
{ {
int Index = Id - ID_LAYERTYPES; // we _can_ rely on m_EnabledLayers being current here:
#if CONTROL_BACKGROUND_COLORED if( !(m_EnabledLayers & (1<<layer)) )
m_LayerTypeChoice[Index]->SetBackgroundColour( GetRowColor( Index )); continue;
#endif // CONTROL_BACKGROUND_COLORED
#if PANEL_BACKGROUND_COLORED
m_LayerTypePanel[Index]->SetBackgroundColour( GetRowColor( Index ));
#else // PANEL_BACKGROUND_COLORED
m_LayerTypePanel[Index]->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ));
#endif // PANEL_BACKGROUND_COLORED
m_LayerTypePanel[Index]->Refresh();
}
// event.Skip(); wxString name = getLayerName( layer );
}
//============================================================================== //D(printf("name[%d]=%s\n", layer, CONV_TO_UTF8(name) );)
void DialogLayerSetup::OnCancelClick( wxCommandEvent& event ) ctl = (wxTextCtrl*) getName( layer );
{
// Save the dialog's position before finishing
m_DialogLastPosition = this->GetPosition();
event.Skip();
}
//============================================================================== // check name for legality.
// 1) cannot be blank.
// 2) cannot have blanks.
// 3) cannot have " chars
// 4) cannot be 'signal'
// 5) must be unique.
void DialogLayerSetup::OnOKClick( wxCommandEvent& event ) static const wxString badchars( wxT("%$\" ") );
{
int NumberOfCopperLayers = 0;
// Count the copper layers if( name == wxEmptyString )
for( int i = 0; i < NB_COPPER_LAYERS; i++ )
{ {
if( m_LayersMask >> i & 0x00000001 ) DisplayError( this, _("Layer name may not be empty" ) );
NumberOfCopperLayers++; ctl->SetFocus(); // on the bad name
return false;
} }
m_Pcb->m_BoardSettings->SetCopperLayerCount( NumberOfCopperLayers ); if( hasOneOf( name, badchars ) )
m_Pcb->SetEnabledLayers( m_LayersMask );
/* Reset the layers visibility flag
* Because it could creates SERIOUS mistakes for the user,
* if some layers are not visible after activating them ...
*/
m_Pcb->SetVisibleLayers( m_LayersMask );
for( int i = 0; i < NB_COPPER_LAYERS; i++ )
{ {
SetLayerName( i, m_LayerNameTextCtrl[i]->GetValue() ); DisplayError( this, _("Layer name has an illegal character, one of: '") + badchars + wxT("'") );
SetLayerType( i, (LAYER_T)m_LayerTypeChoice[i]->GetSelection() ); ctl->SetFocus(); // on the bad name
return false;
} }
if( name == wxT("signal") )
{
DisplayError( this, _("'signal' is a reserved layer name") );
ctl->SetFocus(); // on the bad name
return false;
}
m_Parent->ReCreateLayerBox( NULL ); for( std::vector<wxString>::iterator it = names.begin(); it != names.end(); ++it )
{
if( name == *it )
{
DisplayError( this, _("Layer name is a duplicate of another") );
ctl->SetFocus(); // on the bad name
return false;
}
}
// Save the dialog's position before finishing names.push_back( name );
m_DialogLastPosition = this->GetPosition(); }
event.Skip(); return true;
} }
//==============================================================================
// Invoke the dialog.
void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent ) void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent )
{ {
DialogLayerSetup* frame = new DialogLayerSetup( parent ); DIALOG_LAYERS_SETUP frame( parent );
frame->ShowModal();
frame->Destroy(); frame.ShowModal();
frame.Destroy();
} }
//==============================================================================
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
///////////////////////////////////////////////////////////////////////////
#ifndef __DialogLayerSetup__
#define __DialogLayerSetup__
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/panel.h>
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/scrolwin.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////////
/// Class DialogLayerSetup
///////////////////////////////////////////////////////////////////////////////
class DialogLayerSetup : public wxDialog
{
private:
protected:
wxPanel* m_MainPanel;
wxStaticText* m_PresetsCaption;
wxChoice* m_PresetsChoice;
wxStaticText* m_LayerNumberCaption;
wxChoice* m_LayerNumberChoice;
wxStaticLine* m_Separator1;
wxStaticText* m_LayersCaptionText;
wxPanel* m_LayersPanel;
wxStaticText* m_LayerNameCaptionText;
wxStaticText* m_LayerEnabledCaptionText;
wxStaticText* m_LayerTypeCaptionText;
wxScrolledWindow* m_LayerListScroller;
wxPanel* m_LayerNamePanel[NB_LAYERS];
wxStaticText* m_LayerNameStaticText[NB_LAYERS-NB_COPPER_LAYERS];
wxTextCtrl* m_LayerNameTextCtrl[NB_COPPER_LAYERS];
wxPanel* m_LayerEnabledPanel[NB_LAYERS];
wxCheckBox* m_LayerEnabledCheckBox[NB_LAYERS];
wxPanel* m_LayerTypePanel[NB_LAYERS];
wxStaticText* m_LayerTypeStaticText[NB_LAYERS-NB_COPPER_LAYERS];
wxChoice* m_LayerTypeChoice[NB_COPPER_LAYERS];
wxStaticLine* m_Separator2;
wxStdDialogButtonSizer* m_StdButtonsSizer;
wxButton* m_StdButtonsSizerOK;
wxButton* m_StdButtonsSizerCancel;
int m_LayersMask;
static wxPoint m_DialogLastPosition;
WinEDA_PcbFrame* m_Parent;
BOARD* m_Pcb;
wxString GetLayerName( int Layer );
int GetLayerType( int Layer );
void SetLayerName( int Layer, wxString Name );
void SetLayerType( int Layer, LAYER_T Type );
int GetLayersMask();
// Virtual event handlers, overide them in your derived class
virtual void OnPresetChoice( wxCommandEvent& event );
virtual void OnCopperLayersChoice( wxCommandEvent& event );
virtual void OnLayerNameKillFocus( wxFocusEvent& event );
virtual void OnLayerNameSetFocus( wxFocusEvent& event );
virtual void OnLayerEnabledCheckBox( wxCommandEvent& event );
virtual void OnLayerEnabledSetFocus( wxFocusEvent& event );
virtual void OnLayerEnabledKillFocus( wxFocusEvent& event );
virtual void OnLayerTypeChoice( wxCommandEvent& event ){ event.Skip(); }
virtual void OnLayerTypeSetFocus( wxFocusEvent& event );
virtual void OnLayerTypeKillFocus( wxFocusEvent& event );
virtual void OnCancelClick( wxCommandEvent& event );
virtual void OnOKClick( wxCommandEvent& event );
void UpdateCheckBoxes();
void UpdateCopperLayersChoice();
void UpdatePresetsChoice();
public:
DialogLayerSetup( WinEDA_PcbFrame* parent,
const wxPoint& pos = wxDefaultPosition,
wxWindowID id = wxID_ANY,
const wxString& title = wxT("Layer Setup"),
const wxSize& size = wxSize( -1,-1 ),
long style = wxDEFAULT_DIALOG_STYLE );
~DialogLayerSetup();
};
#endif //__DialogLayerSetup__
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2009 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* functions relatives to the design rules editor
*/
#include "fctsys.h"
#include "common.h"
#include "class_drawpanel.h"
#include "confirm.h"
#include "pcbnew.h"
#include "wxPcbStruct.h"
#include "pcbnew_id.h"
#include "dialog_layers_setup2.h"
#include "class_board_design_settings.h"
// We want our dialog to remember its previous screen position
wxPoint DIALOG_LAYERS_SETUP::s_LastPos( -1, -1 );
wxSize DIALOG_LAYERS_SETUP::s_LastSize;
// Layer bit masks for each defined "Preset Layer Grouping"
static const int presets[] =
{
#define FRONT_AUX (SILKSCREEN_LAYER_CMP | SOLDERMASK_LAYER_CMP | ADHESIVE_LAYER_CMP | SOLDERPASTE_LAYER_CMP)
#define BACK_AUX (SILKSCREEN_LAYER_CU | SOLDERMASK_LAYER_CU | ADHESIVE_LAYER_CU | SOLDERPASTE_LAYER_CU)
0, // shift the array index up by one, matches with "Custom".
// "Two layers, parts on Front only"
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | FRONT_AUX,
// "Two layers, parts on Back only",
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX,
// "Two layers, parts on Front and Back",
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX | FRONT_AUX,
// "Four layers, parts on Front only"
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX,
// "Four layers, parts on Front and Back"
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX | BACK_AUX,
// "All layers on",
ALL_LAYERS,
};
/**
* Class IDs
* holds the 3 ui control ids for a single board layer.
*/
struct IDs
{
IDs( int aName, int aCheckBox, int aChoice )
{
name = aName;
checkbox = aCheckBox;
choice = aChoice;
}
short name;
short checkbox;
short choice;
};
/**
* Function getIDs
* maps \a aLayerNumber to the wx IDs for that layer which are
* the layer name control ID, checkbox control ID, and choice control ID
*/
static IDs getIDs( int aLayerNumber )
{
#define RET(x) return IDs( x##NAME, x##CHECKBOX, x##CHOICE );
switch( aLayerNumber )
{
case ADHESIVE_N_CMP: RET( ID_ADHESFRONT );
case SOLDERPASTE_N_CMP: RET( ID_SOLDPFRONT );
case SILKSCREEN_N_CMP: RET( ID_SILKSFRONT );
case SOLDERMASK_N_CMP: RET( ID_MASKFRONT );
case LAYER_N_FRONT: RET( ID_FRONT );
case LAYER_N_2: RET( ID_INNER2 );
case LAYER_N_3: RET( ID_INNER3 );
case LAYER_N_4: RET( ID_INNER4 );
case LAYER_N_5: RET( ID_INNER5 );
case LAYER_N_6: RET( ID_INNER6 );
case LAYER_N_7: RET( ID_INNER7 );
case LAYER_N_8: RET( ID_INNER8 );
case LAYER_N_9: RET( ID_INNER9 );
case LAYER_N_10: RET( ID_INNER10 );
case LAYER_N_11: RET( ID_INNER11 );
case LAYER_N_12: RET( ID_INNER12 );
case LAYER_N_13: RET( ID_INNER13 );
case LAYER_N_14: RET( ID_INNER14 );
case LAYER_N_15: RET( ID_INNER15 );
case LAYER_N_BACK: RET( ID_BACK );
case SOLDERMASK_N_CU: RET( ID_MASKBACK );
case SILKSCREEN_N_CU: RET( ID_SILKSBACK );
case SOLDERPASTE_N_CU: RET( ID_SOLDPBACK );
case ADHESIVE_N_CU: RET( ID_ADHESBACK );
case EDGE_N: RET( ID_PCBEDGES );
case ECO2_N: RET( ID_ECO2 );
case ECO1_N: RET( ID_ECO1 );
case COMMENT_N: RET( ID_COMMENTS );
case DRAW_N: RET( ID_DRAWINGS );
default:
// wxDEBUGMSG( "bad layer id" );
return IDs( 0, 0, 0 );
}
#undef RET
}
/***********************************************************************************/
DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ) :
DIALOG_LAYERS_SETUP_BASE2( parent )
/***********************************************************************************/
{
m_Parent = parent;
m_Pcb = m_Parent->GetBoard();
init();
SetAutoLayout( true );
Layout();
Center();
m_sdbSizer2OK->SetFocus();
}
bool DIALOG_LAYERS_SETUP::Show( bool show )
{
bool ret;
if( show )
{
if( s_LastPos.x != -1 )
{
SetSize( s_LastPos.x, s_LastPos.y, s_LastSize.x, s_LastSize.y, 0 );
}
ret = DIALOG_LAYERS_SETUP_BASE2::Show( show );
}
else
{
// Save the dialog's position before hiding
s_LastPos = GetPosition();
s_LastSize = GetSize();
ret = DIALOG_LAYERS_SETUP_BASE2::Show( show );
}
return ret;
}
void DIALOG_LAYERS_SETUP::showCopperChoice( int copperCount )
{
static const int copperCounts[] = { 2,4,6,8,10,12,14,16 };
D(printf("boardsCopperCount=%d\n", copperCount );)
for( unsigned i = 0; i<sizeof(copperCounts); ++i )
{
// note this will change a one layer board to 2:
if( copperCount <= copperCounts[i] )
{
m_CopperLayersChoice->SetSelection(i);
break;
}
}
}
void DIALOG_LAYERS_SETUP::showBoardLayerNames()
{
// Establish all the board's layer names into the dialog presentation, by
// obtaining them from BOARD::GetLayerName() which calls
// BOARD::GetDefaultLayerName() for non-coppers.
for( int layer=0; layer<NB_LAYERS; ++layer )
{
int nameId = getIDs( layer ).name;
wxControl* ctl = (wxControl*) FindWindowById( nameId );
wxASSERT( ctl );
if( ctl )
{
wxString lname = m_Pcb->GetLayerName( layer );
D(printf("layerName[%d]=%s\n", layer, CONV_TO_UTF8( lname ) );)
if( ctl->IsKindOf( CLASSINFO(wxTextCtrl) ) )
((wxTextCtrl*)ctl)->SetValue( lname ); // wxTextCtrl
else
ctl->SetLabel( lname ); // wxStaticText
}
}
}
void DIALOG_LAYERS_SETUP::showSelectedLayerCheckBoxes( int enabledLayers )
{
for( int layer=0; layer<NB_LAYERS; ++layer )
{
setLayerCheckBox( layer, (1<<layer) & enabledLayers );
}
}
void DIALOG_LAYERS_SETUP::showPresets( int enabledLayers )
{
int presetsNdx = 0; // the "Custom" setting, matches nothing
for( unsigned i=1; i<DIM(presets); ++i )
{
if( enabledLayers == presets[i] )
{
presetsNdx = i;
break;
}
}
m_PresetsChoice->SetSelection( presetsNdx );
}
void DIALOG_LAYERS_SETUP::showLayerTypes()
{
for( int copperLayer = FIRST_COPPER_LAYER;
copperLayer <= LAST_COPPER_LAYER; ++copperLayer )
{
int choiceId = getIDs( copperLayer ).choice;
wxChoice* ctl = (wxChoice*) FindWindowById( choiceId );
wxASSERT( ctl );
if( ctl )
ctl->SetSelection( m_Pcb->GetLayerType( copperLayer ) );
}
}
/********************************************************************/
void DIALOG_LAYERS_SETUP::init()
/********************************************************************/
{
m_CopperLayerCount = m_Pcb->GetCopperLayerCount();
showCopperChoice( m_CopperLayerCount );
showBoardLayerNames();
m_EnabledLayers = m_Pcb->GetEnabledLayers();
showSelectedLayerCheckBoxes( m_EnabledLayers );
showPresets( m_EnabledLayers );
showLayerTypes();
// @todo overload a layout function so we can reposition the column titles,
// which should probably not go in a sizer of their own so that we do not have
// to fight to position them, Dick. Will work this out next.
// Adjust the vertical scroll rate so our list scrolls always one full line each time.
// m_LayersListPanel->SetScrollRate( 0, m_textCtrl1[0]->GetSize().y );
}
int DIALOG_LAYERS_SETUP::getUILayerMask()
{
int layerMaskResult = 0;
for( int layer=0; layer<NB_LAYERS; ++layer )
{
int checkBoxId = getIDs( layer ).checkbox;
wxCheckBox* ctl = (wxCheckBox*) FindWindowById( checkBoxId );
wxASSERT( ctl );
if( ctl && ctl->GetValue() )
{
layerMaskResult |= (1 << layer);
}
}
return layerMaskResult;
}
void DIALOG_LAYERS_SETUP::setLayerCheckBox( int layer, bool isChecked )
{
int checkBoxId = getIDs( layer ).checkbox;
wxCheckBox* ctl = (wxCheckBox*) FindWindowById( checkBoxId );
wxASSERT( ctl );
if( ctl )
ctl->SetValue( isChecked );
}
void DIALOG_LAYERS_SETUP::setCopperLayerCheckBoxes( int copperCount )
{
if( copperCount > 0 )
{
setLayerCheckBox( LAYER_N_BACK, true );
--copperCount;
}
if( copperCount > 0 )
{
setLayerCheckBox( LAYER_N_FRONT, true );
--copperCount;
}
else
{
setLayerCheckBox( LAYER_N_FRONT, false );
}
int layer;
for( layer=LAYER_N_2; copperCount > 0; ++layer, --copperCount )
{
setLayerCheckBox( layer, true );
}
for( ; layer < NB_COPPER_LAYERS-1; ++layer )
{
setLayerCheckBox( layer, false );
}
}
void DIALOG_LAYERS_SETUP::OnCheckBox( wxCommandEvent& event )
{
m_EnabledLayers = getUILayerMask();
showPresets( m_EnabledLayers );
}
void DIALOG_LAYERS_SETUP::DenyChangeCheckBox( wxCommandEvent& event )
{
// user may not change copper layer checkboxes from anything other than
// the one place, the drop down m_CopperLayersChoice control.
// I tried to simply diable the copper CheckBoxes but they look like crap,
// so leave them enabled and reverse the user's attempt to toggle them.
setCopperLayerCheckBoxes( m_CopperLayerCount );
}
void DIALOG_LAYERS_SETUP::OnPresetsChoice( wxCommandEvent& event )
{
unsigned presetNdx = m_PresetsChoice->GetCurrentSelection();
if( presetNdx == 0 ) // the Custom setting controls nothing.
return;
if( presetNdx < DIM(presets) )
{
m_EnabledLayers = presets[ presetNdx ];
int coppersMask = m_EnabledLayers & ALL_CU_LAYERS;
int copperCount = 0;
while( coppersMask )
{
if( coppersMask & 1 )
++copperCount;
coppersMask >>= 1;
}
m_CopperLayerCount = copperCount;
showCopperChoice( m_CopperLayerCount );
showSelectedLayerCheckBoxes( m_EnabledLayers );
}
}
void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event )
{
m_CopperLayerCount = m_CopperLayersChoice->GetCurrentSelection() * 2 + 2;
setCopperLayerCheckBoxes( m_CopperLayerCount );
// event.Skip();
}
/*****************************************************************/
void DIALOG_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event )
/*****************************************************************/
{
EndModal( 0 );
}
/**************************************************************************/
void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
/**************************************************************************/
{
if( testLayerNames() )
{
wxString name;
m_EnabledLayers = getUILayerMask();
m_Pcb->SetEnabledLayers( m_EnabledLayers );
for( int layer = FIRST_COPPER_LAYER;
layer <= LAST_COPPER_LAYER; ++layer )
{
if( (1<<layer) & m_EnabledLayers )
{
name = getLayerName( layer );
m_Pcb->SetLayerName( layer, name );
LAYER_T t = (LAYER_T) getLayerTypeIndex(layer);
m_Pcb->SetLayerType( layer, t );
}
}
m_Parent->ReCreateLayerBox( NULL );
EndModal( wxID_OK );
}
}
int DIALOG_LAYERS_SETUP::getLayerTypeIndex( int layer )
{
int choiceId = getIDs( layer ).choice;
int ret = 0;
wxChoice* ctl = (wxChoice*) FindWindowById( choiceId );
wxASSERT( ctl );
if( ctl )
ret = ctl->GetCurrentSelection(); // indices must have same sequence as LAYER_T
return ret;
}
wxString DIALOG_LAYERS_SETUP::getLayerName( int layer )
{
wxString ret;
int nameId = getIDs( layer ).name;
wxTextCtrl* ctl = (wxTextCtrl*) FindWindowById( nameId );
wxASSERT( ctl );
if( ctl )
ret = ctl->GetValue().Trim();
return ret;
}
static bool hasOneOf( const wxString& str, const wxString& chars )
{
for( unsigned i=0; i<chars.Len(); ++i )
if( str.Find( chars[i] ) != wxNOT_FOUND )
return true;
return false;
}
bool DIALOG_LAYERS_SETUP::testLayerNames()
{
std::vector<wxString> names;
wxTextCtrl* ctl;
for( int layer=0; layer<=LAST_COPPER_LAYER; ++layer )
{
// we _can_ rely on m_EnabledLayers being current here:
if( !(m_EnabledLayers & (1<<layer)) )
continue;
wxString name = getLayerName( layer );
//D(printf("name[%d]=%s\n", layer, CONV_TO_UTF8(name) );)
int nameId = getIDs( layer ).name;
ctl = (wxTextCtrl*) FindWindowById( nameId );
// check name for legality.
// 1) cannot be blank.
// 2) cannot have blanks.
// 3) cannot have " chars
// 4) cannot be 'signal'
// 5) must be unique.
static const wxString badchars( wxT("%$\" ") );
if( name == wxEmptyString )
{
DisplayError( this, _("Layer name may not be empty" ) );
ctl->SetFocus(); // on the bad name
return false;
}
if( hasOneOf( name, badchars ) )
{
DisplayError( this, _("Layer name has an illegal character, one of: '") + badchars + wxT("'") );
ctl->SetFocus(); // on the bad name
return false;
}
if( name == wxT("signal") )
{
DisplayError( this, _("'signal' is a reserved layer name") );
ctl->SetFocus(); // on the bad name
return false;
}
for( std::vector<wxString>::iterator it = names.begin(); it != names.end(); ++it )
{
if( name == *it )
{
DisplayError( this, _("Layer name is a duplicate of another") );
ctl->SetFocus(); // on the bad name
return false;
}
}
names.push_back( name );
}
return true;
}
void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent )
{
DIALOG_LAYERS_SETUP frame( parent );
frame.ShowModal();
frame.Destroy();
}
#ifndef __dialog_layers_setup2_h_
#define __dialog_layers_setup2_h_
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2009 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "dialog_layers_setup_base2.h"
class DIALOG_LAYERS_SETUP : public DIALOG_LAYERS_SETUP_BASE2
{
private:
static wxPoint s_LastPos;
static wxSize s_LastSize;
WinEDA_PcbFrame* m_Parent;
int m_CopperLayerCount;
int m_EnabledLayers;
BOARD* m_Pcb;
void init();
void setLayerCheckBox( int layer, bool isChecked );
void setCopperLayerCheckBoxes( int copperCount );
void showCopperChoice( int copperCount );
void showBoardLayerNames();
void showSelectedLayerCheckBoxes( int enableLayerMask );
void showLayerTypes();
void showPresets( int enabledLayerMask );
/** return the selected layer mask within the UI checkboxes */
int getUILayerMask();
wxString getLayerName( int layer );
int getLayerTypeIndex( int layer );
void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnCheckBox( wxCommandEvent& event );
void DenyChangeCheckBox( wxCommandEvent& event );
void OnPresetsChoice( wxCommandEvent& event );
void OnCopperLayersChoice( wxCommandEvent& event );
bool testLayerNames();
public:
DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent );
~DIALOG_LAYERS_SETUP( ) { };
bool Show( bool show ); // overload stock function
};
#endif //__dialog_layers_setup2_h_
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_layers_setup_base2.h" #include "dialog_layers_setup_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DIALOG_LAYERS_SETUP_BASE::DIALOG_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxSize( 600,600 ), wxDefaultSize ); this->SetSizeHints( wxSize( 600,600 ), wxDefaultSize );
...@@ -199,6 +199,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -199,6 +199,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_FrontChoice, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_LayerListFlexGridSizer->Add( m_FrontChoice, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_Inner2Name = new wxTextCtrl( m_LayersListPanel, ID_INNER2NAME, _("Inner2"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner2Name = new wxTextCtrl( m_LayersListPanel, ID_INNER2NAME, _("Inner2"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner2Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner2Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner2Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner2Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner2Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -223,6 +224,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -223,6 +224,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner2Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner2Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner3Name = new wxTextCtrl( m_LayersListPanel, ID_INNER3NAME, _("Inner3"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner3Name = new wxTextCtrl( m_LayersListPanel, ID_INNER3NAME, _("Inner3"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner3Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner3Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner3Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner3Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner3Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -247,6 +249,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -247,6 +249,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner3Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner3Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner4Name = new wxTextCtrl( m_LayersListPanel, ID_INNER4NAME, _("Inner4"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner4Name = new wxTextCtrl( m_LayersListPanel, ID_INNER4NAME, _("Inner4"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner4Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner4Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner4Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner4Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner4Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -271,6 +274,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -271,6 +274,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner4Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner4Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner5Name = new wxTextCtrl( m_LayersListPanel, ID_INNER5NAME, _("Inner5"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner5Name = new wxTextCtrl( m_LayersListPanel, ID_INNER5NAME, _("Inner5"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner5Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner5Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner5Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner5Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner5Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -291,10 +295,11 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -291,10 +295,11 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
wxString m_Inner5ChoiceChoices[] = { _("signal"), _("power"), _("mixed"), _("jumper") }; wxString m_Inner5ChoiceChoices[] = { _("signal"), _("power"), _("mixed"), _("jumper") };
int m_Inner5ChoiceNChoices = sizeof( m_Inner5ChoiceChoices ) / sizeof( wxString ); int m_Inner5ChoiceNChoices = sizeof( m_Inner5ChoiceChoices ) / sizeof( wxString );
m_Inner5Choice = new wxChoice( m_LayersListPanel, ID_INNER5CHOICE, wxDefaultPosition, wxDefaultSize, m_Inner5ChoiceNChoices, m_Inner5ChoiceChoices, 0 ); m_Inner5Choice = new wxChoice( m_LayersListPanel, ID_INNER5CHOICE, wxDefaultPosition, wxDefaultSize, m_Inner5ChoiceNChoices, m_Inner5ChoiceChoices, 0 );
m_Inner5Choice->SetSelection( 3 ); m_Inner5Choice->SetSelection( 0 );
m_LayerListFlexGridSizer->Add( m_Inner5Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner5Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner6Name = new wxTextCtrl( m_LayersListPanel, ID_INNER6NAME, _("Inner6"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner6Name = new wxTextCtrl( m_LayersListPanel, ID_INNER6NAME, _("Inner6"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner6Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner6Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner6Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner6Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner6Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -319,6 +324,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -319,6 +324,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner6Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner6Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner7Name = new wxTextCtrl( m_LayersListPanel, ID_INNER7NAME, _("Inner7"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner7Name = new wxTextCtrl( m_LayersListPanel, ID_INNER7NAME, _("Inner7"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner7Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner7Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner7Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner7Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner7Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -343,6 +349,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -343,6 +349,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner7Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner7Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner8Name = new wxTextCtrl( m_LayersListPanel, ID_INNER8NAME, _("Inner8"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner8Name = new wxTextCtrl( m_LayersListPanel, ID_INNER8NAME, _("Inner8"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner8Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner8Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner8Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner8Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner8Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -367,6 +374,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -367,6 +374,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner8Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner8Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner9Name = new wxTextCtrl( m_LayersListPanel, ID_INNER9NAME, _("Inner9"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner9Name = new wxTextCtrl( m_LayersListPanel, ID_INNER9NAME, _("Inner9"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner9Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner9Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner9Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner9Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner9Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -391,6 +399,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -391,6 +399,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner9Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner9Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner10Name = new wxTextCtrl( m_LayersListPanel, ID_INNER10NAME, _("Inner10"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner10Name = new wxTextCtrl( m_LayersListPanel, ID_INNER10NAME, _("Inner10"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner10Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner10Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner10Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner10Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner10Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -415,6 +424,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -415,6 +424,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner10Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner10Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner11Name = new wxTextCtrl( m_LayersListPanel, ID_INNER11NAME, _("Inner11"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner11Name = new wxTextCtrl( m_LayersListPanel, ID_INNER11NAME, _("Inner11"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner11Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner11Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner11Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner11Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner11Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -439,6 +449,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -439,6 +449,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner11Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner11Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner12Name = new wxTextCtrl( m_LayersListPanel, ID_INNER12NAME, _("Inner12"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner12Name = new wxTextCtrl( m_LayersListPanel, ID_INNER12NAME, _("Inner12"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner12Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner12Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner12Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner12Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner12Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -463,6 +474,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -463,6 +474,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner12Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner12Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner13Name = new wxTextCtrl( m_LayersListPanel, ID_INNER13NAME, _("Inner13"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner13Name = new wxTextCtrl( m_LayersListPanel, ID_INNER13NAME, _("Inner13"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner13Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner13Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner13Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner13Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner13Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -487,6 +499,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -487,6 +499,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner13Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner13Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner14Name = new wxTextCtrl( m_LayersListPanel, ID_INNER14NAME, _("Inner14"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner14Name = new wxTextCtrl( m_LayersListPanel, ID_INNER14NAME, _("Inner14"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner14Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner14Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner14Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner14Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner14Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -511,6 +524,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -511,6 +524,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner14Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner14Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner15Name = new wxTextCtrl( m_LayersListPanel, ID_INNER15NAME, _("Inner15"), wxDefaultPosition, wxDefaultSize, 0 ); m_Inner15Name = new wxTextCtrl( m_LayersListPanel, ID_INNER15NAME, _("Inner15"), wxDefaultPosition, wxDefaultSize, 0 );
m_Inner15Name->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_Inner15Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner15Name, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_Inner15Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_Inner15Panel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -535,6 +549,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -535,6 +549,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
m_LayerListFlexGridSizer->Add( m_Inner15Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_Inner15Choice, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_BackName = new wxTextCtrl( m_LayersListPanel, ID_BACKNAME, _("Back"), wxDefaultPosition, wxDefaultSize, 0 ); m_BackName = new wxTextCtrl( m_LayersListPanel, ID_BACKNAME, _("Back"), wxDefaultPosition, wxDefaultSize, 0 );
m_BackName->SetMaxLength( 20 );
m_LayerListFlexGridSizer->Add( m_BackName, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 ); m_LayerListFlexGridSizer->Add( m_BackName, 0, wxBOTTOM|wxLEFT|wxRIGHT|wxEXPAND, 5 );
m_BackPanel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_BackPanel = new wxPanel( m_LayersListPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
...@@ -785,75 +800,75 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -785,75 +800,75 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
bMainSizer->Fit( this ); bMainSizer->Fit( this );
// Connect Events // Connect Events
m_PresetsChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnPresetsChoice ), NULL, this ); m_PresetsChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnPresetsChoice ), NULL, this );
m_CopperLayersChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCopperLayersChoice ), NULL, this ); m_CopperLayersChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCopperLayersChoice ), NULL, this );
m_AdhesFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_AdhesFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SoldPFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SoldPFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SilkSFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SilkSFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_MaskFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_MaskFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_FrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_FrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner2CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner2CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner3CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner3CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner4CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner4CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner5CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner5CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner6CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner6CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner7CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner7CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner8CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner8CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner9CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner9CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner10CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner10CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner11CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner11CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner12CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner12CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner13CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner13CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner14CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner14CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner15CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner15CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_BackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_BackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_MaskBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_MaskBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SilkSBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SilkSBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SoldPBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SoldPBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_AdhesBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_AdhesBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_PCBEdgesCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_PCBEdgesCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_Eco2CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_Eco2CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_Eco1CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_Eco1CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_CommentsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_CommentsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_DrawingsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_DrawingsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_sdbSizer2Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCancelButtonClick ), NULL, this ); m_sdbSizer2Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer2OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnOkButtonClick ), NULL, this ); m_sdbSizer2OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnOkButtonClick ), NULL, this );
} }
DIALOG_LAYERS_SETUP_BASE2::~DIALOG_LAYERS_SETUP_BASE2() DIALOG_LAYERS_SETUP_BASE::~DIALOG_LAYERS_SETUP_BASE()
{ {
// Disconnect Events // Disconnect Events
m_PresetsChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnPresetsChoice ), NULL, this ); m_PresetsChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnPresetsChoice ), NULL, this );
m_CopperLayersChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCopperLayersChoice ), NULL, this ); m_CopperLayersChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCopperLayersChoice ), NULL, this );
m_AdhesFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_AdhesFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SoldPFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SoldPFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SilkSFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SilkSFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_MaskFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_MaskFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_FrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_FrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner2CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner2CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner3CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner3CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner4CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner4CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner5CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner5CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner6CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner6CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner7CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner7CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner8CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner8CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner9CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner9CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner10CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner10CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner11CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner11CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner12CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner12CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner13CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner13CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner14CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner14CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_Inner15CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_Inner15CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_BackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this ); m_BackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::DenyChangeCheckBox ), NULL, this );
m_MaskBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_MaskBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SilkSBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SilkSBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_SoldPBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_SoldPBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_AdhesBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_AdhesBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_PCBEdgesCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_PCBEdgesCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_Eco2CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_Eco2CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_Eco1CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_Eco1CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_CommentsCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_CommentsCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_DrawingsCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this ); m_DrawingsCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCheckBox ), NULL, this );
m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCancelButtonClick ), NULL, this ); m_sdbSizer2Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnCancelButtonClick ), NULL, this );
m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnOkButtonClick ), NULL, this ); m_sdbSizer2OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE::OnOkButtonClick ), NULL, this );
} }
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<property name="disconnect_events">1</property> <property name="disconnect_events">1</property>
<property name="encoding">UTF-8</property> <property name="encoding">UTF-8</property>
<property name="event_generation">connect</property> <property name="event_generation">connect</property>
<property name="file">dialog_layers_setup_base2</property> <property name="file">dialog_layers_setup_base</property>
<property name="first_id">1000</property> <property name="first_id">1000</property>
<property name="help_provider">none</property> <property name="help_provider">none</property>
<property name="internationalize">1</property> <property name="internationalize">1</property>
<property name="name">DIALOG_LAYERS_SETUP_BASE2</property> <property name="name">DIALOG_LAYERS_SETUP_BASE</property>
<property name="namespace"></property> <property name="namespace"></property>
<property name="path">.</property> <property name="path">.</property>
<property name="precompiled_header"></property> <property name="precompiled_header"></property>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<property name="id">wxID_ANY</property> <property name="id">wxID_ANY</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="minimum_size">600,600</property> <property name="minimum_size">600,600</property>
<property name="name">DIALOG_LAYERS_SETUP_BASE2</property> <property name="name">DIALOG_LAYERS_SETUP_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">-1,-1</property> <property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
...@@ -1509,7 +1509,7 @@ ...@@ -1509,7 +1509,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER2NAME</property> <property name="id">ID_INNER2NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner2Name</property> <property name="name">m_Inner2Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -1721,7 +1721,7 @@ ...@@ -1721,7 +1721,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER3NAME</property> <property name="id">ID_INNER3NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner3Name</property> <property name="name">m_Inner3Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -1933,7 +1933,7 @@ ...@@ -1933,7 +1933,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER4NAME</property> <property name="id">ID_INNER4NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner4Name</property> <property name="name">m_Inner4Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -2145,7 +2145,7 @@ ...@@ -2145,7 +2145,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER5NAME</property> <property name="id">ID_INNER5NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner5Name</property> <property name="name">m_Inner5Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -2311,7 +2311,7 @@ ...@@ -2311,7 +2311,7 @@
<property name="name">m_Inner5Choice</property> <property name="name">m_Inner5Choice</property>
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="selection">3</property> <property name="selection">0</property>
<property name="size"></property> <property name="size"></property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
...@@ -2357,7 +2357,7 @@ ...@@ -2357,7 +2357,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER6NAME</property> <property name="id">ID_INNER6NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner6Name</property> <property name="name">m_Inner6Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -2569,7 +2569,7 @@ ...@@ -2569,7 +2569,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER7NAME</property> <property name="id">ID_INNER7NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner7Name</property> <property name="name">m_Inner7Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -2781,7 +2781,7 @@ ...@@ -2781,7 +2781,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER8NAME</property> <property name="id">ID_INNER8NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner8Name</property> <property name="name">m_Inner8Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -2993,7 +2993,7 @@ ...@@ -2993,7 +2993,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER9NAME</property> <property name="id">ID_INNER9NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner9Name</property> <property name="name">m_Inner9Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -3205,7 +3205,7 @@ ...@@ -3205,7 +3205,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER10NAME</property> <property name="id">ID_INNER10NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner10Name</property> <property name="name">m_Inner10Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -3417,7 +3417,7 @@ ...@@ -3417,7 +3417,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER11NAME</property> <property name="id">ID_INNER11NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner11Name</property> <property name="name">m_Inner11Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -3629,7 +3629,7 @@ ...@@ -3629,7 +3629,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER12NAME</property> <property name="id">ID_INNER12NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner12Name</property> <property name="name">m_Inner12Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -3841,7 +3841,7 @@ ...@@ -3841,7 +3841,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER13NAME</property> <property name="id">ID_INNER13NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner13Name</property> <property name="name">m_Inner13Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -4053,7 +4053,7 @@ ...@@ -4053,7 +4053,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER14NAME</property> <property name="id">ID_INNER14NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner14Name</property> <property name="name">m_Inner14Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -4265,7 +4265,7 @@ ...@@ -4265,7 +4265,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_INNER15NAME</property> <property name="id">ID_INNER15NAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_Inner15Name</property> <property name="name">m_Inner15Name</property>
<property name="permission">protected</property> <property name="permission">protected</property>
...@@ -4477,7 +4477,7 @@ ...@@ -4477,7 +4477,7 @@
<property name="hidden">0</property> <property name="hidden">0</property>
<property name="id">ID_BACKNAME</property> <property name="id">ID_BACKNAME</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="maxlength">0</property> <property name="maxlength">20</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">m_BackName</property> <property name="name">m_BackName</property>
<property name="permission">protected</property> <property name="permission">protected</property>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_layers_setup_base2__ #ifndef __dialog_layers_setup_base__
#define __dialog_layers_setup_base2__ #define __dialog_layers_setup_base__
#include <wx/intl.h> #include <wx/intl.h>
...@@ -117,9 +117,9 @@ ...@@ -117,9 +117,9 @@
#define ID_DRAWINGSCHOICE 1086 #define ID_DRAWINGSCHOICE 1086
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_LAYERS_SETUP_BASE2 /// Class DIALOG_LAYERS_SETUP_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_LAYERS_SETUP_BASE2 : public wxDialog class DIALOG_LAYERS_SETUP_BASE : public wxDialog
{ {
private: private:
...@@ -261,9 +261,9 @@ class DIALOG_LAYERS_SETUP_BASE2 : public wxDialog ...@@ -261,9 +261,9 @@ class DIALOG_LAYERS_SETUP_BASE2 : public wxDialog
public: public:
DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer Setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_LAYERS_SETUP_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer Setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_LAYERS_SETUP_BASE2(); ~DIALOG_LAYERS_SETUP_BASE();
}; };
#endif //__dialog_layers_setup_base2__ #endif //__dialog_layers_setup_base__
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