pcb_calculator: fix a cosmetic issue in PANEL_WAVELENGTH.

Fixes #12020
https://gitlab.com/kicad/code/kicad/issues/12020
This commit is contained in:
jean-pierre charras 2022-07-20 08:43:06 +02:00
parent 6a9c6e8599
commit fed2049df5
4 changed files with 26 additions and 21 deletions

View File

@ -24,6 +24,7 @@
#include <wx/choicdlg.h> #include <wx/choicdlg.h>
#include "pcb_calculator_utils.h" #include "pcb_calculator_utils.h"
#include "common_data.h" #include "common_data.h"
#include <wx/dcclient.h>
#define SPEED_LIGHT 299792458 #define SPEED_LIGHT 299792458
@ -31,6 +32,12 @@ PANEL_WAVELENGTH::PANEL_WAVELENGTH( wxWindow* parent, wxWindowID id, const wxPoi
const wxSize& size, long style, const wxString& name ) : const wxSize& size, long style, const wxString& name ) :
PANEL_WAVELENGTH_BASE( parent, id, pos, size, style, name ) PANEL_WAVELENGTH_BASE( parent, id, pos, size, style, name )
{ {
// Set the min size of wxTextCtrls showing long values
wxString msg( wxT( "1.234567890E+99" ) );
wxClientDC dc( m_speedCtrl );
wxSize txt_size = dc.GetTextExtent( msg );
m_speedCtrl->SetMinSize( txt_size );
Layout();
} }
void PANEL_WAVELENGTH::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg ) void PANEL_WAVELENGTH::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1) // C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -41,7 +41,7 @@ PANEL_WAVELENGTH_BASE::PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id, c
fgSizer3->Add( m_staticText181, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizer3->Add( m_staticText181, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_periodCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_periodCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_periodCtrl, 0, wxALL, 5 ); fgSizer3->Add( m_periodCtrl, 0, wxALL|wxEXPAND, 5 );
wxArrayString m_periodUnitChoices; wxArrayString m_periodUnitChoices;
m_periodUnit = new UNIT_SELECTOR_TIME( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_periodUnitChoices, 0 ); m_periodUnit = new UNIT_SELECTOR_TIME( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_periodUnitChoices, 0 );
@ -53,7 +53,7 @@ PANEL_WAVELENGTH_BASE::PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id, c
fgSizer3->Add( m_staticText1811, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizer3->Add( m_staticText1811, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_wavelengthVacuumCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_wavelengthVacuumCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_wavelengthVacuumCtrl, 0, wxALL, 5 ); fgSizer3->Add( m_wavelengthVacuumCtrl, 0, wxALL|wxEXPAND, 5 );
wxArrayString m_wavelengthVacuumUnitChoices; wxArrayString m_wavelengthVacuumUnitChoices;
m_wavelengthVacuumUnit = new UNIT_SELECTOR_LEN_CABLE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_wavelengthVacuumUnitChoices, 0 ); m_wavelengthVacuumUnit = new UNIT_SELECTOR_LEN_CABLE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_wavelengthVacuumUnitChoices, 0 );
@ -65,7 +65,7 @@ PANEL_WAVELENGTH_BASE::PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id, c
fgSizer3->Add( m_staticText18111, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizer3->Add( m_staticText18111, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_wavelengthMediumCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_wavelengthMediumCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_wavelengthMediumCtrl, 0, wxALL, 5 ); fgSizer3->Add( m_wavelengthMediumCtrl, 0, wxALL|wxEXPAND, 5 );
wxArrayString m_wavelengthMediumUnitChoices; wxArrayString m_wavelengthMediumUnitChoices;
m_wavelengthMediumUnit = new UNIT_SELECTOR_LEN_CABLE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_wavelengthMediumUnitChoices, 0 ); m_wavelengthMediumUnit = new UNIT_SELECTOR_LEN_CABLE( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_wavelengthMediumUnitChoices, 0 );
@ -76,10 +76,8 @@ PANEL_WAVELENGTH_BASE::PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id, c
m_staticText181112->Wrap( -1 ); m_staticText181112->Wrap( -1 );
fgSizer3->Add( m_staticText181112, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizer3->Add( m_staticText181112, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_speedCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_speedCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
m_speedCtrl->Enable( false ); fgSizer3->Add( m_speedCtrl, 0, wxALL|wxEXPAND, 5 );
fgSizer3->Add( m_speedCtrl, 0, wxALL, 5 );
wxArrayString m_speedUnitChoices; wxArrayString m_speedUnitChoices;
m_speedUnit = new UNIT_SELECTOR_SPEED( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_speedUnitChoices, 0 ); m_speedUnit = new UNIT_SELECTOR_SPEED( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_speedUnitChoices, 0 );
@ -93,7 +91,7 @@ PANEL_WAVELENGTH_BASE::PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id, c
fgSizer3->Add( m_staticText181111, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizer3->Add( m_staticText181111, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_permittivityCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_permittivityCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_permittivityCtrl, 0, wxALL, 5 ); fgSizer3->Add( m_permittivityCtrl, 0, wxALL|wxEXPAND, 5 );
m_button1 = new wxButton( this, wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, 0 ); m_button1 = new wxButton( this, wxID_ANY, _("..."), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_button1, 0, wxALL, 5 ); fgSizer3->Add( m_button1, 0, wxALL, 5 );
@ -105,7 +103,7 @@ PANEL_WAVELENGTH_BASE::PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id, c
fgSizer3->Add( m_staticText42, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); fgSizer3->Add( m_staticText42, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 );
m_permeabilityCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_permeabilityCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizer3->Add( m_permeabilityCtrl, 0, wxALL, 5 ); fgSizer3->Add( m_permeabilityCtrl, 0, wxALL|wxEXPAND, 5 );
bSizer4->Add( fgSizer3, 1, wxEXPAND, 5 ); bSizer4->Add( fgSizer3, 1, wxEXPAND, 5 );

View File

@ -45,7 +45,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">PANEL_WAVELENGTH_BASE</property> <property name="name">PANEL_WAVELENGTH_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">736,453</property> <property name="size">538,453</property>
<property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property> <property name="subclass">CALCULATOR_PANEL; calculator_panels/calculator_panel.h; </property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="two_step_creation">0</property> <property name="two_step_creation">0</property>
@ -336,7 +336,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</property> <property name="flag">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>
@ -527,7 +527,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</property> <property name="flag">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>
@ -718,7 +718,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</property> <property name="flag">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>
@ -909,7 +909,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</property> <property name="flag">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>
@ -932,7 +932,7 @@
<property name="dock">Dock</property> <property name="dock">Dock</property>
<property name="dock_fixed">0</property> <property name="dock_fixed">0</property>
<property name="docking">Left</property> <property name="docking">Left</property>
<property name="enabled">0</property> <property name="enabled">1</property>
<property name="fg"></property> <property name="fg"></property>
<property name="floatable">1</property> <property name="floatable">1</property>
<property name="font"></property> <property name="font"></property>
@ -957,7 +957,7 @@
<property name="resize">Resizable</property> <property name="resize">Resizable</property>
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
<property name="style"></property> <property name="style">wxTE_READONLY</property>
<property name="subclass">; ; forward_declare</property> <property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip"></property>
@ -1099,7 +1099,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</property> <property name="flag">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>
@ -1299,7 +1299,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</property> <property name="flag">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>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1) // C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -76,7 +76,7 @@ class PANEL_WAVELENGTH_BASE : public CALCULATOR_PANEL
public: public:
PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 736,453 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); PANEL_WAVELENGTH_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 538,453 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_WAVELENGTH_BASE(); ~PANEL_WAVELENGTH_BASE();