pcb_calculateur: fix truncation of row labels of wxGrid

this column had a fixed width, that does not work for translated texts
or large fonts.
Fixes #7607
https://gitlab.com/kicad/code/kicad/issues/7607
This commit is contained in:
jean-pierre charras 2021-02-20 16:22:25 +01:00
parent 91e876ce0d
commit 41061b5cb1
3 changed files with 14 additions and 10 deletions

View File

@ -423,7 +423,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_panelAttenuators->SetSizer( bSizerAtt ); m_panelAttenuators->SetSizer( bSizerAtt );
m_panelAttenuators->Layout(); m_panelAttenuators->Layout();
bSizerAtt->Fit( m_panelAttenuators ); bSizerAtt->Fit( m_panelAttenuators );
m_Notebook->AddPage( m_panelAttenuators, _("RF Attenuators"), true ); m_Notebook->AddPage( m_panelAttenuators, _("RF Attenuators"), false );
m_panelESeries = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelESeries = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizerESerie; wxBoxSizer* bSizerESerie;
bSizerESerie = new wxBoxSizer( wxVERTICAL ); bSizerESerie = new wxBoxSizer( wxVERTICAL );
@ -1952,7 +1952,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
// Cell Defaults // Cell Defaults
m_gridClassesValuesDisplay->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP ); m_gridClassesValuesDisplay->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
brdclsSizerRight->Add( m_gridClassesValuesDisplay, 0, wxALL, 5 ); brdclsSizerRight->Add( m_gridClassesValuesDisplay, 0, wxALL|wxEXPAND, 5 );
m_panelShowClassPrms = new wxPanel( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelShowClassPrms = new wxPanel( m_panelBoardClass, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
brdclsSizerRight->Add( m_panelShowClassPrms, 1, wxALL|wxEXPAND, 5 ); brdclsSizerRight->Add( m_panelShowClassPrms, 1, wxALL|wxEXPAND, 5 );
@ -1964,7 +1964,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow
m_panelBoardClass->SetSizer( bSizerBoardClass ); m_panelBoardClass->SetSizer( bSizerBoardClass );
m_panelBoardClass->Layout(); m_panelBoardClass->Layout();
bSizerBoardClass->Fit( m_panelBoardClass ); bSizerBoardClass->Fit( m_panelBoardClass );
m_Notebook->AddPage( m_panelBoardClass, _("Board Classes"), false ); m_Notebook->AddPage( m_panelBoardClass, _("Board Classes"), true );
bmainFrameSizer->Add( m_Notebook, 1, wxEXPAND, 5 ); bmainFrameSizer->Add( m_Notebook, 1, wxEXPAND, 5 );

View File

@ -2524,7 +2524,7 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">RF Attenuators</property> <property name="label">RF Attenuators</property>
<property name="select">1</property> <property name="select">0</property>
<object class="wxPanel" expanded="0"> <object class="wxPanel" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
@ -20896,8 +20896,8 @@
<object class="notebookpage" expanded="1"> <object class="notebookpage" expanded="1">
<property name="bitmap"></property> <property name="bitmap"></property>
<property name="label">Board Classes</property> <property name="label">Board Classes</property>
<property name="select">0</property> <property name="select">1</property>
<object class="wxPanel" expanded="0"> <object class="wxPanel" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
<property name="LeftDockable">1</property> <property name="LeftDockable">1</property>
<property name="RightDockable">1</property> <property name="RightDockable">1</property>
@ -20948,7 +20948,7 @@
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">bSizerBoardClass</property> <property name="name">bSizerBoardClass</property>
<property name="orient">wxHORIZONTAL</property> <property name="orient">wxHORIZONTAL</property>
@ -21029,11 +21029,11 @@
</object> </object>
</object> </object>
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND</property> <property name="flag">wxEXPAND</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxBoxSizer" expanded="0"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">brdclsSizerRight</property> <property name="name">brdclsSizerRight</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
@ -21101,7 +21101,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<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="wxGrid" expanded="0"> <object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>

View File

@ -147,6 +147,10 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
SetIcons( icon_bundle ); SetIcons( icon_bundle );
// Autosize the the row label column to be sure label are not truncated
m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
GetSizer()->SetSizeHints( this ); GetSizer()->SetSizeHints( this );
// Set previous size and position // Set previous size and position