From d3be62f644206e3d58c77652d3f139d17a42f7d5 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Fri, 16 Jun 2023 18:47:42 +0300 Subject: [PATCH] Adapt panels to PAGED_DIALOG sizing algorithm. Also some cosmetic fixes (GTK). --- 3d-viewer/dialogs/panel_3D_raytracing_options_base.cpp | 5 +++-- 3d-viewer/dialogs/panel_3D_raytracing_options_base.fbp | 4 ++-- 3d-viewer/dialogs/panel_3D_raytracing_options_base.h | 4 ++-- common/dialogs/panel_setup_netclasses_base.cpp | 7 +++---- common/dialogs/panel_setup_netclasses_base.fbp | 8 ++++---- common/dialogs/panel_setup_netclasses_base.h | 2 +- eeschema/dialogs/panel_sym_editing_options_base.cpp | 3 ++- eeschema/dialogs/panel_sym_editing_options_base.fbp | 2 +- eeschema/dialogs/panel_sym_editing_options_base.h | 4 ++-- pcbnew/dialogs/panel_edit_options_base.cpp | 4 ++-- pcbnew/dialogs/panel_edit_options_base.fbp | 4 ++-- pcbnew/dialogs/panel_setup_constraints_base.cpp | 4 ++-- pcbnew/dialogs/panel_setup_constraints_base.fbp | 4 ++-- pcbnew/dialogs/panel_setup_tracks_and_vias_base.cpp | 4 ++-- pcbnew/dialogs/panel_setup_tracks_and_vias_base.fbp | 4 ++-- 15 files changed, 32 insertions(+), 31 deletions(-) diff --git a/3d-viewer/dialogs/panel_3D_raytracing_options_base.cpp b/3d-viewer/dialogs/panel_3D_raytracing_options_base.cpp index 33aac7c45e..dceaab6201 100644 --- a/3d-viewer/dialogs/panel_3D_raytracing_options_base.cpp +++ b/3d-viewer/dialogs/panel_3D_raytracing_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -26,7 +26,7 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE::PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* pa m_cbRaytracing_proceduralTextures = new wxCheckBox( this, wxID_ANY, _("Procedural textures (slow)"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbRaytracing_proceduralTextures->SetValue(true); - gSizer1->Add( m_cbRaytracing_proceduralTextures, 0, wxALL, 5 ); + gSizer1->Add( m_cbRaytracing_proceduralTextures, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_cbRaytracing_addFloor = new wxCheckBox( this, wxID_ANY, _("Add floor (slow)"), wxDefaultPosition, wxDefaultSize, 0 ); m_cbRaytracing_addFloor->SetValue(true); @@ -347,6 +347,7 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE::PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* pa this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); } PANEL_3D_RAYTRACING_OPTIONS_BASE::~PANEL_3D_RAYTRACING_OPTIONS_BASE() diff --git a/3d-viewer/dialogs/panel_3D_raytracing_options_base.fbp b/3d-viewer/dialogs/panel_3D_raytracing_options_base.fbp index 782cfde2bd..6b3b2e58e2 100644 --- a/3d-viewer/dialogs/panel_3D_raytracing_options_base.fbp +++ b/3d-viewer/dialogs/panel_3D_raytracing_options_base.fbp @@ -45,7 +45,7 @@ PANEL_3D_RAYTRACING_OPTIONS_BASE - 834,514 + -1,-1 RESETTABLE_PANEL; widgets/resettable_panel.h; forward_declare 0 @@ -190,7 +190,7 @@ 0 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 diff --git a/3d-viewer/dialogs/panel_3D_raytracing_options_base.h b/3d-viewer/dialogs/panel_3D_raytracing_options_base.h index 411aae0485..12e98b500f 100644 --- a/3d-viewer/dialogs/panel_3D_raytracing_options_base.h +++ b/3d-viewer/dialogs/panel_3D_raytracing_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -103,7 +103,7 @@ class PANEL_3D_RAYTRACING_OPTIONS_BASE : public RESETTABLE_PANEL public: - PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 834,514 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_3D_RAYTRACING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_3D_RAYTRACING_OPTIONS_BASE(); diff --git a/common/dialogs/panel_setup_netclasses_base.cpp b/common/dialogs/panel_setup_netclasses_base.cpp index a39b152837..2ff90b0396 100644 --- a/common/dialogs/panel_setup_netclasses_base.cpp +++ b/common/dialogs/panel_setup_netclasses_base.cpp @@ -74,7 +74,7 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi // Cell Defaults m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - bUpperSizer->Add( m_netclassGrid, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 1 ); + bUpperSizer->Add( m_netclassGrid, 1, wxEXPAND|wxFIXED_MINSIZE|wxLEFT|wxRIGHT|wxTOP, 1 ); wxBoxSizer* buttonBoxSizer; buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -129,7 +129,7 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi m_assignmentGrid->SetMargins( 0, 0 ); // Columns - m_assignmentGrid->SetColSize( 0, 360 ); + m_assignmentGrid->SetColSize( 0, 270 ); m_assignmentGrid->SetColSize( 1, 160 ); m_assignmentGrid->EnableDragColMove( false ); m_assignmentGrid->EnableDragColSize( true ); @@ -147,7 +147,7 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi // Cell Defaults m_assignmentGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - bSizer14->Add( m_assignmentGrid, 2, wxEXPAND|wxLEFT, 5 ); + bSizer14->Add( m_assignmentGrid, 2, wxEXPAND|wxFIXED_MINSIZE|wxLEFT, 5 ); bColumns->Add( bSizer14, 3, wxEXPAND, 5 ); @@ -186,7 +186,6 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi this->SetSizer( bpanelNetClassesSizer ); this->Layout(); - bpanelNetClassesSizer->Fit( this ); // Connect Events this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ) ); diff --git a/common/dialogs/panel_setup_netclasses_base.fbp b/common/dialogs/panel_setup_netclasses_base.fbp index 991b9f3784..dab1037edb 100644 --- a/common/dialogs/panel_setup_netclasses_base.fbp +++ b/common/dialogs/panel_setup_netclasses_base.fbp @@ -45,7 +45,7 @@ -1,-1 PANEL_SETUP_NETCLASSES_BASE - -1,-1 + 700,500 ; forward_declare 0 @@ -258,7 +258,7 @@ 1 - wxEXPAND|wxLEFT|wxRIGHT|wxTOP + wxEXPAND|wxFIXED_MINSIZE|wxLEFT|wxRIGHT|wxTOP 1 1 @@ -737,7 +737,7 @@ none 5 - wxEXPAND|wxLEFT + wxEXPAND|wxFIXED_MINSIZE|wxLEFT 2 1 @@ -766,7 +766,7 @@ "Pattern" "Net Class" wxALIGN_CENTER 2 - 360,160 + 270,160 1 0 diff --git a/common/dialogs/panel_setup_netclasses_base.h b/common/dialogs/panel_setup_netclasses_base.h index 40028551bb..26fe4514d9 100644 --- a/common/dialogs/panel_setup_netclasses_base.h +++ b/common/dialogs/panel_setup_netclasses_base.h @@ -69,7 +69,7 @@ class PANEL_SETUP_NETCLASSES_BASE : public wxPanel public: - PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 700,500 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_SETUP_NETCLASSES_BASE(); diff --git a/eeschema/dialogs/panel_sym_editing_options_base.cpp b/eeschema/dialogs/panel_sym_editing_options_base.cpp index 5f0684c3bc..254254979d 100644 --- a/eeschema/dialogs/panel_sym_editing_options_base.cpp +++ b/eeschema/dialogs/panel_sym_editing_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -150,6 +150,7 @@ PANEL_SYM_EDITING_OPTIONS_BASE::PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent this->SetSizer( p1mainSizer ); this->Layout(); + p1mainSizer->Fit( this ); } PANEL_SYM_EDITING_OPTIONS_BASE::~PANEL_SYM_EDITING_OPTIONS_BASE() diff --git a/eeschema/dialogs/panel_sym_editing_options_base.fbp b/eeschema/dialogs/panel_sym_editing_options_base.fbp index bad94f246a..d3ca5af19b 100644 --- a/eeschema/dialogs/panel_sym_editing_options_base.fbp +++ b/eeschema/dialogs/panel_sym_editing_options_base.fbp @@ -45,7 +45,7 @@ PANEL_SYM_EDITING_OPTIONS_BASE - 381,396 + -1,-1 RESETTABLE_PANEL; widgets/resettable_panel.h; Not forward_declare 0 diff --git a/eeschema/dialogs/panel_sym_editing_options_base.h b/eeschema/dialogs/panel_sym_editing_options_base.h index bc4b36e182..ca7ac1be87 100644 --- a/eeschema/dialogs/panel_sym_editing_options_base.h +++ b/eeschema/dialogs/panel_sym_editing_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb) +// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -66,7 +66,7 @@ class PANEL_SYM_EDITING_OPTIONS_BASE : public RESETTABLE_PANEL public: - PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 381,396 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_SYM_EDITING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_SYM_EDITING_OPTIONS_BASE(); diff --git a/pcbnew/dialogs/panel_edit_options_base.cpp b/pcbnew/dialogs/panel_edit_options_base.cpp index f02cd6ac19..805a6512de 100644 --- a/pcbnew/dialogs/panel_edit_options_base.cpp +++ b/pcbnew/dialogs/panel_edit_options_base.cpp @@ -349,11 +349,11 @@ PANEL_EDIT_OPTIONS_BASE::PANEL_EDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID i m_ratsnestThicknessLabel = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Ratsnest line thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); m_ratsnestThicknessLabel->Wrap( -1 ); - bSizer11->Add( m_ratsnestThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer11->Add( m_ratsnestThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_ratsnestThickness = new wxSpinCtrlDouble( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0.5, 10, 0.5, 0.5 ); m_ratsnestThickness->SetDigits( 1 ); - bSizer11->Add( m_ratsnestThickness, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer11->Add( m_ratsnestThickness, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizer3->Add( bSizer11, 1, wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/panel_edit_options_base.fbp b/pcbnew/dialogs/panel_edit_options_base.fbp index d46355c1c1..4e6be8e400 100644 --- a/pcbnew/dialogs/panel_edit_options_base.fbp +++ b/pcbnew/dialogs/panel_edit_options_base.fbp @@ -3294,7 +3294,7 @@ none 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -3355,7 +3355,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 0 1 diff --git a/pcbnew/dialogs/panel_setup_constraints_base.cpp b/pcbnew/dialogs/panel_setup_constraints_base.cpp index 60fd6fb1e8..f6983b97ae 100644 --- a/pcbnew/dialogs/panel_setup_constraints_base.cpp +++ b/pcbnew/dialogs/panel_setup_constraints_base.cpp @@ -15,7 +15,7 @@ PANEL_SETUP_CONSTRAINTS_BASE::PANEL_SETUP_CONSTRAINTS_BASE( wxWindow* parent, wx bMainSizer = new wxBoxSizer( wxHORIZONTAL ); m_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL ); - m_scrolledWindow->SetScrollRate( 5, 5 ); + m_scrolledWindow->SetScrollRate( 0, 5 ); wxBoxSizer* bScrolledSizer; bScrolledSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -344,7 +344,7 @@ PANEL_SETUP_CONSTRAINTS_BASE::PANEL_SETUP_CONSTRAINTS_BASE( wxWindow* parent, wx bScrolledSizer->Add( sbFeatureConstraints, 0, wxEXPAND|wxTOP|wxRIGHT, 5 ); - bScrolledSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 20 ); + bScrolledSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 15 ); wxBoxSizer* sbFeatureRules; sbFeatureRules = new wxBoxSizer( wxVERTICAL ); diff --git a/pcbnew/dialogs/panel_setup_constraints_base.fbp b/pcbnew/dialogs/panel_setup_constraints_base.fbp index 44d362cc45..6c05525f7e 100644 --- a/pcbnew/dialogs/panel_setup_constraints_base.fbp +++ b/pcbnew/dialogs/panel_setup_constraints_base.fbp @@ -104,7 +104,7 @@ 1 Resizable - 5 + 0 5 1 @@ -4481,7 +4481,7 @@ - 20 + 15 wxEXPAND|wxRIGHT|wxLEFT 0 diff --git a/pcbnew/dialogs/panel_setup_tracks_and_vias_base.cpp b/pcbnew/dialogs/panel_setup_tracks_and_vias_base.cpp index e50cbeee90..feab6f4ee4 100644 --- a/pcbnew/dialogs/panel_setup_tracks_and_vias_base.cpp +++ b/pcbnew/dialogs/panel_setup_tracks_and_vias_base.cpp @@ -144,7 +144,7 @@ PANEL_SETUP_TRACKS_AND_VIAS_BASE::PANEL_SETUP_TRACKS_AND_VIAS_BASE( wxWindow* pa bSizerVias->Add( bSizer4, 0, wxEXPAND|wxTOP, 2 ); - bMainSizer->Add( bSizerVias, 1, wxEXPAND|wxRIGHT, 5 ); + bMainSizer->Add( bSizerVias, 2, wxEXPAND|wxRIGHT, 5 ); wxBoxSizer* bSizerDiffPairs; bSizerDiffPairs = new wxBoxSizer( wxVERTICAL ); @@ -211,7 +211,7 @@ PANEL_SETUP_TRACKS_AND_VIAS_BASE::PANEL_SETUP_TRACKS_AND_VIAS_BASE( wxWindow* pa bSizerDiffPairs->Add( bSizer5, 0, wxEXPAND|wxTOP, 2 ); - bMainSizer->Add( bSizerDiffPairs, 1, wxEXPAND, 5 ); + bMainSizer->Add( bSizerDiffPairs, 3, wxEXPAND, 5 ); this->SetSizer( bMainSizer ); diff --git a/pcbnew/dialogs/panel_setup_tracks_and_vias_base.fbp b/pcbnew/dialogs/panel_setup_tracks_and_vias_base.fbp index 1c406a64ae..741d295008 100644 --- a/pcbnew/dialogs/panel_setup_tracks_and_vias_base.fbp +++ b/pcbnew/dialogs/panel_setup_tracks_and_vias_base.fbp @@ -463,7 +463,7 @@ 5 wxEXPAND|wxRIGHT - 1 + 2 bSizerVias @@ -866,7 +866,7 @@ 5 wxEXPAND - 1 + 3 bSizerDiffPairs