PCB calculator: fix regulator dialog layout.

Set default dialog size to -1,-1 to allow the dialog to size itself
properly to prevent the buttons in the standard dialog button sizer
from being truncated.

Fixes lp:1839695

https://bugs.launchpad.net/kicad/+bug/1839695
This commit is contained in:
Wayne Stambaugh 2019-08-12 09:30:46 -04:00
parent 9b6e1cb1cd
commit e3e546f7d2
3 changed files with 825 additions and 824 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 10 2019) // C++ code generated with wxFormBuilder (version Aug 12 2019)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -16,7 +16,7 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
wxBoxSizer* bSizerMain; wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL ); bSizerMain = new wxBoxSizer( wxVERTICAL );
bSizerMain->SetMinSize( wxSize( 350,-1 ) ); bSizerMain->SetMinSize( wxSize( 300,-1 ) );
wxFlexGridSizer* fgSizerPrms; wxFlexGridSizer* fgSizerPrms;
fgSizerPrms = new wxFlexGridSizer( 4, 3, 0, 0 ); fgSizerPrms = new wxFlexGridSizer( 4, 3, 0, 0 );
fgSizerPrms->AddGrowableCol( 1 ); fgSizerPrms->AddGrowableCol( 1 );
@ -29,7 +29,7 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
fgSizerPrms->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerPrms->Add( m_staticTextName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPrms->Add( m_textCtrlName, 0, wxALL|wxEXPAND, 5 ); fgSizerPrms->Add( m_textCtrlName, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
fgSizerPrms->Add( 0, 0, 1, wxEXPAND, 5 ); fgSizerPrms->Add( 0, 0, 1, wxEXPAND, 5 );
@ -39,7 +39,7 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
fgSizerPrms->Add( m_staticTextVref, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerPrms->Add( m_staticTextVref, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_textCtrlVref = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_textCtrlVref = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPrms->Add( m_textCtrlVref, 0, wxALL|wxEXPAND, 5 ); fgSizerPrms->Add( m_textCtrlVref, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
m_staticTextVrefUnit = new wxStaticText( this, wxID_ANY, _("Volt"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextVrefUnit = new wxStaticText( this, wxID_ANY, _("Volt"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextVrefUnit->Wrap( -1 ); m_staticTextVrefUnit->Wrap( -1 );
@ -53,7 +53,7 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
int m_choiceRegTypeNChoices = sizeof( m_choiceRegTypeChoices ) / sizeof( wxString ); int m_choiceRegTypeNChoices = sizeof( m_choiceRegTypeChoices ) / sizeof( wxString );
m_choiceRegType = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegTypeNChoices, m_choiceRegTypeChoices, 0 ); m_choiceRegType = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceRegTypeNChoices, m_choiceRegTypeChoices, 0 );
m_choiceRegType->SetSelection( 0 ); m_choiceRegType->SetSelection( 0 );
fgSizerPrms->Add( m_choiceRegType, 0, wxALL|wxEXPAND, 5 ); fgSizerPrms->Add( m_choiceRegType, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
fgSizerPrms->Add( 0, 0, 1, wxEXPAND, 5 ); fgSizerPrms->Add( 0, 0, 1, wxEXPAND, 5 );
@ -63,7 +63,7 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
fgSizerPrms->Add( m_RegulIadjTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerPrms->Add( m_RegulIadjTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_RegulIadjValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_RegulIadjValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerPrms->Add( m_RegulIadjValue, 0, wxALL|wxEXPAND, 5 ); fgSizerPrms->Add( m_RegulIadjValue, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
m_IadjUnitLabel = new wxStaticText( this, wxID_ANY, _("uA"), wxDefaultPosition, wxDefaultSize, 0 ); m_IadjUnitLabel = new wxStaticText( this, wxID_ANY, _("uA"), wxDefaultPosition, wxDefaultSize, 0 );
m_IadjUnitLabel->Wrap( -1 ); m_IadjUnitLabel->Wrap( -1 );
@ -76,7 +76,7 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
bSizerMain->Add( 0, 0, 1, wxEXPAND, 5 ); bSizerMain->Add( 0, 0, 1, wxEXPAND, 5 );
m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline, 0, wxEXPAND | wxALL, 5 ); bSizerMain->Add( m_staticline, 0, wxEXPAND, 5 );
m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizer = new wxStdDialogButtonSizer();
m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizerOK = new wxButton( this, wxID_OK );
@ -85,11 +85,12 @@ DIALOG_EDITOR_DATA_BASE::DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID i
m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->AddButton( m_sdbSizerCancel );
m_sdbSizer->Realize(); m_sdbSizer->Realize();
bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 ); bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
this->SetSizer( bSizerMain ); this->SetSizer( bSizerMain );
this->Layout(); this->Layout();
bSizerMain->Fit( this );
this->Centre( wxBOTH ); this->Centre( wxBOTH );

View File

@ -47,7 +47,7 @@
<property name="minimum_size">-1,-1</property> <property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_EDITOR_DATA_BASE</property> <property name="name">DIALOG_EDITOR_DATA_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">348,210</property> <property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property> <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property> <property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Regulator Parameters</property> <property name="title">Regulator Parameters</property>
@ -56,7 +56,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style"></property> <property name="window_style"></property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size">350,-1</property> <property name="minimum_size">300,-1</property>
<property name="name">bSizerMain</property> <property name="name">bSizerMain</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
@ -139,7 +139,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|wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -274,7 +274,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|wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -460,7 +460,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|wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxChoice" expanded="1"> <object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -596,7 +596,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|wxEXPAND</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxTextCtrl" expanded="1"> <object class="wxTextCtrl" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -733,7 +733,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">wxEXPAND | wxALL</property> <property name="flag">wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStaticLine" expanded="1"> <object class="wxStaticLine" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -791,7 +791,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">wxEXPAND|wxALL</property> <property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1"> <object class="wxStdDialogButtonSizer" expanded="1">
<property name="Apply">0</property> <property name="Apply">0</property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 10 2019) // C++ code generated with wxFormBuilder (version Aug 12 2019)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -57,7 +57,7 @@ class DIALOG_EDITOR_DATA_BASE : public DIALOG_SHIM
public: public:
DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Regulator Parameters"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 348,210 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_EDITOR_DATA_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Regulator Parameters"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_EDITOR_DATA_BASE(); ~DIALOG_EDITOR_DATA_BASE();
}; };