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
This commit is contained in:
Jeff Young 2022-04-10 23:40:59 +01:00
parent 29eb5931c2
commit c2bf691e56
4 changed files with 11 additions and 11 deletions

View File

@ -59,6 +59,11 @@ DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS( EDA_DRAW_FRAME* aParent ):
m_book->SetSelection( 0 ); 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(); SetupStandardButtons();
SetInitialFocus( m_GridOriginXCtrl ); SetInitialFocus( m_GridOriginXCtrl );
@ -152,11 +157,6 @@ bool DIALOG_GRID_SETTINGS::TransferDataToWindow()
m_grid1Ctrl->SetSelection( gridCfg.fast_grid_1 ); m_grid1Ctrl->SetSelection( gridCfg.fast_grid_1 );
m_grid2Ctrl->SetSelection( gridCfg.fast_grid_2 ); 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(); return wxDialog::TransferDataToWindow();
} }

View File

@ -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 = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("(hotkey)"), wxDefaultPosition, wxDefaultSize, 0 );
m_grid1HotKey->Wrap( -1 ); 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 = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("Grid 2:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextGrid2->Wrap( -1 ); 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 = new wxStaticText( sbFastSwitchSizer->GetStaticBox(), wxID_ANY, _("(hotkey)"), wxDefaultPosition, wxDefaultSize, 0 );
m_grid2HotKey->Wrap( -1 ); 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 ); sbFastSwitchSizer->Add( fgSizer3, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );

View File

@ -46,7 +46,7 @@
<property name="name">DIALOG_GRID_SETTINGS_BASE</property> <property name="name">DIALOG_GRID_SETTINGS_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">-1,-1</property> <property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Grid Settings</property> <property name="title">Grid Settings</property>
<property name="tooltip"></property> <property name="tooltip"></property>
@ -1270,7 +1270,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -1456,7 +1456,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticText" expanded="1"> <object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>

View File

@ -77,7 +77,7 @@ class DIALOG_GRID_SETTINGS_BASE : public DIALOG_SHIM
public: 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(); ~DIALOG_GRID_SETTINGS_BASE();
}; };