diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.cpp b/pcbnew/board_stackup_manager/panel_board_stackup.cpp index 619fb49916..4700f71610 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup.cpp @@ -80,6 +80,8 @@ PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP( PAGED_DIALOG* aParent, PCB m_brdSettings = &m_board->GetDesignSettings(); m_units = aFrame->GetUserUnits(); + m_panelLayers->SetPhysicalStackupPanel( this ); + m_enabledLayers = m_board->GetEnabledLayers() & BOARD_STACKUP::StackupAllowedBrdLayers(); // Calculates a good size for color swatches (icons) in this dialog @@ -112,6 +114,14 @@ PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP( PAGED_DIALOG* aParent, PCB buildLayerStackPanel( true ); synchronizeWithBoard( true ); + + m_choiceCopperLayers->Bind( wxEVT_CHOICE, + [&]( wxCommandEvent ) + { + updateCopperLayerCount(); + showOnlyActiveLayers(); + Layout(); + } ); } @@ -329,12 +339,34 @@ void PANEL_SETUP_BOARD_STACKUP::onUpdateThicknessValue( wxUpdateUIEvent& event ) } +int PANEL_SETUP_BOARD_STACKUP::GetCopperLayerCount() const +{ + return ( m_choiceCopperLayers->GetSelection() + 1 ) * 2; +} + + +void PANEL_SETUP_BOARD_STACKUP::updateCopperLayerCount() +{ + int copperCount = GetCopperLayerCount(); + + wxASSERT( copperCount >= 2 ); + + m_enabledLayers |= LSET::ExternalCuMask(); + m_enabledLayers &= ~LSET::InternalCuMask(); + + for( int i = 1; i < copperCount - 1; i++ ) + m_enabledLayers.set( F_Cu + i ); +} + + void PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard( bool aFullSync ) { const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor(); if( aFullSync ) { + m_choiceCopperLayers->SetSelection( ( m_board->GetCopperLayerCount() / 2 ) - 1 ); + m_rbDielectricConstraint->SetSelection( brd_stackup.m_HasDielectricConstrains ? 1 : 0 ); m_choiceEdgeConn->SetSelection( brd_stackup.m_EdgeConnectorConstraints ); m_cbCastellatedPads->SetValue( brd_stackup.m_CastellatedPads ); @@ -1041,6 +1073,10 @@ bool PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow() if( !transferDataFromUIToStackup() ) return false; + // NOTE: Copper layer count is transferred via PANEL_SETUP_LAYERS even though it is configured + // on this page, because the logic for confirming deletion of board items on deleted layers is + // on that panel and it doesn't make sense to split it up. + BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor(); STRING_FORMATTER old_stackup; diff --git a/pcbnew/board_stackup_manager/panel_board_stackup.h b/pcbnew/board_stackup_manager/panel_board_stackup.h index 79bba5ee7d..24a603d918 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup.h @@ -93,6 +93,9 @@ public: */ void OnLayersOptionsChanged( LSET aNewLayerSet ); + /// @return the number of copper layers configured for the board stackup + int GetCopperLayerCount() const; + /// @return the BOARD_STACKUP_ITEM managed by the row aRow BOARD_STACKUP_ITEM* GetStackupItem( int aRow ); /// @return the BOARD_STACKUP_ITEM sublayermanaged by the row aRow @@ -170,6 +173,11 @@ private: */ bool transferDataFromUIToStackup(); + /** + * Updates the enabled copper layers when the dropdown is changed + */ + void updateCopperLayerCount(); + void onUpdateThicknessValue( wxUpdateUIEvent& event ) override; void onColorSelected( wxCommandEvent& event ); void onMaterialChange( wxCommandEvent& event ); diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp b/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp index 504138132e..bb2e88ca35 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Dec 30 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -156,6 +156,23 @@ PANEL_SETUP_BOARD_STACKUP_BASE::PANEL_SETUP_BOARD_STACKUP_BASE( wxWindow* parent wxBoxSizer* bSizerBrdThickness; bSizerBrdThickness = new wxBoxSizer( wxHORIZONTAL ); + m_lblCopperLayers = new wxStaticText( this, wxID_ANY, _("Copper layers:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_lblCopperLayers->Wrap( -1 ); + m_lblCopperLayers->SetToolTip( _("Select the number of copper layers in the stackup") ); + + bSizerBrdThickness->Add( m_lblCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxString m_choiceCopperLayersChoices[] = { _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16"), _("18"), _("20"), _("22"), _("24"), _("26"), _("28"), _("30"), _("32") }; + int m_choiceCopperLayersNChoices = sizeof( m_choiceCopperLayersChoices ) / sizeof( wxString ); + m_choiceCopperLayers = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceCopperLayersNChoices, m_choiceCopperLayersChoices, 0 ); + m_choiceCopperLayers->SetSelection( 0 ); + m_choiceCopperLayers->SetToolTip( _("Select the number of copper layers in the stackup") ); + + bSizerBrdThickness->Add( m_choiceCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizerBrdThickness->Add( 0, 0, 1, wxEXPAND, 5 ); + m_staticTextCT = new wxStaticText( this, wxID_ANY, _("Board thickness from stackup:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); m_staticTextCT->Wrap( -1 ); bSizerBrdThickness->Add( m_staticTextCT, 2, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp b/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp index c0f856bea0..03c2606dee 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.fbp @@ -14,7 +14,6 @@ panel_board_stackup_base 1000 none - 1 PANEL_BOARD_SETUP_BASE @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -841,7 +839,6 @@ - 0 @@ -915,7 +912,6 @@ - 0 @@ -1454,11 +1450,146 @@ 5 wxEXPAND|wxALL 2 - + -1,-1 bSizerBrdThickness wxHORIZONTAL none + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Copper layers: + 0 + + 0 + + + 0 + + 1 + m_lblCopperLayers + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + Select the number of copper layers in the stackup + + + + -1 + + + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "2" "4" "6" "8" "10" "12" "14" "16" "18" "20" "22" "24" "26" "28" "30" "32" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_choiceCopperLayers + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + Select the number of copper layers in the stackup + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + 5 wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT @@ -1629,7 +1760,6 @@ - 0 diff --git a/pcbnew/board_stackup_manager/panel_board_stackup_base.h b/pcbnew/board_stackup_manager/panel_board_stackup_base.h index 365e4b56db..efa19bdc16 100644 --- a/pcbnew/board_stackup_manager/panel_board_stackup_base.h +++ b/pcbnew/board_stackup_manager/panel_board_stackup_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Dec 30 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -65,11 +65,13 @@ class PANEL_SETUP_BOARD_STACKUP_BASE : public wxPanel wxChoice* m_choiceFinish; wxStaticText* m_staticTextEdgeConn; wxChoice* m_choiceEdgeConn; + wxStaticText* m_lblCopperLayers; + wxChoice* m_choiceCopperLayers; wxStaticText* m_staticTextCT; wxTextCtrl* m_tcCTValue; wxButton* m_buttonExport; - // Virtual event handlers, override them in your derived class + // Virtual event handlers, overide them in your derived class virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); } virtual void onAddDielectricLayer( wxCommandEvent& event ) { event.Skip(); } virtual void onRemoveDielectricLayer( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/dialogs/dialog_board_setup.cpp b/pcbnew/dialogs/dialog_board_setup.cpp index 39745102a5..189ad3e8f6 100644 --- a/pcbnew/dialogs/dialog_board_setup.cpp +++ b/pcbnew/dialogs/dialog_board_setup.cpp @@ -72,7 +72,15 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : */ m_treebook->AddPage( new wxPanel( this ), _( "Board Stackup" ) ); + + /* + * WARNING: Code currently relies on the layers setup coming before the physical stackup panel, + * and thus transferring data to the board first. See comment in + * PANEL_SETUP_BOARD_STACKUP::TransferDataFromWindow and rework this logic if it is determined + * that the order of these pages should be changed. + */ m_treebook->AddSubPage( m_layers, _( "Board Editor Layers" ) ); + m_layerSetupPage = 1; m_treebook->AddSubPage( m_physicalStackup, _( "Physical Stackup" ) ); // Change this value if m_physicalStackup is not the page 2 of m_treebook m_physicalStackupPage = 2; // The page number (from 0) to select the m_physicalStackup panel @@ -117,6 +125,8 @@ void DIALOG_BOARD_SETUP::OnPageChange( wxBookCtrlEvent& event ) { if( event.GetSelection() == m_physicalStackupPage ) m_physicalStackup->OnLayersOptionsChanged( m_layers->GetUILayerMask() ); + else if( event.GetSelection() == m_layerSetupPage ) + m_layers->SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() ); #ifdef __WXMAC__ // Work around an OSX bug where the wxGrid children don't get placed correctly until diff --git a/pcbnew/dialogs/dialog_board_setup.h b/pcbnew/dialogs/dialog_board_setup.h index 6075d6abd4..13a53d5bf5 100644 --- a/pcbnew/dialogs/dialog_board_setup.h +++ b/pcbnew/dialogs/dialog_board_setup.h @@ -65,6 +65,7 @@ protected: private: int m_physicalStackupPage; // the page index of the PANEL_SETUP_BOARD_STACKUP page + int m_layerSetupPage; // the page index of the PANEL_SETUP_LAYERS page }; diff --git a/pcbnew/dialogs/panel_setup_layers.cpp b/pcbnew/dialogs/panel_setup_layers.cpp index d90e79db2b..9252916ecb 100644 --- a/pcbnew/dialogs/panel_setup_layers.cpp +++ b/pcbnew/dialogs/panel_setup_layers.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -118,35 +119,9 @@ static LSEQ dlg_layers() } -// Layer bit masks for each defined "Preset Layer Grouping" -static const LSET presets[] = -{ - LSET(), // shift the array index up by one, matches with "Custom". - - // "Two layers, parts on Front only" - LSET( 2, F_Cu, B_Cu ) | LSET::FrontTechMask() | LSET( 1, B_Mask ) | LSET::UserMask(), - - // "Two layers, parts on Back only", - LSET( 2, F_Cu, B_Cu ) | LSET::BackTechMask() | LSET( 1, F_Mask ) | LSET::UserMask(), - - // "Two layers, parts on Front and Back", - LSET( 2, F_Cu, B_Cu ) | LSET::FrontTechMask() | LSET::BackTechMask() | LSET::UserMask(), - - // "Four layers, parts on Front only" - LSET( 4, F_Cu, B_Cu, In1_Cu, In2_Cu ) | LSET::FrontTechMask() | LSET::UserMask(), - - // "Four layers, parts on Front and Back" - LSET( 4, F_Cu, B_Cu, In1_Cu, In2_Cu ) | LSET::FrontTechMask() | LSET::BackTechMask() | - LSET::UserMask(), - - // "All layers on", - LSET().set(), -}; - - PANEL_SETUP_LAYERS::PANEL_SETUP_LAYERS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : PANEL_SETUP_LAYERS_BASE( aParent->GetTreebook() ), - m_Parent( aParent ), m_frame( aFrame ) + m_parentDialog( aParent ), m_frame( aFrame ) { m_pcb = aFrame->GetBoard(); } @@ -256,12 +231,11 @@ bool PANEL_SETUP_LAYERS::TransferDataToWindow() // Rescue may be enabled, but should not be shown in this dialog m_enabledLayers.reset( Rescue ); - showCopperChoice( m_pcb->GetCopperLayerCount() ); setCopperLayerCheckBoxes( m_pcb->GetCopperLayerCount() ); showBoardLayerNames(); showSelectedLayerCheckBoxes( m_enabledLayers ); - showPresets( m_enabledLayers ); + showLayerTypes(); setMandatoryLayerCheckBoxes(); setUserDefinedLayerCheckBoxes(); @@ -270,6 +244,12 @@ bool PANEL_SETUP_LAYERS::TransferDataToWindow() } +void PANEL_SETUP_LAYERS::SyncCopperLayers( int aNumCopperLayers ) +{ + setCopperLayerCheckBoxes( aNumCopperLayers ); +} + + void PANEL_SETUP_LAYERS::setMandatoryLayerCheckBoxes() { for( int layer : { F_CrtYd, B_CrtYd, Edge_Cuts, Margin } ) @@ -306,27 +286,6 @@ void PANEL_SETUP_LAYERS::setUserDefinedLayerCheckBoxes() } -void PANEL_SETUP_LAYERS::showCopperChoice( int copperCount ) -{ - if( copperCount > MAX_CU_LAYERS ) - copperCount = MAX_CU_LAYERS; - - if( copperCount < 2 ) - copperCount = 2; - - for( int lyrCnt = 2; lyrCnt <= MAX_CU_LAYERS; lyrCnt += 2 ) - { - // Note: This will change a 1 layer board to 2 - if( copperCount <= lyrCnt ) - { - int idx = lyrCnt/2 - 1; - m_CopperLayersChoice->SetSelection(idx); - break; - } - } -} - - void PANEL_SETUP_LAYERS::showBoardLayerNames() { // Set all the board's layer names into the dialog by calling BOARD::GetLayerName(), @@ -361,23 +320,6 @@ void PANEL_SETUP_LAYERS::showSelectedLayerCheckBoxes( LSET enabledLayers ) } -void PANEL_SETUP_LAYERS::showPresets( LSET enabledLayers ) -{ - int presetsNdx = 0; // The "Custom" setting, matches nothing - - for( unsigned i=1; iSetSelection( presetsNdx ); -} - - void PANEL_SETUP_LAYERS::showLayerTypes() { for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq ) @@ -459,8 +401,6 @@ void PANEL_SETUP_LAYERS::setCopperLayerCheckBoxes( int copperCount ) void PANEL_SETUP_LAYERS::OnCheckBox( wxCommandEvent& event ) { m_enabledLayers = GetUILayerMask(); - - showPresets( m_enabledLayers ); } @@ -475,13 +415,8 @@ void PANEL_SETUP_LAYERS::DenyChangeCheckBox( wxCommandEvent& event ) if( source == copper ) { - wxString controlLabel = m_staticTextCopperLayers->GetLabel(); - // Knock the ':' off the end - controlLabel = controlLabel.substr( 0, controlLabel.size() - 1 ); - - msg.Printf( _( "Use the \"%s\" control to change the number of copper layers." ), - controlLabel ); - DisplayError( this, msg ); + DisplayError( this, + _( "Use the Physical Stackup page to change the number of copper layers." ) ); copper->SetValue( true ); return; @@ -503,42 +438,14 @@ void PANEL_SETUP_LAYERS::DenyChangeCheckBox( wxCommandEvent& event ) } -void PANEL_SETUP_LAYERS::OnPresetsChoice( wxCommandEvent& event ) -{ - int presetNdx = m_PresetsChoice->GetCurrentSelection(); - - if( presetNdx <= 0 ) // the Custom setting controls nothing. - return; - - if( presetNdx < (int) arrayDim(presets) ) - { - m_enabledLayers = presets[ presetNdx ]; - LSET copperSet = m_enabledLayers & LSET::AllCuMask(); - int copperCount = copperSet.count(); - - showCopperChoice( copperCount ); - showSelectedLayerCheckBoxes( m_enabledLayers ); - setCopperLayerCheckBoxes( copperCount ); - } - - // Ensure mandatory layers are activated - setMandatoryLayerCheckBoxes(); -} - - -void PANEL_SETUP_LAYERS::OnCopperLayersChoice( wxCommandEvent& event ) -{ - setCopperLayerCheckBoxes( m_CopperLayersChoice->GetCurrentSelection() * 2 + 2 ); - m_enabledLayers = GetUILayerMask(); - showPresets( m_enabledLayers ); -} - - bool PANEL_SETUP_LAYERS::TransferDataFromWindow() { if( !testLayerNames() ) return false; + // Make sure we have the latest copper layer count + SyncCopperLayers( m_physicalStackup->GetCopperLayerCount() ); + wxString msg; bool modified = false; @@ -739,20 +646,20 @@ bool PANEL_SETUP_LAYERS::testLayerNames() if( !name ) { - m_Parent->SetError( _( "Layer must have a name." ), this, ctl ); + m_parentDialog->SetError( _( "Layer must have a name." ), this, ctl ); return false; } if( hasOneOf( name, badchars ) ) { auto msg = wxString::Format(_( "\"%s\" are forbidden in layer names." ), badchars ); - m_Parent->SetError( msg, this, ctl ); + m_parentDialog->SetError( msg, this, ctl ); return false; } if( name == wxT( "signal" ) ) { - m_Parent->SetError( _( "Layer name \"signal\" is reserved." ), this, ctl ); + m_parentDialog->SetError( _( "Layer name \"signal\" is reserved." ), this, ctl ); return false; } @@ -761,7 +668,7 @@ bool PANEL_SETUP_LAYERS::testLayerNames() if( name == existingName ) { auto msg = wxString::Format(_( "Layer name \"%s\" is already in use." ), name ); - m_Parent->SetError( msg, this, ctl ); + m_parentDialog->SetError( msg, this, ctl ); return false; } } diff --git a/pcbnew/dialogs/panel_setup_layers.h b/pcbnew/dialogs/panel_setup_layers.h index f8b6d59b4b..45c88d2b90 100644 --- a/pcbnew/dialogs/panel_setup_layers.h +++ b/pcbnew/dialogs/panel_setup_layers.h @@ -32,6 +32,7 @@ class PCB_EDIT_FRAME; class BOARD; class BOARD_DESIGN_SETTINGS; +class PANEL_SETUP_BOARD_STACKUP; /** @@ -78,30 +79,33 @@ public: ///< @return the layer name within the UI wxTextCtrl wxString GetLayerName( LAYER_NUM layer ); -private: - PAGED_DIALOG* m_Parent; - PCB_EDIT_FRAME* m_frame; + /** + * Called when switching to this tab to make sure that any changes to the copper layer count + * made on the physical stackup page are reflected here + * @param aNumCopperLayers is the number of copper layers in the board + */ + void SyncCopperLayers( int aNumCopperLayers ); - BOARD* m_pcb; - LSET m_enabledLayers; + void SetPhysicalStackupPanel( PANEL_SETUP_BOARD_STACKUP* aPanel ) + { + m_physicalStackup = aPanel; + } + +private: void setLayerCheckBox( LAYER_NUM layer, bool isChecked ); void setCopperLayerCheckBoxes( int copperCount ); void setMandatoryLayerCheckBoxes(); void setUserDefinedLayerCheckBoxes(); - void showCopperChoice( int copperCount ); void showBoardLayerNames(); void showSelectedLayerCheckBoxes( LSET enableLayerMask ); void showLayerTypes(); - void showPresets( LSET enabledLayerMask ); int getLayerTypeIndex( LAYER_NUM layer ); void OnCheckBox( wxCommandEvent& event ) override; void DenyChangeCheckBox( wxCommandEvent& event ) override; - void OnPresetsChoice( wxCommandEvent& event ) override; - void OnCopperLayersChoice( wxCommandEvent& event ) override; bool TransferDataToWindow() override; bool TransferDataFromWindow() override; virtual void addUserDefinedLayer( wxCommandEvent& aEvent ) override; @@ -126,6 +130,12 @@ private: wxControl* getName( LAYER_NUM aLayer ); wxCheckBox* getCheckBox( LAYER_NUM aLayer ); wxChoice* getChoice( LAYER_NUM aLayer ); + + PAGED_DIALOG* m_parentDialog; + PCB_EDIT_FRAME* m_frame; + PANEL_SETUP_BOARD_STACKUP* m_physicalStackup; + BOARD* m_pcb; + LSET m_enabledLayers; }; diff --git a/pcbnew/dialogs/panel_setup_layers_base.cpp b/pcbnew/dialogs/panel_setup_layers_base.cpp index 4236f5fcee..eabadc692a 100644 --- a/pcbnew/dialogs/panel_setup_layers_base.cpp +++ b/pcbnew/dialogs/panel_setup_layers_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -20,25 +20,6 @@ PANEL_SETUP_LAYERS_BASE::PANEL_SETUP_LAYERS_BASE( wxWindow* parent, wxWindowID i wxBoxSizer* bSizerLayerCnt; bSizerLayerCnt = new wxBoxSizer( wxHORIZONTAL ); - wxString m_PresetsChoiceChoices[] = { _("Custom layer set"), _("Two layers, parts on Front"), _("Two layers, parts on Back"), _("Two layers, parts on Front & Back"), _("Four layers, parts on Front"), _("Four layers, parts on Front & Back"), _("All layers on") }; - int m_PresetsChoiceNChoices = sizeof( m_PresetsChoiceChoices ) / sizeof( wxString ); - m_PresetsChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PresetsChoiceNChoices, m_PresetsChoiceChoices, 0 ); - m_PresetsChoice->SetSelection( 0 ); - bSizerLayerCnt->Add( m_PresetsChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerLayerCnt->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextCopperLayers = new wxStaticText( this, wxID_ANY, _("Copper layers:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCopperLayers->Wrap( -1 ); - bSizerLayerCnt->Add( m_staticTextCopperLayers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 ); - - wxString m_CopperLayersChoiceChoices[] = { _("2"), _("4"), _("6"), _("8"), _("10"), _("12"), _("14"), _("16"), _("18"), _("20"), _("22"), _("24"), _("26"), _("28"), _("30"), _("32") }; - int m_CopperLayersChoiceNChoices = sizeof( m_CopperLayersChoiceChoices ) / sizeof( wxString ); - m_CopperLayersChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_CopperLayersChoiceNChoices, m_CopperLayersChoiceChoices, 0 ); - m_CopperLayersChoice->SetSelection( 0 ); - bSizerLayerCnt->Add( m_CopperLayersChoice, 0, wxALL|wxALIGN_CENTER_VERTICAL, 3 ); - bSizerLayerCnt->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -832,8 +813,6 @@ PANEL_SETUP_LAYERS_BASE::PANEL_SETUP_LAYERS_BASE( wxWindow* parent, wxWindowID i bMainSizer->Fit( this ); // Connect Events - m_PresetsChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::OnPresetsChoice ), NULL, this ); - m_CopperLayersChoice->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::OnCopperLayersChoice ), NULL, this ); m_addUserDefinedLayerButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::addUserDefinedLayer ), NULL, this ); m_addUserDefinedLayerButton->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_LAYERS_BASE::onUpdateAddUserDefinedLayer ), NULL, this ); m_CrtYdFrontCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::DenyChangeCheckBox ), NULL, this ); @@ -900,8 +879,6 @@ PANEL_SETUP_LAYERS_BASE::PANEL_SETUP_LAYERS_BASE( wxWindow* parent, wxWindowID i PANEL_SETUP_LAYERS_BASE::~PANEL_SETUP_LAYERS_BASE() { // Disconnect Events - m_PresetsChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::OnPresetsChoice ), NULL, this ); - m_CopperLayersChoice->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::OnCopperLayersChoice ), NULL, this ); m_addUserDefinedLayerButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::addUserDefinedLayer ), NULL, this ); m_addUserDefinedLayerButton->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_LAYERS_BASE::onUpdateAddUserDefinedLayer ), NULL, this ); m_CrtYdFrontCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_SETUP_LAYERS_BASE::DenyChangeCheckBox ), NULL, this ); diff --git a/pcbnew/dialogs/panel_setup_layers_base.fbp b/pcbnew/dialogs/panel_setup_layers_base.fbp index 02de6d7561..fff95b26f9 100644 --- a/pcbnew/dialogs/panel_setup_layers_base.fbp +++ b/pcbnew/dialogs/panel_setup_layers_base.fbp @@ -14,7 +14,6 @@ panel_setup_layers_base 1000 none - 1 PANEL_SETUP_LAYERS @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -74,207 +72,6 @@ bSizerLayerCnt wxHORIZONTAL none - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Custom layer set" "Two layers, parts on Front" "Two layers, parts on Back" "Two layers, parts on Front & Back" "Four layers, parts on Front" "Four layers, parts on Front & Back" "All layers on" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_PresetsChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnPresetsChoice - - - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - - - 3 - wxALIGN_CENTER_VERTICAL|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Copper layers: - 0 - - 0 - - - 0 - - 1 - m_staticTextCopperLayers - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 3 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "2" "4" "6" "8" "10" "12" "14" "16" "18" "20" "22" "24" "26" "28" "30" "32" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_CopperLayersChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCopperLayersChoice - - 5 wxEXPAND @@ -298,7 +95,6 @@ - 0 diff --git a/pcbnew/dialogs/panel_setup_layers_base.h b/pcbnew/dialogs/panel_setup_layers_base.h index 329b66c446..336983d51a 100644 --- a/pcbnew/dialogs/panel_setup_layers_base.h +++ b/pcbnew/dialogs/panel_setup_layers_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 3 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -11,20 +11,20 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include #include #include @@ -169,9 +169,6 @@ class PANEL_SETUP_LAYERS_BASE : public wxPanel private: protected: - wxChoice* m_PresetsChoice; - wxStaticText* m_staticTextCopperLayers; - wxChoice* m_CopperLayersChoice; wxButton* m_addUserDefinedLayerButton; wxStaticLine* m_staticline2; wxScrolledWindow* m_LayersListPanel; @@ -355,8 +352,6 @@ class PANEL_SETUP_LAYERS_BASE : public wxPanel wxStaticText* m_User9StaticText; // 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 addUserDefinedLayer( wxCommandEvent& event ) { event.Skip(); } virtual void onUpdateAddUserDefinedLayer( wxUpdateUIEvent& event ) { event.Skip(); } virtual void DenyChangeCheckBox( wxCommandEvent& event ) { event.Skip(); }