Commit 43c034d0 authored by dickelbeck's avatar dickelbeck

++pcbnew

    Finished the Layer Setup Dialog.  I assumed that the new layer order will
    be in place soon.  It works fine now, but the layer order is probably
    misleading, since it does not reflect the current stackup but rather the
    future stackup.  I dropped support for a single layer board. The minimum
    is two copper layers.  Avoid the side you don't want anything on.

    Within a month I should have the layer visibility and selection widget
    in place.
parent ba78287b
...@@ -4,6 +4,18 @@ KiCad ChangeLog 2009 ...@@ -4,6 +4,18 @@ 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-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
Finished the Layer Setup Dialog. I assumed that the new layer order will
be in place soon. It works fine now, but the layer order is probably
misleading, since it does not reflect the current stackup but rather the
future stackup. I dropped support for a single layer board. The minimum
is two copper layers. Avoid the side you don't want anything on.
Within a month I should have the layer visibility and selection widget
in place.
2009-Dec-10 UPDATE Dick Hollenbeck <dick@softplc.com> 2009-Dec-10 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
......
...@@ -327,8 +327,8 @@ public: ...@@ -327,8 +327,8 @@ public:
LAYER_T GetLayerType( int aLayerIndex ) const; LAYER_T GetLayerType( int aLayerIndex ) const;
/** /**
* Function SetLayerName * Function SetLayerType
* changes the name of the layer given by aLayerIndex. * changes the type of the layer given by aLayerIndex.
* *
* @param aLayerIndex A layer index, like LAYER_N_BACK, etc. * @param aLayerIndex A layer index, like LAYER_N_BACK, etc.
* @param aLayerType The new layer type. * @param aLayerType The new layer type.
......
...@@ -45,116 +45,38 @@ wxPoint DIALOG_LAYERS_SETUP::s_LastPos( -1, -1 ); ...@@ -45,116 +45,38 @@ wxPoint DIALOG_LAYERS_SETUP::s_LastPos( -1, -1 );
wxSize DIALOG_LAYERS_SETUP::s_LastSize; wxSize DIALOG_LAYERS_SETUP::s_LastSize;
/* // Layer bit masks for each defined "Preset Layer Grouping"
// Layer order on the list panel static const int presets[] =
// This function translates from the dialog's layer order to Kicad's layer order.
static int GetLayerNumber( int aRow )
{ {
return LayerOrder[Row]; #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".
// Categories for coloring the rows backgrounds (0 means default dialog color). // "Two layers, parts on Front only"
static const int LayerCategories[NB_LAYERS] = EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | FRONT_AUX,
{ 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 };
// Descriptive types for non-copper layers // "Two layers, parts on Back only",
static const wxString LayerCategoriesNames[NB_LAYERS] = EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX,
{
_( "Unknown" ), // Not used
_( "Off-board, manufacturing" ), // 1
_( "On-board, non-copper" ), // 2
_( "On-board, copper" ), // 3
_( "Board contour" ), // 4
_( "Auxiliary" ) // 5
};
// "Two layers, parts on Front and Back",
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | BACK_AUX | FRONT_AUX,
// Names for the presets // "Four layers, parts on Front only"
static const wxString PresetsChoiceChoices[] = EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX,
{
_("All Layers On"),
_("Single Side"),
_("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 DIM(m_PresetsChoiceChoices)
*/
// "Four layers, parts on Front and Back"
EDGE_LAYER | CMP_LAYER | CUIVRE_LAYER | LAYER_2 | LAYER_3 | FRONT_AUX | BACK_AUX,
// Bit masks (for all layers) for each defined preset // "All layers on",
static const int Presets[] = ALL_LAYERS,
{
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
};
// Bit masks for copper layers, one for each option in the copper layer choice widget
static const int CopperMasks[] =
{
0x00000001,
0x00008001,
0x00008007,
0x0000801f,
0x0000807f,
0x000081ff,
0x000087ff,
0x00009fff,
0x0000ffff
};
// The sequence of the layer oriented rows in the scrollPanel:
static const short layerOrder[NB_LAYERS] = {
ADHESIVE_N_CMP,
SOLDERPASTE_N_CMP,
SILKSCREEN_N_CMP,
SOLDERMASK_N_CMP,
LAYER_N_FRONT,
LAYER_N_2,
LAYER_N_3,
LAYER_N_4,
LAYER_N_5,
LAYER_N_6,
LAYER_N_7,
LAYER_N_8,
LAYER_N_9,
LAYER_N_10,
LAYER_N_11,
LAYER_N_12,
LAYER_N_13,
LAYER_N_14,
LAYER_N_15,
LAYER_N_BACK,
SOLDERMASK_N_CU,
SILKSCREEN_N_CU,
SOLDERPASTE_N_CU,
ADHESIVE_N_CU,
EDGE_N,
ECO2_N,
ECO1_N,
COMMENT_N,
DRAW_N,
}; };
/**
* Class IDs
* holds the 3 ui control ids for a single board layer.
*/
struct IDs struct IDs
{ {
IDs( int aName, int aCheckBox, int aChoice ) IDs( int aName, int aCheckBox, int aChoice )
...@@ -219,20 +141,6 @@ static IDs getIDs( int aLayerNumber ) ...@@ -219,20 +141,6 @@ static IDs getIDs( int aLayerNumber )
} }
// Names for the types of copper layers
/*
static const wxString layerTypeChoiceChoices[] =
{
// these may not be translated since they come from Specctra.
wxT("signal"),
wxT("power"),
wxT("mixed"),
wxT("jumper")
};
*/
/***********************************************************************************/ /***********************************************************************************/
DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ) : DIALOG_LAYERS_SETUP::DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ) :
DIALOG_LAYERS_SETUP_BASE2( parent ) DIALOG_LAYERS_SETUP_BASE2( parent )
...@@ -277,6 +185,22 @@ bool DIALOG_LAYERS_SETUP::Show( bool show ) ...@@ -277,6 +185,22 @@ bool DIALOG_LAYERS_SETUP::Show( bool show )
} }
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() void DIALOG_LAYERS_SETUP::showBoardLayerNames()
...@@ -285,10 +209,8 @@ void DIALOG_LAYERS_SETUP::showBoardLayerNames() ...@@ -285,10 +209,8 @@ void DIALOG_LAYERS_SETUP::showBoardLayerNames()
// obtaining them from BOARD::GetLayerName() which calls // obtaining them from BOARD::GetLayerName() which calls
// BOARD::GetDefaultLayerName() for non-coppers. // BOARD::GetDefaultLayerName() for non-coppers.
for( unsigned i=0; i<DIM(layerOrder); ++i ) for( int layer=0; layer<NB_LAYERS; ++layer )
{ {
int layer = layerOrder[i];
int nameId = getIDs( layer ).name; int nameId = getIDs( layer ).name;
wxControl* ctl = (wxControl*) FindWindowById( nameId ); wxControl* ctl = (wxControl*) FindWindowById( nameId );
...@@ -310,25 +232,32 @@ void DIALOG_LAYERS_SETUP::showBoardLayerNames() ...@@ -310,25 +232,32 @@ void DIALOG_LAYERS_SETUP::showBoardLayerNames()
} }
void DIALOG_LAYERS_SETUP::showSelectedLayerCheckBoxes() void DIALOG_LAYERS_SETUP::showSelectedLayerCheckBoxes( int enabledLayers )
{ {
int enabledLayers = m_Pcb->GetEnabledLayers(); for( int layer=0; layer<NB_LAYERS; ++layer )
for( unsigned i=0; i<DIM(layerOrder); ++i )
{ {
int layer = layerOrder[i]; setLayerCheckBox( layer, (1<<layer) & enabledLayers );
}
int checkBoxId = getIDs( layer ).checkbox; }
wxCheckBox* ctl = (wxCheckBox*) FindWindowById( checkBoxId );
wxASSERT( ctl ); void DIALOG_LAYERS_SETUP::showPresets( int enabledLayers )
{
int presetsNdx = 0; // the "Custom" setting, matches nothing
if( ctl ) for( unsigned i=1; i<DIM(presets); ++i )
ctl->SetValue( (1<<layer) & enabledLayers ); {
if( enabledLayers == presets[i] )
{
presetsNdx = i;
break;
}
} }
m_PresetsChoice->SetSelection( presetsNdx );
} }
void DIALOG_LAYERS_SETUP::showLayerTypes() void DIALOG_LAYERS_SETUP::showLayerTypes()
{ {
for( int copperLayer = FIRST_COPPER_LAYER; for( int copperLayer = FIRST_COPPER_LAYER;
...@@ -350,175 +279,150 @@ void DIALOG_LAYERS_SETUP::showLayerTypes() ...@@ -350,175 +279,150 @@ void DIALOG_LAYERS_SETUP::showLayerTypes()
void DIALOG_LAYERS_SETUP::init() void DIALOG_LAYERS_SETUP::init()
/********************************************************************/ /********************************************************************/
{ {
m_CopperLayerCount = m_Pcb->GetCopperLayerCount();
showCopperChoice( m_CopperLayerCount );
showBoardLayerNames();
// temporary: set copper layer count without regard to enabled layer mask. m_EnabledLayers = m_Pcb->GetEnabledLayers();
static const int copperCount[] = {1,2,4,6,8,10,12,14,16}; showSelectedLayerCheckBoxes( m_EnabledLayers );
showPresets( m_EnabledLayers );
m_CopperLayersChoice->SetSelection(1); showLayerTypes();
int boardsCopperCount = m_Pcb->GetCopperLayerCount(); // @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.
D(printf("boardsCopperCount=%d\n", boardsCopperCount );)
for( unsigned i = 0; i<sizeof(copperCount); ++i ) // 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 )
{ {
if( boardsCopperCount == copperCount[i] ) int checkBoxId = getIDs( layer ).checkbox;
wxCheckBox* ctl = (wxCheckBox*) FindWindowById( checkBoxId );
wxASSERT( ctl );
if( ctl && ctl->GetValue() )
{ {
m_CopperLayersChoice->SetSelection(i); layerMaskResult |= (1 << layer);
break;
} }
} }
showBoardLayerNames(); return layerMaskResult;
}
showSelectedLayerCheckBoxes();
showLayerTypes(); void DIALOG_LAYERS_SETUP::setLayerCheckBox( int layer, bool isChecked )
{
int checkBoxId = getIDs( layer ).checkbox;
wxCheckBox* ctl = (wxCheckBox*) FindWindowById( checkBoxId );
/* names only: wxASSERT( ctl );
ID_ADHESFRONTNAME
ID_SOLDPFRONTNAME
ID_SILKSFRONTNAME
ID_MASKFRONTNAME
ID_FRONTNAME
ID_INNER2NAME
ID_INNER3NAME
ID_INNER4NAME
ID_INNER5NAME
ID_INNER6NAME
ID_INNER7NAME
ID_INNER8NAME
ID_INNER9NAME
ID_INNER10NAME
ID_INNER11NAME
ID_INNER12NAME
ID_INNER13NAME
ID_INNER14NAME
ID_INNER15NAME
ID_BACKNAME
ID_MASKBACKNAME
ID_SILKSBACKNAME
ID_SOLDPBACKNAME
ID_ADHESBACKNAME
ID_PCBEDGESNAME
ID_ECO2NAME
ID_ECO1NAME
ID_COMMENTSNAME
ID_DRAWINGSNAME
clean ids:
ID_ADHESFRONTNAME
ID_ADHESFRONTCHECKBOX
ID_SOLDPFRONTNAME
ID_SOLDPFRONTCHECKBOX
ID_SILKSFRONTNAME
ID_SILKSFRONTCHECKBOX
ID_MASKFRONTNAME
ID_MASKFRONTCHECKBOX
ID_FRONTNAME
ID_FRONTCHECKBOX
ID_FRONTCHOICE
ID_INNER2NAME
ID_INNER2CHECKBOX
ID_INNER2CHOICE
ID_INNER3NAME
ID_INNER3CHECKBOX
ID_INNER3CHOICE
ID_INNER4NAME
ID_INNER4CHECKBOX
ID_INNER4CHOICE
ID_INNER5NAME
ID_INNER5CHECKBOX
ID_INNER5CHOICE
ID_INNER6NAME
ID_INNER6CHECKBOX
ID_INNER6CHOICE
ID_INNER7NAME
ID_INNER7CHECKBOX
ID_INNER7CHOICE
ID_INNER8NAME
ID_INNER8CHECKBOX
ID_INNER8CHOICE
ID_INNER9NAME
ID_INNER9CHECKBOX
ID_INNER9CHOICE
ID_INNER10NAME
ID_INNER10CHECKBOX
ID_INNER10CHOICE
ID_INNER11NAME
ID_INNER11CHECKBOX
ID_INNER11CHOICE
ID_INNER12NAME
ID_INNER12CHECKBOX
ID_INNER12CHOICE
ID_INNER13NAME
ID_INNER13CHECKBOX
ID_INNER13CHOICE
ID_INNER14NAME
ID_INNER14CHECKBOX
ID_INNER14CHOICE
ID_INNER15NAME
ID_INNER15CHECKBOX
ID_INNER15CHOICE
ID_BACKNAME
ID_BACKCHECKBOX
ID_BACKCHOICE
ID_MASKBACKNAME
ID_SILKSBACKNAME
ID_SILKSBACKCHECKBOX
ID_SOLDPBACKNAME
ID_SOLDPBACKCHECKBOX
ID_ADHESBACKNAME
ID_ADHESBACKCHECKBOX
ID_PCBEDGESNAME
ID_PCBEDGESCHECKBOX
ID_ECO2NAME
ID_ECHO2CHECKBOX
ID_ECO1NAME
ID_ECO1CHECKBOX
ID_COMMENTSNAME
ID_COMMENTSCHECKBOX
ID_DRAWINGSNAME
ID_DRAWINGSCHECKBOX
*/
if( ctl )
ctl->SetValue( isChecked );
}
// @todo overload a layout function so we can reposition the column titles, void DIALOG_LAYERS_SETUP::setCopperLayerCheckBoxes( int copperCount )
// 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. 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 );
}
// Adjust the vertical scroll rate so our list scrolls always one full line each time. for( ; layer < NB_COPPER_LAYERS-1; ++layer )
// m_LayersListPanel->SetScrollRate( 0, m_textCtrl1[0]->GetSize().y ); {
setLayerCheckBox( layer, false );
}
} }
/* Initialize the Routable column, and the R/W property of some cells void DIALOG_LAYERS_SETUP::OnCheckBox( wxCommandEvent& event )
*/
void DIALOG_LAYERS_SETUP::SetRoutableLayerStatus()
{ {
/* m_EnabledLayers = getUILayerMask();
m_gridLayersProperties->SetColFormatBool( LAYERS_GRID_ENABLED_POSITION );
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ ) 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 )
{ {
int layer = LAYER_N_FRONT - ii; if( coppersMask & 1 )
wxString value = layer < (m_ActivesLayersCount - 1) ? wxT( "1" ) : wxT( "0" ); ++copperCount;
if( m_ActivesLayersCount > 1 && layer == LAYER_N_FRONT )
value = wxT( "1" ); coppersMask >>= 1;
if( layer == LAYER_N_BACK ) }
value = wxT( "1" );
m_gridLayersProperties->SetCellValue( ii, LAYERS_GRID_ENABLED_POSITION, value ); m_CopperLayerCount = copperCount;
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_ENABLED_POSITION ); showCopperChoice( m_CopperLayerCount );
// Set to Read Only cell for non existing copper layers: showSelectedLayerCheckBoxes( m_EnabledLayers );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_TYPE_POSITION, value != wxT( "1" ) );
m_gridLayersProperties->SetReadOnly( ii, LAYERS_GRID_NAME_POSITION, value != wxT( "1" ) );
} }
*/ }
void DIALOG_LAYERS_SETUP::OnCopperLayersChoice( wxCommandEvent& event )
{
m_CopperLayerCount = m_CopperLayersChoice->GetCurrentSelection() * 2 + 2;
setCopperLayerCheckBoxes( m_CopperLayerCount );
// event.Skip();
} }
...@@ -535,107 +439,139 @@ void DIALOG_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event ) ...@@ -535,107 +439,139 @@ void DIALOG_LAYERS_SETUP::OnCancelButtonClick( wxCommandEvent& event )
void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event ) void DIALOG_LAYERS_SETUP::OnOkButtonClick( wxCommandEvent& event )
/**************************************************************************/ /**************************************************************************/
{ {
if( testLayerNames() )
// temporary code to set the copper layer count until the custom layer enabling is in place:
int copperLayerCount = m_CopperLayersChoice->GetSelection() * 2;
if( copperLayerCount <= 0 )
copperLayerCount = 1;
g_DesignSettings.SetCopperLayerCount( copperLayerCount );
m_Parent->ReCreateLayerBox( NULL );
/*
if( !TestDataValidity() )
{ {
DisplayError( this, _( "Errors detected, Abort" ) ); wxString name;
return;
}
g_DesignSettings.m_CopperLayerCount = m_ActivesLayersCount; m_Pcb->SetEnabledLayers( m_EnabledLayers );
// Initialize the new layer name for( int layer = FIRST_COPPER_LAYER;
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ ) layer <= LAST_COPPER_LAYER; ++layer )
{ {
wxString layer_name = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION ); if( (1<<layer) & m_EnabledLayers )
if( layer_name != m_Pcb->GetLayerName( LAYER_N_FRONT - ii ) )
{ {
m_Pcb->SetLayerName( LAYER_N_FRONT - ii, layer_name ); name = getLayerName( layer );
}
}
// Initialize the layer type m_Pcb->SetLayerName( layer, name );
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows(); ii++ )
{ LAYER_T t = (LAYER_T) getLayerTypeIndex(layer);
wxString txt = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_TYPE_POSITION );
int layer = LAYER_N_FRONT - ii; m_Pcb->SetLayerType( layer, t );
for( int jj = 0; jj < 3; jj++ )
{
if( m_LayersTypeName[jj] == txt )
{
m_Pcb->SetLayerType( layer, m_LayersType[jj] );
break;
}
} }
} }
m_Parent->ReCreateLayerBox( NULL ); m_Parent->ReCreateLayerBox( NULL );
*/
EndModal( wxID_OK ); EndModal( wxID_OK );
}
} }
int DIALOG_LAYERS_SETUP::getLayerTypeIndex( int layer )
{
int choiceId = getIDs( layer ).choice;
int ret = 0;
/**************************************************************************/ wxChoice* ctl = (wxChoice*) FindWindowById( choiceId );
void DIALOG_LAYERS_SETUP::OnLayerCountClick( wxCommandEvent& event )
/**************************************************************************/ 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;
m_ActivesLayersCount = m_LayersCountSelection->GetSelection() * 2;
if( m_ActivesLayersCount <= 0 ) int nameId = getIDs( layer ).name;
m_ActivesLayersCount = 1;
wxTextCtrl* ctl = (wxTextCtrl*) FindWindowById( nameId );
wxASSERT( ctl );
if( ctl )
ret = ctl->GetValue().Trim();
// Reinit the routable layers status return ret;
SetRoutableLayerStatus();
*/
} }
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;
}
/* TestDataValidity bool DIALOG_LAYERS_SETUP::testLayerNames()
* Performs a control of data validity
* set the background of a bad cell in RED and display an info message
* @return true if Ok, false if error
*/
bool DIALOG_LAYERS_SETUP::TestDataValidity()
{ {
bool success = true; std::vector<wxString> names;
/*
m_MessagesList->SetPage(wxEmptyString); // Clear message list 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("%$\" ") );
// Test duplicate layers names if( name == wxEmptyString )
for( int ii = 0; ii < m_gridLayersProperties->GetNumberRows() - 1; ii++ )
{ {
wxString value = m_gridLayersProperties->GetCellValue( ii, LAYERS_GRID_NAME_POSITION ); DisplayError( this, _("Layer name may not be empty" ) );
for( int jj = ii+1; jj < m_gridLayersProperties->GetNumberRows(); jj++ ) 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 )
{ {
wxString othervalue = m_gridLayersProperties->GetCellValue( ii, if( name == *it )
LAYERS_GRID_NAME_POSITION );
othervalue = m_gridLayersProperties->GetCellValue( jj, LAYERS_GRID_NAME_POSITION );
if( value.CmpNoCase( othervalue ) == 0 ) // Already exists!
{ {
wxString text; DisplayError( this, _("Layer name is a duplicate of another") );
text.Printf( _( ctl->SetFocus(); // on the bad name
"<small>This layer name <b>%s</b> is already existing<br>" ), return false;
GetChars( value ) );
m_MessagesList->AppendToPage( text );
success = false;
} }
} }
names.push_back( name );
} }
*/
return success; return true;
} }
//==============================================================================
// Invoke the dialog.
void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent ) void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent )
{ {
...@@ -645,4 +581,3 @@ void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent ) ...@@ -645,4 +581,3 @@ void DisplayDialogLayerSetup( WinEDA_PcbFrame* parent )
frame.Destroy(); frame.Destroy();
} }
//==============================================================================
...@@ -38,25 +38,37 @@ private: ...@@ -38,25 +38,37 @@ private:
WinEDA_PcbFrame* m_Parent; WinEDA_PcbFrame* m_Parent;
// int m_ActivesLayersCount; int m_CopperLayerCount;
int m_EnabledLayers;
BOARD* m_Pcb; BOARD* m_Pcb;
void init(); void init();
void showBoardLayerNames(); void setLayerCheckBox( int layer, bool isChecked );
void setCopperLayerCheckBoxes( int copperCount );
void showSelectedLayerCheckBoxes();
void showCopperChoice( int copperCount );
void showBoardLayerNames();
void showSelectedLayerCheckBoxes( int enableLayerMask );
void showLayerTypes(); 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 OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event ); void OnOkButtonClick( wxCommandEvent& event );
void OnLayerCountClick( wxCommandEvent& event ); void OnCheckBox( wxCommandEvent& event );
void DenyChangeCheckBox( wxCommandEvent& event );
void OnPresetsChoice( wxCommandEvent& event );
void OnCopperLayersChoice( wxCommandEvent& event );
bool testLayerNames();
void SetRoutableLayerStatus( );
bool TestDataValidity();
public: public:
DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent ); DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent );
......
...@@ -22,7 +22,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -22,7 +22,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
wxStaticBoxSizer* sbPresetsSizer; wxStaticBoxSizer* sbPresetsSizer;
sbPresetsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Preset Layer Groupings") ), wxVERTICAL ); sbPresetsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Preset Layer Groupings") ), wxVERTICAL );
wxString m_PresetsChoiceChoices[] = { _("All Layers On"), _("Single Sided"), _("Single Sided, 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") }; wxString m_PresetsChoiceChoices[] = { _("Custom"), _("Two layers, parts on Front only"), _("Two layers, parts on Back only"), _("Two layers, parts on Front and Back"), _("Four layers, parts on Front only"), _("Four layers, parts on Front and Back"), _("All layers on") };
int m_PresetsChoiceNChoices = sizeof( m_PresetsChoiceChoices ) / sizeof( wxString ); int m_PresetsChoiceNChoices = sizeof( m_PresetsChoiceChoices ) / sizeof( wxString );
m_PresetsChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PresetsChoiceNChoices, m_PresetsChoiceChoices, 0 ); m_PresetsChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PresetsChoiceNChoices, m_PresetsChoiceChoices, 0 );
m_PresetsChoice->SetSelection( 0 ); m_PresetsChoice->SetSelection( 0 );
...@@ -33,7 +33,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -33,7 +33,7 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
wxStaticBoxSizer* sbCopperLayersSizer; wxStaticBoxSizer* sbCopperLayersSizer;
sbCopperLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers") ), wxVERTICAL ); sbCopperLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Copper Layers") ), wxVERTICAL );
wxString m_CopperLayersChoiceChoices[] = { _("1"), _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16") }; wxString m_CopperLayersChoiceChoices[] = { _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16") };
int m_CopperLayersChoiceNChoices = sizeof( m_CopperLayersChoiceChoices ) / sizeof( wxString ); int m_CopperLayersChoiceNChoices = sizeof( m_CopperLayersChoiceChoices ) / sizeof( wxString );
m_CopperLayersChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_CopperLayersChoiceNChoices, m_CopperLayersChoiceChoices, 0 ); m_CopperLayersChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_CopperLayersChoiceNChoices, m_CopperLayersChoiceChoices, 0 );
m_CopperLayersChoice->SetSelection( 0 ); m_CopperLayersChoice->SetSelection( 0 );
...@@ -785,6 +785,37 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -785,6 +785,37 @@ 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_CopperLayersChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCopperLayersChoice ), NULL, this );
m_AdhesFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SoldPFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SilkSFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_MaskFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_FrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner2CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner3CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner4CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner5CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner6CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner7CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner8CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner9CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner10CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner11CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner12CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner13CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner14CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner15CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_BackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_MaskBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SilkSBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SoldPBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_AdhesBackCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_PCBEdgesCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_Eco2CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_Eco1CheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_CommentsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_DrawingsCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::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_BASE2::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_BASE2::OnOkButtonClick ), NULL, this );
} }
...@@ -792,6 +823,37 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow ...@@ -792,6 +823,37 @@ DIALOG_LAYERS_SETUP_BASE2::DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindow
DIALOG_LAYERS_SETUP_BASE2::~DIALOG_LAYERS_SETUP_BASE2() DIALOG_LAYERS_SETUP_BASE2::~DIALOG_LAYERS_SETUP_BASE2()
{ {
// Disconnect Events // Disconnect Events
m_PresetsChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnPresetsChoice ), NULL, this );
m_CopperLayersChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCopperLayersChoice ), NULL, this );
m_AdhesFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SoldPFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SilkSFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_MaskFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_FrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner2CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner3CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner4CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner5CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner6CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner7CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner8CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner9CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner10CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner11CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner12CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner13CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner14CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_Inner15CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_BackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::DenyChangeCheckBox ), NULL, this );
m_MaskBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SilkSBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_SoldPBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_AdhesBackCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_PCBEdgesCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_Eco2CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_Eco1CheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_CommentsCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::OnCheckBox ), NULL, this );
m_DrawingsCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LAYERS_SETUP_BASE2::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_BASE2::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_BASE2::OnOkButtonClick ), NULL, this );
} }
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="1"> <object class="wxChoice" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices">&quot;All Layers On&quot; &quot;Single Sided&quot; &quot;Single Sided, SMD on Back&quot; &quot;Two Layers, Parts on Front&quot; &quot;Two Layers, Parts on Both Faces&quot; &quot;Four Layers, Parts on Front&quot; &quot;Four Layers, Parts on Both Faces&quot;</property> <property name="choices">&quot;Custom&quot; &quot;Two layers, parts on Front only&quot; &quot;Two layers, parts on Back only&quot; &quot;Two layers, parts on Front and Back&quot; &quot;Four layers, parts on Front only&quot; &quot;Four layers, parts on Front and Back&quot; &quot;All layers on&quot;</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnChoice"></event> <event name="OnChoice">OnPresetsChoice</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="1"> <object class="wxChoice" expanded="1">
<property name="bg"></property> <property name="bg"></property>
<property name="choices">&quot;1&quot; &quot;2&quot; &quot;4&quot; &quot;6&quot; &quot;8&quot; &quot;10&quot; &quot;12&quot; &quot;14&quot; &quot;16&quot;</property> <property name="choices">&quot;2&quot; &quot;4&quot; &quot;6&quot; &quot;8&quot; &quot;10&quot; &quot;12&quot; &quot;14&quot; &quot;16&quot;</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="enabled">1</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnChoice"></event> <event name="OnChoice">OnCopperLayersChoice</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -581,7 +581,7 @@ ...@@ -581,7 +581,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -789,7 +789,7 @@ ...@@ -789,7 +789,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -997,7 +997,7 @@ ...@@ -997,7 +997,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -1205,7 +1205,7 @@ ...@@ -1205,7 +1205,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -1417,7 +1417,7 @@ ...@@ -1417,7 +1417,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -1629,7 +1629,7 @@ ...@@ -1629,7 +1629,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -1841,7 +1841,7 @@ ...@@ -1841,7 +1841,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -2053,7 +2053,7 @@ ...@@ -2053,7 +2053,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -2265,7 +2265,7 @@ ...@@ -2265,7 +2265,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -2477,7 +2477,7 @@ ...@@ -2477,7 +2477,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -2689,7 +2689,7 @@ ...@@ -2689,7 +2689,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -2901,7 +2901,7 @@ ...@@ -2901,7 +2901,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -3113,7 +3113,7 @@ ...@@ -3113,7 +3113,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -3325,7 +3325,7 @@ ...@@ -3325,7 +3325,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -3537,7 +3537,7 @@ ...@@ -3537,7 +3537,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -3749,7 +3749,7 @@ ...@@ -3749,7 +3749,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -3961,7 +3961,7 @@ ...@@ -3961,7 +3961,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -4173,7 +4173,7 @@ ...@@ -4173,7 +4173,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -4385,7 +4385,7 @@ ...@@ -4385,7 +4385,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -4597,7 +4597,7 @@ ...@@ -4597,7 +4597,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">DenyChangeCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -4805,7 +4805,7 @@ ...@@ -4805,7 +4805,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -5013,7 +5013,7 @@ ...@@ -5013,7 +5013,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -5221,7 +5221,7 @@ ...@@ -5221,7 +5221,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -5429,7 +5429,7 @@ ...@@ -5429,7 +5429,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -5637,7 +5637,7 @@ ...@@ -5637,7 +5637,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -5845,7 +5845,7 @@ ...@@ -5845,7 +5845,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -6053,7 +6053,7 @@ ...@@ -6053,7 +6053,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -6261,7 +6261,7 @@ ...@@ -6261,7 +6261,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
...@@ -6469,7 +6469,7 @@ ...@@ -6469,7 +6469,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<event name="OnChar"></event> <event name="OnChar"></event>
<event name="OnCheckBox"></event> <event name="OnCheckBox">OnCheckBox</event>
<event name="OnEnterWindow"></event> <event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event> <event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event> <event name="OnKeyDown"></event>
......
...@@ -252,6 +252,10 @@ class DIALOG_LAYERS_SETUP_BASE2 : public wxDialog ...@@ -252,6 +252,10 @@ class DIALOG_LAYERS_SETUP_BASE2 : public wxDialog
wxButton* m_sdbSizer2Cancel; wxButton* m_sdbSizer2Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnPresetsChoice( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCopperLayersChoice( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBox( wxCommandEvent& event ){ event.Skip(); }
virtual void DenyChangeCheckBox( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
......
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