From c2bf691e56612fe93b341a8c6260e568fd3cd602 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 10 Apr 2022 23:40:59 +0100 Subject: [PATCH] Don't allow grid dialog to be resized, but do set help text before laying out. Fixes https://gitlab.com/kicad/code/kicad/issues/10171 --- common/dialogs/dialog_grid_settings.cpp | 10 +++++----- common/dialogs/dialog_grid_settings_base.cpp | 4 ++-- common/dialogs/dialog_grid_settings_base.fbp | 6 +++--- common/dialogs/dialog_grid_settings_base.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/dialogs/dialog_grid_settings.cpp b/common/dialogs/dialog_grid_settings.cpp index fd81769fe5..3ebccf2083 100644 --- a/common/dialogs/dialog_grid_settings.cpp +++ b/common/dialogs/dialog_grid_settings.cpp @@ -59,6 +59,11 @@ DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS( EDA_DRAW_FRAME* aParent ): m_book->SetSelection( 0 ); } + int hk1 = ACTIONS::gridFast1.GetHotKey(); + int hk2 = ACTIONS::gridFast2.GetHotKey(); + m_grid1HotKey->SetLabel( wxString::Format( wxT( "(%s)" ), KeyNameFromKeyCode( hk1 ) ) ); + m_grid2HotKey->SetLabel( wxString::Format( wxT( "(%s)" ), KeyNameFromKeyCode( hk2 ) ) ); + SetupStandardButtons(); SetInitialFocus( m_GridOriginXCtrl ); @@ -152,11 +157,6 @@ bool DIALOG_GRID_SETTINGS::TransferDataToWindow() m_grid1Ctrl->SetSelection( gridCfg.fast_grid_1 ); m_grid2Ctrl->SetSelection( gridCfg.fast_grid_2 ); - int hk1 = ACTIONS::gridFast1.GetHotKey(); - int hk2 = ACTIONS::gridFast2.GetHotKey(); - m_grid1HotKey->SetLabel( wxString::Format( wxT( "(%s)" ), KeyNameFromKeyCode( hk1 ) ) ); - m_grid2HotKey->SetLabel( wxString::Format( wxT( "(%s)" ), KeyNameFromKeyCode( hk2 ) ) ); - return wxDialog::TransferDataToWindow(); } diff --git a/common/dialogs/dialog_grid_settings_base.cpp b/common/dialogs/dialog_grid_settings_base.cpp index 6e87785acb..8ac86b9992 100644 --- a/common/dialogs/dialog_grid_settings_base.cpp +++ b/common/dialogs/dialog_grid_settings_base.cpp @@ -141,7 +141,7 @@ DIALOG_GRID_SETTINGS_BASE::DIALOG_GRID_SETTINGS_BASE( wxWindow* parent, wxWindow m_grid1HotKey = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("(hotkey)"), wxDefaultPosition, wxDefaultSize, 0 ); m_grid1HotKey->Wrap( -1 ); - fgSizer3->Add( m_grid1HotKey, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer3->Add( m_grid1HotKey, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); m_staticTextGrid2 = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("Grid 2:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextGrid2->Wrap( -1 ); @@ -156,7 +156,7 @@ DIALOG_GRID_SETTINGS_BASE::DIALOG_GRID_SETTINGS_BASE( wxWindow* parent, wxWindow m_grid2HotKey = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("(hotkey)"), wxDefaultPosition, wxDefaultSize, 0 ); m_grid2HotKey->Wrap( -1 ); - fgSizer3->Add( m_grid2HotKey, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer3->Add( m_grid2HotKey, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); sbFastSwitchSizer->Add( fgSizer3, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 ); diff --git a/common/dialogs/dialog_grid_settings_base.fbp b/common/dialogs/dialog_grid_settings_base.fbp index a0541956e1..1114681e16 100644 --- a/common/dialogs/dialog_grid_settings_base.fbp +++ b/common/dialogs/dialog_grid_settings_base.fbp @@ -46,7 +46,7 @@ DIALOG_GRID_SETTINGS_BASE -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + wxDEFAULT_DIALOG_STYLE DIALOG_SHIM; dialog_shim.h Grid Settings @@ -1270,7 +1270,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 0 1 @@ -1456,7 +1456,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT 0 1 diff --git a/common/dialogs/dialog_grid_settings_base.h b/common/dialogs/dialog_grid_settings_base.h index 10cb0bb881..7365cb6993 100644 --- a/common/dialogs/dialog_grid_settings_base.h +++ b/common/dialogs/dialog_grid_settings_base.h @@ -77,7 +77,7 @@ class DIALOG_GRID_SETTINGS_BASE : public DIALOG_SHIM public: - DIALOG_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Grid Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_GRID_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Grid Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~DIALOG_GRID_SETTINGS_BASE(); };