diff --git a/pcbnew/dialogs/dialog_unused_pad_layers.cpp b/pcbnew/dialogs/dialog_unused_pad_layers.cpp index 78bbc325aa..1611f9365e 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers.cpp +++ b/pcbnew/dialogs/dialog_unused_pad_layers.cpp @@ -72,20 +72,6 @@ void DIALOG_UNUSED_PAD_LAYERS::syncImages( wxCommandEvent& aEvent ) } -void DIALOG_UNUSED_PAD_LAYERS::onScopeChange( wxCommandEvent& aEvent ) -{ - if( m_rbScope->GetSelection() == SCOPE_PADS ) - { - m_cbPreservePads->SetValue( true ); - m_cbPreservePads->Disable(); - } - else - m_cbPreservePads->Enable(); - - syncImages( aEvent ); -} - - bool DIALOG_UNUSED_PAD_LAYERS::TransferDataFromWindow() { if( m_cbSelectedOnly->IsChecked() ) diff --git a/pcbnew/dialogs/dialog_unused_pad_layers.fbp b/pcbnew/dialogs/dialog_unused_pad_layers.fbp index b209672a3e..13f27401ee 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers.fbp +++ b/pcbnew/dialogs/dialog_unused_pad_layers.fbp @@ -14,7 +14,6 @@ dialog_unused_pad_layers_base 1000 none - 1 DIALOG_UNUSED_PAD_LAYERS_BASE @@ -26,7 +25,6 @@ 1 1 UI - 0 0 0 @@ -50,7 +48,7 @@ -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Unused Pad Layers + Remove Unused Pads @@ -62,7 +60,7 @@ protected 5 - wxEXPAND + wxEXPAND|wxRIGHT|wxLEFT 6 @@ -71,385 +69,291 @@ none 5 - wxEXPAND - 4 - + wxEXPAND|wxALL + 0 + + 2 + wxVERTICAL + + + 5 - bSizer6 - wxVERTICAL + fgSizerProps + wxFLEX_GROWMODE_SPECIFIED none + 0 + 0 - 0 - wxEXPAND + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 1 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "&Vias" "&Pads" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Scope + 1 + + 0 + + + 0 - bSizer4 - wxVERTICAL - none - - 5 - - 2 - - - bSizer5 - wxHORIZONTAL - none - - 5 - wxEXPAND - 0 - - 0 - protected - 0 - - - - 5 - wxALL|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "&Vias" "&Pads" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Scope - 1 - - 0 - - - 0 - - 1 - m_rbScope - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onScopeChange - - - - 5 - wxALL|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "&Remove Unused" "Reset &Unused" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Action - 1 - - 0 - - - 0 - - 1 - m_rbAction - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - syncImages - - - - 5 - wxEXPAND - 0 - - 0 - protected - 0 - - - - - - 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Selection only - - 0 - - - 0 - - 1 - m_cbSelectedOnly - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - &Keep pads at first and last layers - - 0 - - - 0 - - 1 - m_cbPreservePads - 1 - - - protected - 1 - - Resizable - 1 - - - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - syncImages - - + 1 + m_rbScope + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "&Remove unused layers" "&Keep unused layers" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Action + 1 + + 0 + + + 0 + + 1 + m_rbAction + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + syncImages + + + + 10 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Selection only + + 0 + + + 0 + + 1 + m_cbSelectedOnly + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 10 + wxEXPAND|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Keep &outside layers + + 0 + + + 0 + + 1 + m_cbPreservePads + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + syncImages - - 5 - wxEXPAND | wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_staticline1 - 1 - - - protected - 1 - - Resizable - 1 - - wxLI_VERTICAL - ; ; forward_declare - 0 - - - - - - 5 wxEXPAND|wxLEFT|wxRIGHT - 2 + 1 - bSizer3 + bSizerPreview wxVERTICAL none @@ -464,7 +368,7 @@ 10 - wxALL + wxTOP|wxRIGHT|wxLEFT 0 1 @@ -534,6 +438,64 @@ + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline2 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + ; ; forward_declare + 0 + + + + + + 5 wxEXPAND|wxALL diff --git a/pcbnew/dialogs/dialog_unused_pad_layers.h b/pcbnew/dialogs/dialog_unused_pad_layers.h index abcc27763b..96d2b0e6f6 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers.h +++ b/pcbnew/dialogs/dialog_unused_pad_layers.h @@ -44,7 +44,6 @@ private: bool AcceptOptions(); void syncImages( wxCommandEvent& aEvent ) override; - void onScopeChange( wxCommandEvent& aEvent ) override; PCB_BASE_FRAME* m_frame; const PCB_SELECTION& m_items; // List of items to be modified. diff --git a/pcbnew/dialogs/dialog_unused_pad_layers_base.cpp b/pcbnew/dialogs/dialog_unused_pad_layers_base.cpp index 69c446aa08..1b1a32534f 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers_base.cpp +++ b/pcbnew/dialogs/dialog_unused_pad_layers_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -18,68 +18,52 @@ DIALOG_UNUSED_PAD_LAYERS_BASE::DIALOG_UNUSED_PAD_LAYERS_BASE( wxWindow* parent, wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer6; - bSizer6 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer4; - bSizer4 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer5; - bSizer5 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer5->Add( 0, 0, 0, wxEXPAND, 5 ); + wxFlexGridSizer* fgSizerProps; + fgSizerProps = new wxFlexGridSizer( 0, 2, 0, 5 ); + fgSizerProps->SetFlexibleDirection( wxVERTICAL ); + fgSizerProps->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); wxString m_rbScopeChoices[] = { _("&Vias"), _("&Pads") }; int m_rbScopeNChoices = sizeof( m_rbScopeChoices ) / sizeof( wxString ); m_rbScope = new wxRadioBox( this, wxID_ANY, _("Scope"), wxDefaultPosition, wxDefaultSize, m_rbScopeNChoices, m_rbScopeChoices, 1, wxRA_SPECIFY_COLS ); m_rbScope->SetSelection( 0 ); - bSizer5->Add( m_rbScope, 0, wxALL|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + fgSizerProps->Add( m_rbScope, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - wxString m_rbActionChoices[] = { _("&Remove Unused"), _("Reset &Unused") }; + wxString m_rbActionChoices[] = { _("&Remove unused layers"), _("&Keep unused layers") }; int m_rbActionNChoices = sizeof( m_rbActionChoices ) / sizeof( wxString ); m_rbAction = new wxRadioBox( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, m_rbActionNChoices, m_rbActionChoices, 1, wxRA_SPECIFY_COLS ); m_rbAction->SetSelection( 0 ); - bSizer5->Add( m_rbAction, 0, wxALL|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - bSizer5->Add( 0, 0, 0, wxEXPAND, 5 ); - - - bSizer4->Add( bSizer5, 2, 0, 5 ); + fgSizerProps->Add( m_rbAction, 1, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); m_cbSelectedOnly = new wxCheckBox( this, wxID_ANY, _("&Selection only"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_cbSelectedOnly, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + fgSizerProps->Add( m_cbSelectedOnly, 0, wxEXPAND|wxLEFT, 10 ); - m_cbPreservePads = new wxCheckBox( this, wxID_ANY, _("&Keep pads at first and last layers"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_cbPreservePads, 0, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + m_cbPreservePads = new wxCheckBox( this, wxID_ANY, _("Keep &outside layers"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizerProps->Add( m_cbPreservePads, 0, wxEXPAND|wxLEFT, 10 ); - bSizer6->Add( bSizer4, 1, wxEXPAND, 0 ); + bSizer2->Add( fgSizerProps, 0, wxEXPAND|wxALL, 5 ); + + wxBoxSizer* bSizerPreview; + bSizerPreview = new wxBoxSizer( wxVERTICAL ); - bSizer2->Add( bSizer6, 4, wxEXPAND, 5 ); - - m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer2->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); - - wxBoxSizer* bSizer3; - bSizer3 = new wxBoxSizer( wxVERTICAL ); - - - bSizer3->Add( 0, 0, 0, wxEXPAND, 5 ); + bSizerPreview->Add( 0, 0, 0, wxEXPAND, 5 ); m_image = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer3->Add( m_image, 0, wxALL, 10 ); + bSizerPreview->Add( m_image, 0, wxTOP|wxRIGHT|wxLEFT, 10 ); - bSizer3->Add( 0, 0, 0, wxEXPAND, 5 ); + bSizerPreview->Add( 0, 0, 0, wxEXPAND, 5 ); - bSizer2->Add( bSizer3, 2, wxEXPAND|wxLEFT|wxRIGHT, 5 ); + bSizer2->Add( bSizerPreview, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - m_MainSizer->Add( bSizer2, 6, wxEXPAND, 5 ); + m_MainSizer->Add( bSizer2, 6, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + m_MainSizer->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_StdButtons = new wxStdDialogButtonSizer(); m_StdButtonsOK = new wxButton( this, wxID_OK ); @@ -98,7 +82,6 @@ DIALOG_UNUSED_PAD_LAYERS_BASE::DIALOG_UNUSED_PAD_LAYERS_BASE( wxWindow* parent, this->Centre( wxBOTH ); // Connect Events - m_rbScope->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_UNUSED_PAD_LAYERS_BASE::onScopeChange ), NULL, this ); m_rbAction->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_UNUSED_PAD_LAYERS_BASE::syncImages ), NULL, this ); m_cbPreservePads->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UNUSED_PAD_LAYERS_BASE::syncImages ), NULL, this ); } @@ -106,7 +89,6 @@ DIALOG_UNUSED_PAD_LAYERS_BASE::DIALOG_UNUSED_PAD_LAYERS_BASE( wxWindow* parent, DIALOG_UNUSED_PAD_LAYERS_BASE::~DIALOG_UNUSED_PAD_LAYERS_BASE() { // Disconnect Events - m_rbScope->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_UNUSED_PAD_LAYERS_BASE::onScopeChange ), NULL, this ); m_rbAction->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_UNUSED_PAD_LAYERS_BASE::syncImages ), NULL, this ); m_cbPreservePads->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_UNUSED_PAD_LAYERS_BASE::syncImages ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_unused_pad_layers_base.h b/pcbnew/dialogs/dialog_unused_pad_layers_base.h index ad57b62692..0b948edd2d 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers_base.h +++ b/pcbnew/dialogs/dialog_unused_pad_layers_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Nov 1 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -17,13 +17,13 @@ #include #include #include -#include #include -#include +#include #include #include #include #include +#include #include #include @@ -43,20 +43,19 @@ class DIALOG_UNUSED_PAD_LAYERS_BASE : public DIALOG_SHIM wxRadioBox* m_rbAction; wxCheckBox* m_cbSelectedOnly; wxCheckBox* m_cbPreservePads; - wxStaticLine* m_staticline1; wxStaticBitmap* m_image; + wxStaticLine* m_staticline2; wxStdDialogButtonSizer* m_StdButtons; wxButton* m_StdButtonsOK; wxButton* m_StdButtonsCancel; // Virtual event handlers, overide them in your derived class - virtual void onScopeChange( wxCommandEvent& event ) { event.Skip(); } virtual void syncImages( wxCommandEvent& event ) { event.Skip(); } public: - DIALOG_UNUSED_PAD_LAYERS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Unused Pad Layers"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_UNUSED_PAD_LAYERS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Remove Unused Pads"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_UNUSED_PAD_LAYERS_BASE(); };