From 7e394119101ce1faef2063052548d9fd67f9c431 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 24 May 2023 08:54:16 -0700 Subject: [PATCH] Revert "Insta-prefs." This reverts commit 4c28070449ad10c21179a80f2a1ffd99c0cf5533. --- common/CMakeLists.txt | 1 - common/dialogs/panel_common_settings.cpp | 3 +- common/dialogs/panel_data_collection.cpp | 4 +- common/dialogs/panel_mouse_settings.cpp | 8 +- common/dialogs/panel_setup_netclasses.cpp | 15 +- common/dialogs/panel_setup_severities.cpp | 5 +- common/eda_base_frame.cpp | 92 +++++------ common/widgets/paged_dialog.cpp | 76 ++++----- common/widgets/wx_treebook.cpp | 101 ------------ .../panel_eeschema_display_options_base.cpp | 16 +- .../panel_eeschema_display_options_base.fbp | 16 +- include/dialogs/panel_common_settings.h | 6 +- include/dialogs/panel_data_collection.h | 5 +- include/dialogs/panel_mouse_settings.h | 5 +- include/dialogs/panel_setup_netclasses.h | 5 +- include/dialogs/panel_setup_severities.h | 5 +- include/widgets/paged_dialog.h | 19 +-- include/widgets/wx_treebook.h | 46 ------ .../panel_pl_editor_color_settings.cpp | 14 +- pcbnew/dialogs/dialog_board_setup.cpp | 144 ++++++------------ pcbnew/dialogs/dialog_board_setup.h | 23 +-- pcbnew/dialogs/panel_setup_constraints.cpp | 6 +- pcbnew/dialogs/panel_setup_constraints.h | 4 +- pcbnew/dialogs/panel_setup_formatting.cpp | 4 +- pcbnew/dialogs/panel_setup_formatting.h | 4 +- pcbnew/dialogs/panel_setup_mask_and_paste.cpp | 7 +- pcbnew/dialogs/panel_setup_mask_and_paste.h | 4 +- pcbnew/dialogs/panel_setup_rules.cpp | 11 +- pcbnew/dialogs/panel_setup_rules.h | 3 +- .../dialogs/panel_setup_text_and_graphics.cpp | 4 +- .../dialogs/panel_setup_text_and_graphics.h | 2 +- .../dialogs/panel_setup_tracks_and_vias.cpp | 10 +- pcbnew/dialogs/panel_setup_tracks_and_vias.h | 5 +- 33 files changed, 224 insertions(+), 449 deletions(-) delete mode 100644 common/widgets/wx_treebook.cpp delete mode 100644 include/widgets/wx_treebook.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index c7f3150bac..92bc9d840f 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -216,7 +216,6 @@ set( COMMON_WIDGET_SRCS widgets/wx_panel.cpp widgets/wx_progress_reporters.cpp widgets/wx_splitter_window.cpp - widgets/wx_treebook.cpp ) set( COMMON_DRAWING_SHEET_SRCS diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index 808b086443..0d76301d10 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -44,8 +44,9 @@ * Ugly as it all is, it does improve our usability on various platforms. */ -PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( wxWindow* aParent ) +PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aParent ) : PANEL_COMMON_SETTINGS_BASE( aParent ), + m_dialog( aDialog ), m_iconScaleLabel( nullptr ), m_iconScaleSlider( nullptr ), m_iconScaleAuto( nullptr ), diff --git a/common/dialogs/panel_data_collection.cpp b/common/dialogs/panel_data_collection.cpp index 5ffe069abd..65a7b880cd 100644 --- a/common/dialogs/panel_data_collection.cpp +++ b/common/dialogs/panel_data_collection.cpp @@ -37,8 +37,8 @@ #include -PANEL_DATA_COLLECTION::PANEL_DATA_COLLECTION( wxWindow* aParent ) : - PANEL_DATA_COLLECTION_BASE( aParent ) +PANEL_DATA_COLLECTION::PANEL_DATA_COLLECTION( PAGED_DIALOG* aDialog, wxWindow* aParent ) : + PANEL_DATA_COLLECTION_BASE( aParent ), m_dialog( aDialog ) { } diff --git a/common/dialogs/panel_mouse_settings.cpp b/common/dialogs/panel_mouse_settings.cpp index 165ce3c4e0..a610915e64 100644 --- a/common/dialogs/panel_mouse_settings.cpp +++ b/common/dialogs/panel_mouse_settings.cpp @@ -26,8 +26,9 @@ #include -PANEL_MOUSE_SETTINGS::PANEL_MOUSE_SETTINGS( wxWindow* aParent ) : +PANEL_MOUSE_SETTINGS::PANEL_MOUSE_SETTINGS( PAGED_DIALOG* aDialog, wxWindow* aParent ) : PANEL_MOUSE_SETTINGS_BASE( aParent ), + m_dialog( aDialog ), m_currentScrollMod( {} ) { #ifdef __WXOSX_MAC__ @@ -81,9 +82,8 @@ bool PANEL_MOUSE_SETTINGS::TransferDataFromWindow() if( !isScrollModSetValid( m_currentScrollMod ) ) { - PAGED_DIALOG::GetDialog( this )->SetError( _( "Only one action can be assigned to each " - "vertical scroll setting" ), - this, nullptr ); + m_dialog->SetError( _( "Only one action can be assigned to each vertical scroll setting" ), + this, nullptr ); return false; } diff --git a/common/dialogs/panel_setup_netclasses.cpp b/common/dialogs/panel_setup_netclasses.cpp index 765825ede5..4b347b804b 100644 --- a/common/dialogs/panel_setup_netclasses.cpp +++ b/common/dialogs/panel_setup_netclasses.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -69,12 +70,13 @@ std::vector g_lineStyleIcons; wxArrayString g_lineStyleNames; -PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRAW_FRAME* aFrame, +PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame, std::shared_ptr aNetSettings, const std::set& aNetNames, bool aIsEEschema ) : - PANEL_SETUP_NETCLASSES_BASE( aParentWindow ), + PANEL_SETUP_NETCLASSES_BASE( aParent->GetTreebook() ), m_frame( aFrame ), + m_parent( aParent ), m_isEEschema( aIsEEschema ), m_netSettings( aNetSettings ), m_netNames( aNetNames ), @@ -156,8 +158,8 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA } wxGridCellAttr* attr = new wxGridCellAttr; - attr->SetRenderer( new GRID_CELL_COLOR_RENDERER( PAGED_DIALOG::GetDialog( this ) ) ); - attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( PAGED_DIALOG::GetDialog( this ), m_netclassGrid ) ); + attr->SetRenderer( new GRID_CELL_COLOR_RENDERER( aParent ) ); + attr->SetEditor( new GRID_CELL_COLOR_SELECTOR( aParent, m_netclassGrid ) ); m_netclassGrid->SetColAttr( GRID_SCHEMATIC_COLOR, attr ); attr = new wxGridCellAttr; @@ -426,7 +428,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa if( tmp.IsEmpty() ) { wxString msg = _( "Netclass must have a name." ); - PAGED_DIALOG::GetDialog( this )->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME ); + m_parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME ); return false; } @@ -435,8 +437,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa if( ii != aRow && m_netclassGrid->GetCellValue( ii, GRID_NAME ).CmpNoCase( tmp ) == 0 ) { wxString msg = _( "Netclass name already in use." ); - PAGED_DIALOG::GetDialog( this )->SetError( msg, this, m_netclassGrid, - focusFirst ? aRow : ii, GRID_NAME ); + m_parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME ); return false; } } diff --git a/common/dialogs/panel_setup_severities.cpp b/common/dialogs/panel_setup_severities.cpp index 6bdc4bd6e5..bfd5446187 100644 --- a/common/dialogs/panel_setup_severities.cpp +++ b/common/dialogs/panel_setup_severities.cpp @@ -28,13 +28,14 @@ #include #include #include +#include -PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( wxWindow* aParentWindow, +PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent, std::vector> aItems, std::map& aSeverities, RC_ITEM* aPinMapSpecialCase ) : - wxPanel( aParentWindow ), + wxPanel( aParent->GetTreebook() ), m_severities( aSeverities ), m_items( aItems ), m_pinMapSpecialCase( aPinMapSpecialCase ) diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 6201bed990..f27d046413 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -56,12 +56,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include @@ -1011,42 +1011,23 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent PAGED_DIALOG dlg( this, _( "Preferences" ), true ); dlg.SetEvtHandlerEnabled( false ); + wxTreebook* book = dlg.GetTreebook(); - WX_TREEBOOK* book = dlg.GetTreebook(); PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false ); KIFACE* kiface = nullptr; std::vector expand; Kiway().GetActions( hotkeysPanel->ActionsList() ); - book->AddLazyPage( - []( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_COMMON_SETTINGS( aParent ); - }, - _( "Common" ) ); - - book->AddLazyPage( - []( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_MOUSE_SETTINGS( aParent ); - }, _( "Mouse and Touchpad" ) ); - + book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) ); + book->AddPage( new PANEL_MOUSE_SETTINGS( &dlg, book ), _( "Mouse and Touchpad" ) ); book->AddPage( hotkeysPanel, _( "Hotkeys" ) ); #ifdef KICAD_USE_SENTRY - book->AddLazyPage( - []( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_DATA_COLLECTION( aParent ); - }, _( "Data Collection" ) ); + book->AddPage( new PANEL_DATA_COLLECTION( &dlg, book ), _( "Data Collection" ) ); #endif -#define LAZY_CTOR( key ) \ - [=]( wxWindow* aParent ) \ - { \ - return kiface->CreateKiWindow( aParent, key, &Kiway() ); \ - } +#define CREATE_PANEL( key ) kiface->CreateKiWindow( book, key, &Kiway() ) // If a dll is not loaded, the loader will show an error message. @@ -1060,19 +1041,20 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "Symbol Editor" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SYM_DISP_OPTIONS ), _( "Display Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SYM_EDIT_OPTIONS ), _( "Editing Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SYM_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SYM_DISP_OPTIONS ), _( "Display Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SYM_EDIT_OPTIONS ), _( "Editing Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SYM_COLORS ), _( "Colors" ) ); if( GetFrameType() == FRAME_SCH ) expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "Schematic Editor" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SCH_DISP_OPTIONS ), _( "Display Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SCH_EDIT_OPTIONS ), _( "Editing Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SCH_ANNO_OPTIONS ), _( "Annotation Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SCH_COLORS ), _( "Colors" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_SCH_FIELD_NAME_TEMPLATES ), _( "Field Name Templates" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SCH_DISP_OPTIONS ), _( "Display Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SCH_EDIT_OPTIONS ), _( "Editing Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SCH_ANNO_OPTIONS ), _( "Annotation Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SCH_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_SCH_FIELD_NAME_TEMPLATES ), + _( "Field Name Templates" ) ); } catch( ... ) { @@ -1088,29 +1070,29 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "Footprint Editor" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_FP_DISPLAY_OPTIONS ), _( "Display Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_FP_EDIT_OPTIONS ), _( "Editing Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_FP_COLORS ), _( "Colors" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_FP_DEFAULT_VALUES ), _( "Default Values" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_FP_DISPLAY_OPTIONS ), _( "Display Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_FP_EDIT_OPTIONS ), _( "Editing Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_FP_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_FP_DEFAULT_VALUES ), _( "Default Values" ) ); if( GetFrameType() == FRAME_PCB_EDITOR ) expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "PCB Editor" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_PCB_DISPLAY_OPTIONS ), _( "Display Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_PCB_EDIT_OPTIONS ), _( "Editing Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_PCB_COLORS ), _( "Colors" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_PCB_ACTION_PLUGINS ), _( "Action Plugins" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_PCB_ORIGINS_AXES ), _( "Origins & Axes" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_PCB_DISPLAY_OPTIONS ), _( "Display Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_PCB_EDIT_OPTIONS ), _( "Editing Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_PCB_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_PCB_ACTION_PLUGINS ), _( "Action Plugins" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_PCB_ORIGINS_AXES ), _( "Origins & Axes" ) ); if( GetFrameType() == FRAME_PCB_DISPLAY3D ) expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "3D Viewer" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_DISPLAY_OPTIONS ), _( "General" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_OPENGL ), _( "Realtime Renderer" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_RAYTRACING ), _( "Raytracing Renderer" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_3DV_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_3DV_DISPLAY_OPTIONS ), _( "General" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_3DV_OPENGL ), _( "Realtime Renderer" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_3DV_RAYTRACING ), _( "Raytracing Renderer" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_3DV_COLORS ), _( "Colors" ) ); } catch( ... ) { @@ -1126,9 +1108,9 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "Gerber Viewer" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_DISPLAY_OPTIONS ), _( "Display Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_COLORS ), _( "Colors" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_GBR_EXCELLON_OPTIONS ), _( "Excellon Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_GBR_DISPLAY_OPTIONS ), _( "Display Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_GBR_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_GBR_EXCELLON_OPTIONS ), _( "Excellon Options" ) ); } catch( ... ) { @@ -1143,14 +1125,10 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent expand.push_back( book->GetPageCount() ); book->AddPage( new wxPanel( book ), _( "Drawing Sheet Editor" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_DS_DISPLAY_OPTIONS ), _( "Display Options" ) ); - book->AddLazySubPage( LAZY_CTOR( PANEL_DS_COLORS ), _( "Colors" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_DS_DISPLAY_OPTIONS ), _( "Display Options" ) ); + book->AddSubPage( CREATE_PANEL( PANEL_DS_COLORS ), _( "Colors" ) ); - book->AddLazyPage( - []( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_PCM_SETTINGS( aParent ); - }, _( "Plugin and Content Manager" ) ); + book->AddPage( new PANEL_PCM_SETTINGS( book ), _( "Plugin and Content Manager" ) ); } catch( ... ) { @@ -1178,7 +1156,7 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent dlg.Kiway().CommonSettingsChanged( false, false ); } -#undef LAZY_CTOR +#undef CREATE_PANEL } diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp index ceb78ff91e..6fc5ede601 100644 --- a/common/widgets/paged_dialog.cpp +++ b/common/widgets/paged_dialog.cpp @@ -19,20 +19,19 @@ #include #include -#include -#include -#include -#include - #include #include #include #include #include -#include + +#include +#include #include #include +#include "wx/listctrl.h" +#include "widgets/wx_panel.h" // Maps from dialogTitle <-> pageTitle for keeping track of last-selected pages. // This is not a simple page index because some dialogs have dynamic page sets. @@ -61,7 +60,7 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aSho wxBoxSizer* treebookSizer = new wxBoxSizer( wxVERTICAL ); treebookPanel->SetSizer( treebookSizer ); - m_treebook = new WX_TREEBOOK( treebookPanel, wxID_ANY ); + m_treebook = new wxTreebook( treebookPanel, wxID_ANY ); m_treebook->SetFont( KIUI::GetControlFont( this ) ); long treeCtrlFlags = m_treebook->GetTreeCtrl()->GetWindowStyleFlag(); @@ -270,20 +269,6 @@ bool PAGED_DIALOG::TransferDataFromWindow() } -PAGED_DIALOG* PAGED_DIALOG::GetDialog( wxWindow* aParent ) -{ - while( aParent ) - { - if( PAGED_DIALOG* parentDialog = dynamic_cast( aParent ) ) - return parentDialog; - - aParent = aParent->GetParent(); - } - - return nullptr; -} - - void PAGED_DIALOG::SetError( const wxString& aMessage, const wxString& aPageName, int aCtrlId, int aRow, int aCol ) { @@ -294,36 +279,39 @@ void PAGED_DIALOG::SetError( const wxString& aMessage, const wxString& aPageName void PAGED_DIALOG::SetError( const wxString& aMessage, wxWindow* aPage, wxWindow* aCtrl, int aRow, int aCol ) { - m_infoBar->ShowMessageFor( aMessage, 10000, wxICON_WARNING ); - - if( wxTextCtrl* textCtrl = dynamic_cast( aCtrl ) ) + if( aCtrl ) { - textCtrl->SetSelection( -1, -1 ); - textCtrl->SetFocus(); - return; - } + m_infoBar->ShowMessageFor( aMessage, 10000, wxICON_WARNING ); - if( wxStyledTextCtrl* scintilla = dynamic_cast( aCtrl ) ) - { - if( aRow > 0 ) + if( wxTextCtrl* textCtrl = dynamic_cast( aCtrl ) ) { - int pos = scintilla->PositionFromLine( aRow - 1 ) + ( aCol - 1 ); - scintilla->GotoPos( pos ); + textCtrl->SetSelection( -1, -1 ); + textCtrl->SetFocus(); + return; } - scintilla->SetFocus(); - return; - } + if( wxStyledTextCtrl* scintilla = dynamic_cast( aCtrl ) ) + { + if( aRow > 0 ) + { + int pos = scintilla->PositionFromLine( aRow - 1 ) + ( aCol - 1 ); + scintilla->GotoPos( pos ); + } - if( wxGrid* grid = dynamic_cast( aCtrl ) ) - { - grid->SetFocus(); - grid->MakeCellVisible( aRow, aCol ); - grid->SetGridCursor( aRow, aCol ); + scintilla->SetFocus(); + return; + } - grid->EnableCellEditControl( true ); - grid->ShowCellEditControl(); - return; + if( wxGrid* grid = dynamic_cast( aCtrl ) ) + { + grid->SetFocus(); + grid->MakeCellVisible( aRow, aCol ); + grid->SetGridCursor( aRow, aCol ); + + grid->EnableCellEditControl( true ); + grid->ShowCellEditControl(); + return; + } } } diff --git a/common/widgets/wx_treebook.cpp b/common/widgets/wx_treebook.cpp deleted file mode 100644 index bc4f32ba05..0000000000 --- a/common/widgets/wx_treebook.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include -#include - - -class LAZY_PAGE : public wxPanel -{ -public: - LAZY_PAGE( wxWindow* aParent, std::function aLazyCtor ) : - wxPanel( aParent, wxID_ANY ), - m_lazyCtor( std::move( aLazyCtor ) ), - m_mainSizer( nullptr ), - m_contents( nullptr ) - { - m_mainSizer = new wxBoxSizer( wxVERTICAL ); - SetSizer( m_mainSizer ); - } - - wxWindow* Resolve() - { - if( !m_contents ) - { - m_contents = m_lazyCtor( this ); - m_mainSizer->Add( m_contents, 1, wxEXPAND, 5 ); - m_mainSizer->Layout(); - - m_contents->TransferDataToWindow(); - } - - return m_contents; - } - - bool Show( bool show ) override - { - if( show ) - Resolve(); - - return wxPanel::Show( show ); - } - -private: - std::function m_lazyCtor; - - wxSizer* m_mainSizer; - wxWindow* m_contents; -}; - - -WX_TREEBOOK::WX_TREEBOOK( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, - long style, const wxString& name ) : - wxTreebook( parent, id, pos, size, style, name ) -{ -} - - -bool WX_TREEBOOK::AddLazyPage( std::function aLazyCtor, - const wxString& text, bool bSelect, int imageId ) -{ - return AddPage( new LAZY_PAGE( this, std::move( aLazyCtor ) ), text, bSelect, imageId ); -} - - -bool WX_TREEBOOK::AddLazySubPage( std::function aLazyCtor, - const wxString& text, bool bSelect, int imageId ) -{ - return AddSubPage( new LAZY_PAGE( this, std::move( aLazyCtor ) ), text, bSelect, imageId ); -} - - -wxWindow* WX_TREEBOOK::ResolvePage( int aPage ) -{ - wxWindow* page = GetPage( aPage ); - - if( LAZY_PAGE* lazyPage = dynamic_cast( page ) ) - return lazyPage->Resolve(); - - return page; -} diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.cpp b/eeschema/dialogs/panel_eeschema_display_options_base.cpp index d1c18c0ebf..5640ea46ea 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.cpp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.cpp @@ -29,7 +29,7 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind bRightColumn->Add( m_appearanceLabel, 0, wxTOP|wxRIGHT|wxLEFT, 13 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bRightColumn->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 7 ); + bRightColumn->Add( m_staticline1, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bAppearanceSizer; bAppearanceSizer = new wxBoxSizer( wxVERTICAL ); @@ -48,7 +48,7 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind bSizer4->Add( m_defaultFontCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bAppearanceSizer->Add( bSizer4, 1, wxEXPAND, 5 ); + bAppearanceSizer->Add( bSizer4, 1, wxEXPAND|wxTOP, 5 ); m_checkShowHiddenPins = new wxCheckBox( this, wxID_ANY, _("S&how hidden pins"), wxDefaultPosition, wxDefaultSize, 0 ); bAppearanceSizer->Add( m_checkShowHiddenPins, 0, wxEXPAND|wxALL, 5 ); @@ -73,20 +73,20 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind bRightColumn->Add( bAppearanceSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); - bRightColumn->Add( 0, 7, 0, wxEXPAND, 5 ); + bRightColumn->Add( 0, 15, 0, wxEXPAND, 5 ); m_selectionLabel = new wxStaticText( this, wxID_ANY, _("Selection && Highlighting"), wxDefaultPosition, wxDefaultSize, 0 ); m_selectionLabel->Wrap( -1 ); bRightColumn->Add( m_selectionLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bRightColumn->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 7 ); + bRightColumn->Add( m_staticline2, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bSelectionSizer; bSelectionSizer = new wxBoxSizer( wxVERTICAL ); m_checkSelDrawChildItems = new wxCheckBox( this, wxID_ANY, _("Draw selected child items"), wxDefaultPosition, wxDefaultSize, 0 ); - bSelectionSizer->Add( m_checkSelDrawChildItems, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSelectionSizer->Add( m_checkSelDrawChildItems, 0, wxEXPAND|wxALL, 5 ); m_checkSelFillShapes = new wxCheckBox( this, wxID_ANY, _("Fill selected shapes"), wxDefaultPosition, wxDefaultSize, 0 ); bSelectionSizer->Add( m_checkSelFillShapes, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -124,14 +124,14 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind bRightColumn->Add( bSelectionSizer, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - bRightColumn->Add( 0, 7, 0, wxEXPAND, 5 ); + bRightColumn->Add( 0, 15, 0, wxEXPAND, 5 ); m_crossprobeLabel = new wxStaticText( this, wxID_ANY, _("Cross-probing"), wxDefaultPosition, wxDefaultSize, 0 ); m_crossprobeLabel->Wrap( -1 ); bRightColumn->Add( m_crossprobeLabel, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 13 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bRightColumn->Add( m_staticline3, 0, wxEXPAND|wxBOTTOM, 7 ); + bRightColumn->Add( m_staticline3, 0, wxEXPAND|wxBOTTOM, 5 ); wxBoxSizer* bCrossProbingSizer; bCrossProbingSizer = new wxBoxSizer( wxVERTICAL ); @@ -140,7 +140,7 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind m_checkCrossProbeOnSelection->SetValue(true); m_checkCrossProbeOnSelection->SetToolTip( _("Highlight symbols corresponding to selected footprints") ); - bCrossProbingSizer->Add( m_checkCrossProbeOnSelection, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bCrossProbingSizer->Add( m_checkCrossProbeOnSelection, 0, wxALL, 5 ); m_checkCrossProbeCenter = new wxCheckBox( this, wxID_ANY, _("Center view on cross-probed items"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkCrossProbeCenter->SetValue(true); diff --git a/eeschema/dialogs/panel_eeschema_display_options_base.fbp b/eeschema/dialogs/panel_eeschema_display_options_base.fbp index 7555023119..48b269b48e 100644 --- a/eeschema/dialogs/panel_eeschema_display_options_base.fbp +++ b/eeschema/dialogs/panel_eeschema_display_options_base.fbp @@ -139,7 +139,7 @@ - 7 + 5 wxEXPAND|wxBOTTOM 0 @@ -207,7 +207,7 @@ none 5 - wxEXPAND + wxEXPAND|wxTOP 1 @@ -732,7 +732,7 @@ wxEXPAND 0 - 7 + 15 protected 0 @@ -799,7 +799,7 @@ - 7 + 5 wxEXPAND|wxBOTTOM 0 @@ -867,7 +867,7 @@ none 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + wxEXPAND|wxALL 0 1 @@ -1343,7 +1343,7 @@ wxEXPAND 0 - 7 + 15 protected 0 @@ -1410,7 +1410,7 @@ - 7 + 5 wxEXPAND|wxBOTTOM 0 @@ -1478,7 +1478,7 @@ none 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxALL 0 1 diff --git a/include/dialogs/panel_common_settings.h b/include/dialogs/panel_common_settings.h index 094dfe7fbc..ebf741f82e 100644 --- a/include/dialogs/panel_common_settings.h +++ b/include/dialogs/panel_common_settings.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -35,7 +35,7 @@ class STEPPED_SLIDER; class PANEL_COMMON_SETTINGS : public PANEL_COMMON_SETTINGS_BASE { public: - PANEL_COMMON_SETTINGS( wxWindow* aParent ); + PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aParent ); ~PANEL_COMMON_SETTINGS() override; void ResetPanel() override; @@ -66,6 +66,8 @@ private: void setPdfViewerPathState(); protected: + DIALOG_SHIM* m_dialog; + wxStaticText* m_iconScaleLabel; STEPPED_SLIDER* m_iconScaleSlider; wxCheckBox* m_iconScaleAuto; diff --git a/include/dialogs/panel_data_collection.h b/include/dialogs/panel_data_collection.h index 21e986f6a7..39d9dc1a61 100644 --- a/include/dialogs/panel_data_collection.h +++ b/include/dialogs/panel_data_collection.h @@ -34,7 +34,7 @@ class PAGED_DIALOG; class PANEL_DATA_COLLECTION : public PANEL_DATA_COLLECTION_BASE { public: - PANEL_DATA_COLLECTION( wxWindow* aParent ); + PANEL_DATA_COLLECTION( PAGED_DIALOG* aDialog, wxWindow* aParent ); void ResetPanel() override; @@ -46,6 +46,9 @@ protected: private: void applySettingsToPanel(); + +protected: + PAGED_DIALOG* m_dialog; }; #endif //PANEL_DATA_COLLECTION_H diff --git a/include/dialogs/panel_mouse_settings.h b/include/dialogs/panel_mouse_settings.h index 4352f94231..0617599936 100644 --- a/include/dialogs/panel_mouse_settings.h +++ b/include/dialogs/panel_mouse_settings.h @@ -39,7 +39,7 @@ struct SCROLL_MOD_SET class PANEL_MOUSE_SETTINGS : public PANEL_MOUSE_SETTINGS_BASE { public: - PANEL_MOUSE_SETTINGS( wxWindow* aParent ); + PANEL_MOUSE_SETTINGS( PAGED_DIALOG* aDialog, wxWindow* aParent ); ~PANEL_MOUSE_SETTINGS(); @@ -63,6 +63,9 @@ private: bool isScrollModSetValid( const SCROLL_MOD_SET& aSet ); +protected: + PAGED_DIALOG* m_dialog; + private: SCROLL_MOD_SET m_currentScrollMod; }; diff --git a/include/dialogs/panel_setup_netclasses.h b/include/dialogs/panel_setup_netclasses.h index 44daaa11ab..7652af08d8 100644 --- a/include/dialogs/panel_setup_netclasses.h +++ b/include/dialogs/panel_setup_netclasses.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -35,7 +35,7 @@ class NET_SETTINGS; class PANEL_SETUP_NETCLASSES : public PANEL_SETUP_NETCLASSES_BASE { public: - PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRAW_FRAME* aFrame, + PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame, std::shared_ptr aSettings, const std::set& aNetNames, bool isEEschema ); ~PANEL_SETUP_NETCLASSES( ) override; @@ -69,6 +69,7 @@ private: private: EDA_DRAW_FRAME* m_frame; + PAGED_DIALOG* m_parent; bool m_isEEschema; std::shared_ptr m_netSettings; std::set m_netNames; diff --git a/include/dialogs/panel_setup_severities.h b/include/dialogs/panel_setup_severities.h index acf0435eec..698af0df63 100644 --- a/include/dialogs/panel_setup_severities.h +++ b/include/dialogs/panel_setup_severities.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -50,11 +50,12 @@ private: public: /** * Creates the severities setup panel + * @param aParent is the dialog parent * @param aItems is a list of error types that can have a severity. Must have one or more! * @param aSeverities is a map of error code to severity * @param aPinMapSpecialCase is used to special-case the ERCE_PIN_TO_PIN_WARNING */ - PANEL_SETUP_SEVERITIES( wxWindow* aParentWindow, + PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent, std::vector> aItems, std::map& aSeverities, RC_ITEM* aPinMapSpecialCase = nullptr ); diff --git a/include/widgets/paged_dialog.h b/include/widgets/paged_dialog.h index ecdcb786de..80aa4ae5f8 100644 --- a/include/widgets/paged_dialog.h +++ b/include/widgets/paged_dialog.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -22,11 +22,10 @@ #define PAGED_DIALOG_H #include -#include class WX_INFOBAR; -class WX_TREEBOOK; +class wxTreebook; class PAGED_DIALOG : public DIALOG_SHIM { @@ -35,7 +34,7 @@ public: const wxString& aAuxiliaryAction = wxEmptyString ); ~PAGED_DIALOG() override; - WX_TREEBOOK* GetTreebook() { return m_treebook; } + wxTreebook* GetTreebook() { return m_treebook; } void SetInitialPage( const wxString& aPage, const wxString& aParentPage = wxEmptyString ); @@ -49,8 +48,6 @@ public: void UpdateResetButton( int aPage ); - static PAGED_DIALOG* GetDialog( wxWindow* aWindow ); - protected: void finishInitialization(); @@ -63,11 +60,11 @@ protected: virtual void onPageChanging( wxBookCtrlEvent& aEvent ); virtual void onCharHook( wxKeyEvent& aEvent ); - WX_TREEBOOK* m_treebook; - wxButton* m_auxiliaryButton; - wxButton* m_resetButton; - wxButton* m_cancelButton; - WX_INFOBAR* m_infoBar; + wxTreebook* m_treebook; + wxButton* m_auxiliaryButton; + wxButton* m_resetButton; + wxButton* m_cancelButton; + WX_INFOBAR* m_infoBar; private: wxString m_title; diff --git a/include/widgets/wx_treebook.h b/include/widgets/wx_treebook.h deleted file mode 100644 index 7d353888eb..0000000000 --- a/include/widgets/wx_treebook.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef WX_TREEBOOK_H -#define WX_TREEBOOK_H - -#include - -class WX_TREEBOOK : public wxTreebook -{ -public: - WX_TREEBOOK( wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = wxBK_DEFAULT, - const wxString& name = wxEmptyString ); - - bool AddLazyPage( std::function aLazyCtor, - const wxString& text, bool bSelect = false, int imageId = NO_IMAGE ); - - bool AddLazySubPage( std::function aLazyCtor, - const wxString& text, bool bSelect = false, int imageId = NO_IMAGE ); - - wxWindow* ResolvePage( int aPage ); -}; - - -#endif // WX_TREEBOOK_H diff --git a/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp b/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp index f6ed4bbf7a..e46852eaa7 100644 --- a/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp +++ b/pagelayout_editor/dialogs/panel_pl_editor_color_settings.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -62,14 +62,12 @@ bool PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataToWindow() bool PANEL_PL_EDITOR_COLOR_SETTINGS::TransferDataFromWindow() { - int sel = m_themes->GetSelection(); + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); + PL_EDITOR_SETTINGS* cfg = mgr.GetAppSettings(); + int sel = m_themes->GetSelection(); + COLOR_SETTINGS* colors = static_cast( m_themes->GetClientData( sel ) ); - if( sel >= 0 ) - { - SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); - COLOR_SETTINGS* colors = static_cast( m_themes->GetClientData( sel ) ); - mgr.GetAppSettings()->m_ColorTheme = colors->GetFilename(); - } + cfg->m_ColorTheme = colors->GetFilename(); return true; } diff --git a/pcbnew/dialogs/dialog_board_setup.cpp b/pcbnew/dialogs/dialog_board_setup.cpp index f7aaacc754..14fcbd6415 100644 --- a/pcbnew/dialogs/dialog_board_setup.cpp +++ b/pcbnew/dialogs/dialog_board_setup.cpp @@ -38,12 +38,12 @@ #include #include #include -#include #include #include "dialog_board_setup.h" #include "panel_setup_rules.h" +#include std::mutex DIALOG_BOARD_SETUP::g_Mutex; @@ -54,12 +54,27 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : m_frame( aFrame ) { SetEvtHandlerEnabled( false ); + PROJECT_FILE& project = aFrame->Prj().GetProjectFile(); + BOARD* board = aFrame->GetBoard(); + BOARD_DESIGN_SETTINGS& bds = board->GetDesignSettings(); - m_layers = new PANEL_SETUP_LAYERS( this, m_frame ); - m_physicalStackup = new PANEL_SETUP_BOARD_STACKUP( this, m_frame, m_layers ); - m_boardFinish = new PANEL_SETUP_BOARD_FINISH( this, m_frame ); + m_layers = new PANEL_SETUP_LAYERS( this, aFrame ); + m_textAndGraphics = new PANEL_SETUP_TEXT_AND_GRAPHICS( this, aFrame ); + m_formatting = new PANEL_SETUP_FORMATTING( this, aFrame ); + m_constraints = new PANEL_SETUP_CONSTRAINTS( this, aFrame ); + m_rules = new PANEL_SETUP_RULES( this, aFrame ); + m_tracksAndVias = new PANEL_SETUP_TRACKS_AND_VIAS( this, aFrame ); + m_maskAndPaste = new PANEL_SETUP_MASK_AND_PASTE( this, aFrame ); + m_physicalStackup = new PANEL_SETUP_BOARD_STACKUP( this, aFrame, m_layers ); + m_boardFinish = new PANEL_SETUP_BOARD_FINISH( this, aFrame ); - m_currentPage = -1; + m_severities = new PANEL_SETUP_SEVERITIES( this, DRC_ITEM::GetItemsWithSeverities(), + bds.m_DRCSeverities ); + + m_netclasses = new PANEL_SETUP_NETCLASSES( this, aFrame, project.NetSettings(), + board->GetNetClassAssignmentCandidates(), false ); + + m_textVars = new PANEL_TEXT_VARIABLES( m_treebook, &Prj() ); /* * WARNING: If you change page names you MUST update calls to ShowBoardSetupDialog(). @@ -67,6 +82,8 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Board Stackup" ) ); + m_currentPage = -1; + /* * 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 @@ -74,81 +91,27 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : * that the order of these pages should be changed. */ m_treebook->AddSubPage( m_layers, _( "Board Editor Layers" ) ); + m_layerSetupPage = 1; - m_physicalStackupPage = m_treebook->GetPageCount(); m_treebook->AddSubPage( m_physicalStackup, _( "Physical Stackup" ) ); - m_treebook->AddSubPage( m_boardFinish, _( "Board Finish" ) ); - m_maskAndPagePage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_MASK_AND_PASTE( aParent, m_frame ); - }, _( "Solder Mask/Paste" ) ); + // 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 + + m_treebook->AddSubPage( m_boardFinish, _( "Board Finish" ) ); + m_treebook->AddSubPage( m_maskAndPaste, _( "Solder Mask/Paste" ) ); m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Text & Graphics" ) ); - - m_textAndGraphicsPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_TEXT_AND_GRAPHICS( aParent, m_frame ); - }, _( "Defaults" ) ); - - m_formattingPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_FORMATTING( aParent, m_frame ); - }, _( "Formatting" ) ); - - m_textVarsPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_TEXT_VARIABLES( aParent, &Prj() ); - }, _( "Text Variables" ) ); + m_treebook->AddSubPage( m_textAndGraphics, _( "Defaults" ) ); + m_treebook->AddSubPage( m_formatting, _( "Formatting" ) ); + m_treebook->AddSubPage( m_textVars, _( "Text Variables" ) ); m_treebook->AddPage( new wxPanel( GetTreebook() ), _( "Design Rules" ) ); - - m_constraintsPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_CONSTRAINTS( aParent, m_frame ); - }, _( "Constraints" ) ); - - m_tracksAndViasPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_TRACKS_AND_VIAS( aParent, m_frame ); - }, _( "Pre-defined Sizes" ) ); - - m_netclassesPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_NETCLASSES( aParent, m_frame, - m_frame->Prj().GetProjectFile().NetSettings(), - m_frame->GetBoard()->GetNetClassAssignmentCandidates(), - false ); - }, _( "Net Classes" ) ); - - m_rulesPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_RULES( aParent, m_frame ); - }, _( "Custom Rules" ) ); - - m_severitiesPage = m_treebook->GetPageCount(); - m_treebook->AddLazySubPage( - [this]( wxWindow* aParent ) -> wxWindow* - { - return new PANEL_SETUP_SEVERITIES( aParent, DRC_ITEM::GetItemsWithSeverities(), - m_frame->GetBoard()->GetDesignSettings().m_DRCSeverities ); - }, _( "Violation Severity" ) ); + m_treebook->AddSubPage( m_constraints, _( "Constraints" ) ); + m_treebook->AddSubPage( m_tracksAndVias, _( "Pre-defined Sizes" ) ); + m_treebook->AddSubPage( m_netclasses, _( "Net Classes" ) ); + m_treebook->AddSubPage( m_rules, _( "Custom Rules" ) ); + m_treebook->AddSubPage( m_severities, _( "Violation Severity" ) ); for( size_t i = 0; i < m_treebook->GetPageCount(); ++i ) m_treebook->ExpandNode( i ); @@ -282,46 +245,25 @@ void DIALOG_BOARD_SETUP::onAuxiliaryAction( wxCommandEvent& aEvent ) } if( importDlg.m_TextAndGraphicsOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_textAndGraphicsPage ) ) - ->ImportSettingsFrom( otherBoard ); - } + m_textAndGraphics->ImportSettingsFrom( otherBoard ); if( importDlg.m_FormattingOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_formattingPage ) ) - ->ImportSettingsFrom( otherBoard ); - } + m_formatting->ImportSettingsFrom( otherBoard ); if( importDlg.m_ConstraintsOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_constraintsPage ) ) - ->ImportSettingsFrom( otherBoard ); - } + m_constraints->ImportSettingsFrom( otherBoard ); if( importDlg.m_NetclassesOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_netclassesPage ) ) - ->ImportSettingsFrom( otherPrj->GetProjectFile().m_NetSettings ); - } + m_netclasses->ImportSettingsFrom( otherPrj->GetProjectFile().m_NetSettings ); if( importDlg.m_TracksAndViasOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_tracksAndViasPage ) ) - ->ImportSettingsFrom( otherBoard ); - } + m_tracksAndVias->ImportSettingsFrom( otherBoard ); if( importDlg.m_MaskAndPasteOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_maskAndPagePage ) ) - ->ImportSettingsFrom( otherBoard ); - } + m_maskAndPaste->ImportSettingsFrom( otherBoard ); if( importDlg.m_SeveritiesOpt->GetValue() ) - { - static_cast( m_treebook->ResolvePage( m_severitiesPage ) ) - ->ImportSettingsFrom( otherBoard->GetDesignSettings().m_DRCSeverities ); - } + m_severities->ImportSettingsFrom( otherBoard->GetDesignSettings().m_DRCSeverities ); if( otherPrj != &m_frame->Prj() ) otherBoard->ClearProject(); diff --git a/pcbnew/dialogs/dialog_board_setup.h b/pcbnew/dialogs/dialog_board_setup.h index ab0829b6bf..934125972c 100644 --- a/pcbnew/dialogs/dialog_board_setup.h +++ b/pcbnew/dialogs/dialog_board_setup.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2017-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -52,25 +52,26 @@ protected: PCB_EDIT_FRAME* m_frame; + PANEL_SETUP_CONSTRAINTS* m_constraints; PANEL_SETUP_LAYERS* m_layers; + PANEL_SETUP_TEXT_AND_GRAPHICS* m_textAndGraphics; + PANEL_SETUP_FORMATTING* m_formatting; + PANEL_SETUP_NETCLASSES* m_netclasses; + PANEL_SETUP_RULES* m_rules; + PANEL_SETUP_TRACKS_AND_VIAS* m_tracksAndVias; + PANEL_SETUP_MASK_AND_PASTE* m_maskAndPaste; PANEL_SETUP_BOARD_STACKUP* m_physicalStackup; PANEL_SETUP_BOARD_FINISH* m_boardFinish; + PANEL_SETUP_SEVERITIES* m_severities; + PANEL_TEXT_VARIABLES* m_textVars; public: static std::mutex g_Mutex; // Mutex to prevent multiple windows opening private: int m_currentPage; // the current page index - int m_textAndGraphicsPage; - int m_constraintsPage; - int m_formattingPage; - int m_physicalStackupPage; - int m_tracksAndViasPage; - int m_netclassesPage; - int m_maskAndPagePage; - int m_rulesPage; - int m_severitiesPage; - int m_textVarsPage; + 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_constraints.cpp b/pcbnew/dialogs/panel_setup_constraints.cpp index 2db0f29235..9818c4c03c 100644 --- a/pcbnew/dialogs/panel_setup_constraints.cpp +++ b/pcbnew/dialogs/panel_setup_constraints.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -32,8 +32,8 @@ #include -PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) : - PANEL_SETUP_CONSTRAINTS_BASE( aParentWindow ), +PANEL_SETUP_CONSTRAINTS::PANEL_SETUP_CONSTRAINTS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : + PANEL_SETUP_CONSTRAINTS_BASE( aParent->GetTreebook() ), m_minClearance( aFrame, m_clearanceTitle, m_clearanceCtrl, m_clearanceUnits ), m_minConn( aFrame, m_MinConnTitle, m_MinConnCtrl, m_MinConnUnits ), m_trackMinWidth( aFrame, m_TrackMinWidthTitle, m_TrackMinWidthCtrl, m_TrackMinWidthUnits ), diff --git a/pcbnew/dialogs/panel_setup_constraints.h b/pcbnew/dialogs/panel_setup_constraints.h index 28d2b147a5..1cb0b2c5e9 100644 --- a/pcbnew/dialogs/panel_setup_constraints.h +++ b/pcbnew/dialogs/panel_setup_constraints.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -38,7 +38,7 @@ class wxCommandEvent; class PANEL_SETUP_CONSTRAINTS : public PANEL_SETUP_CONSTRAINTS_BASE { public: - PANEL_SETUP_CONSTRAINTS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ); + PANEL_SETUP_CONSTRAINTS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ); ~PANEL_SETUP_CONSTRAINTS( ) override { }; void ImportSettingsFrom( BOARD* aBoard ); diff --git a/pcbnew/dialogs/panel_setup_formatting.cpp b/pcbnew/dialogs/panel_setup_formatting.cpp index 9ca71ad0ce..537a1775f4 100644 --- a/pcbnew/dialogs/panel_setup_formatting.cpp +++ b/pcbnew/dialogs/panel_setup_formatting.cpp @@ -30,8 +30,8 @@ #include -PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) : - PANEL_SETUP_FORMATTING_BASE( aParentWindow ), +PANEL_SETUP_FORMATTING::PANEL_SETUP_FORMATTING( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : + PANEL_SETUP_FORMATTING_BASE( aParent->GetTreebook() ), m_frame( aFrame ) { wxSize minSize = m_dashLengthCtrl->GetMinSize(); diff --git a/pcbnew/dialogs/panel_setup_formatting.h b/pcbnew/dialogs/panel_setup_formatting.h index 1fe27b34d3..b703fc63b0 100644 --- a/pcbnew/dialogs/panel_setup_formatting.h +++ b/pcbnew/dialogs/panel_setup_formatting.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -31,7 +31,7 @@ class PAGED_DIALOG; class PANEL_SETUP_FORMATTING : public PANEL_SETUP_FORMATTING_BASE { public: - PANEL_SETUP_FORMATTING( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ); + PANEL_SETUP_FORMATTING( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ); bool TransferDataToWindow() override; bool TransferDataFromWindow() override; diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste.cpp b/pcbnew/dialogs/panel_setup_mask_and_paste.cpp index 02a559e03b..2fedcf1568 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste.cpp +++ b/pcbnew/dialogs/panel_setup_mask_and_paste.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,11 +26,12 @@ #include #include #include +#include -PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE( wxWindow* aParentWindow, +PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : - PANEL_SETUP_MASK_AND_PASTE_BASE( aParentWindow ), + PANEL_SETUP_MASK_AND_PASTE_BASE( aParent->GetTreebook() ), m_maskExpansion( aFrame, m_maskMarginLabel, m_maskMarginCtrl, m_maskMarginUnits ), m_maskMinWidth( aFrame, m_maskMinWidthLabel, m_maskMinWidthCtrl, m_maskMinWidthUnits ), m_maskToCopperClearance( aFrame, m_maskToCopperClearanceLabel, m_maskToCopperClearanceCtrl, diff --git a/pcbnew/dialogs/panel_setup_mask_and_paste.h b/pcbnew/dialogs/panel_setup_mask_and_paste.h index 86b6ae536d..2319cddd79 100644 --- a/pcbnew/dialogs/panel_setup_mask_and_paste.h +++ b/pcbnew/dialogs/panel_setup_mask_and_paste.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018-2023 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2018 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -48,7 +48,7 @@ private: UNIT_BINDER m_pasteMarginRatio; public: - PANEL_SETUP_MASK_AND_PASTE( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ); + PANEL_SETUP_MASK_AND_PASTE( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ); ~PANEL_SETUP_MASK_AND_PASTE( ) { }; bool TransferDataToWindow() override; diff --git a/pcbnew/dialogs/panel_setup_rules.cpp b/pcbnew/dialogs/panel_setup_rules.cpp index 65444063ea..4096b6f05a 100644 --- a/pcbnew/dialogs/panel_setup_rules.cpp +++ b/pcbnew/dialogs/panel_setup_rules.cpp @@ -33,14 +33,16 @@ #include #include #include +#include #include #include #include #include #include -PANEL_SETUP_RULES::PANEL_SETUP_RULES( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ) : - PANEL_SETUP_RULES_BASE( aParentWindow ), +PANEL_SETUP_RULES::PANEL_SETUP_RULES( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : + PANEL_SETUP_RULES_BASE( aParent->GetTreebook() ), + m_Parent( aParent ), m_frame( aFrame ), m_scintillaTricks( nullptr ), m_helpWindow( nullptr ) @@ -48,8 +50,7 @@ PANEL_SETUP_RULES::PANEL_SETUP_RULES( wxWindow* aParentWindow, PCB_EDIT_FRAME* a m_scintillaTricks = new SCINTILLA_TRICKS( m_textEditor, wxT( "()" ), false, [this]() { - wxPostEvent( PAGED_DIALOG::GetDialog( this ), - wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) ); + wxPostEvent( m_Parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) ); } ); m_textEditor->AutoCompSetSeparator( '|' ); @@ -169,7 +170,7 @@ void PANEL_SETUP_RULES::OnContextMenu(wxMouseEvent &event) void PANEL_SETUP_RULES::onScintillaCharAdded( wxStyledTextEvent &aEvent ) { - PAGED_DIALOG::GetDialog( this )->SetModified(); + m_Parent->SetModified(); m_textEditor->SearchAnchor(); wxString rules = m_textEditor->GetText(); diff --git a/pcbnew/dialogs/panel_setup_rules.h b/pcbnew/dialogs/panel_setup_rules.h index bd97f761d5..9ceac5702e 100644 --- a/pcbnew/dialogs/panel_setup_rules.h +++ b/pcbnew/dialogs/panel_setup_rules.h @@ -38,7 +38,7 @@ class HTML_MESSAGE_BOX; class PANEL_SETUP_RULES : public PANEL_SETUP_RULES_BASE { public: - PANEL_SETUP_RULES( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ); + PANEL_SETUP_RULES( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ); ~PANEL_SETUP_RULES( ) override; private: @@ -53,6 +53,7 @@ private: bool TransferDataToWindow() override; bool TransferDataFromWindow() override; + PAGED_DIALOG* m_Parent; PCB_EDIT_FRAME* m_frame; SCINTILLA_TRICKS* m_scintillaTricks; wxString m_originalText; diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index ff48740650..ae392ae85b 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -54,9 +54,9 @@ enum }; -PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aParentWindow, +PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : - PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( aParentWindow ), + PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( aParent->GetTreebook() ), m_arrowLength( aFrame, m_lblArrowLength, m_dimensionArrowLength, m_arrowLengthUnits ), m_extensionOffset( aFrame, m_lblExtensionOffset, m_dimensionExtensionOffset, m_dimensionExtensionOffsetUnits ) diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.h b/pcbnew/dialogs/panel_setup_text_and_graphics.h index f9baf25965..c87aa519e4 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.h +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.h @@ -38,7 +38,7 @@ class BOARD_DESIGN_SETTINGS; class PANEL_SETUP_TEXT_AND_GRAPHICS : public PANEL_SETUP_TEXT_AND_GRAPHICS_BASE { public: - PANEL_SETUP_TEXT_AND_GRAPHICS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ); + PANEL_SETUP_TEXT_AND_GRAPHICS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ); ~PANEL_SETUP_TEXT_AND_GRAPHICS( ) override; bool TransferDataToWindow() override; diff --git a/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp b/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp index 5dcafdb3b0..52e1016d71 100644 --- a/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp +++ b/pcbnew/dialogs/panel_setup_tracks_and_vias.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -51,10 +52,11 @@ enum DIFF_VAR_GRID_COLUMNS }; -PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS( wxWindow* aParentWindow, +PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ) : - PANEL_SETUP_TRACKS_AND_VIAS_BASE( aParentWindow ) + PANEL_SETUP_TRACKS_AND_VIAS_BASE( aParent->GetTreebook() ) { + m_Parent = aParent; m_Frame = aFrame; m_Pcb = m_Frame->GetBoard(); m_BrdSettings = &m_Pcb->GetDesignSettings(); @@ -367,7 +369,7 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::Validate() if( !viaDia.IsEmpty() && viaDrill.IsEmpty() ) { msg = _( "No via hole size defined." ); - PAGED_DIALOG::GetDialog( this )->SetError( msg, this, m_viaSizesGrid, row, VIA_DRILL_COL ); + m_Parent->SetError( msg, this, m_viaSizesGrid, row, VIA_DRILL_COL ); return false; } } @@ -381,7 +383,7 @@ bool PANEL_SETUP_TRACKS_AND_VIAS::Validate() if( !dpWidth.IsEmpty() && dpGap.IsEmpty() ) { msg = _( "No differential pair gap defined." ); - PAGED_DIALOG::GetDialog( this )->SetError( msg, this, m_diffPairsGrid, row, 1 ); + m_Parent->SetError( msg, this, m_diffPairsGrid, row, 1 ); return false; } } diff --git a/pcbnew/dialogs/panel_setup_tracks_and_vias.h b/pcbnew/dialogs/panel_setup_tracks_and_vias.h index d264994416..ce4a7268ec 100644 --- a/pcbnew/dialogs/panel_setup_tracks_and_vias.h +++ b/pcbnew/dialogs/panel_setup_tracks_and_vias.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -39,7 +39,7 @@ class BOARD_DESIGN_SETTINGS; class PANEL_SETUP_TRACKS_AND_VIAS : public PANEL_SETUP_TRACKS_AND_VIAS_BASE { public: - PANEL_SETUP_TRACKS_AND_VIAS( wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame ); + PANEL_SETUP_TRACKS_AND_VIAS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame ); ~PANEL_SETUP_TRACKS_AND_VIAS() override; bool TransferDataToWindow() override; @@ -67,6 +67,7 @@ protected: void AppendDiffPairs( int aWidth, int aGap, int aViaGap ); private: + PAGED_DIALOG* m_Parent; PCB_EDIT_FRAME* m_Frame; BOARD* m_Pcb; BOARD_DESIGN_SETTINGS* m_BrdSettings;