From 41061b5cb1fd5ae2e5751fd453b6f6a98987a45c Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 20 Feb 2021 16:22:25 +0100 Subject: [PATCH] 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 --- .../dialogs/pcb_calculator_frame_base.cpp | 6 +++--- .../dialogs/pcb_calculator_frame_base.fbp | 14 +++++++------- pcb_calculator/pcb_calculator_frame.cpp | 4 ++++ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp index b4226c9f04..ef1c833c79 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp @@ -423,7 +423,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow m_panelAttenuators->SetSizer( bSizerAtt ); m_panelAttenuators->Layout(); 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 ); wxBoxSizer* bSizerESerie; bSizerESerie = new wxBoxSizer( wxVERTICAL ); @@ -1952,7 +1952,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow // Cell Defaults 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 ); 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->Layout(); 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 ); diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp index bf10ef41a4..72dc65499a 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp @@ -2524,7 +2524,7 @@ RF Attenuators - 1 + 0 1 1 @@ -20896,8 +20896,8 @@ Board Classes - 0 - + 1 + 1 1 1 @@ -20948,7 +20948,7 @@ wxTAB_TRAVERSAL - + bSizerBoardClass wxHORIZONTAL @@ -21029,11 +21029,11 @@ - + 5 wxEXPAND 1 - + brdclsSizerRight wxVERTICAL @@ -21101,7 +21101,7 @@ 5 - wxALL + wxALL|wxEXPAND 0 1 diff --git a/pcb_calculator/pcb_calculator_frame.cpp b/pcb_calculator/pcb_calculator_frame.cpp index b71106c051..ff52c232fb 100644 --- a/pcb_calculator/pcb_calculator_frame.cpp +++ b/pcb_calculator/pcb_calculator_frame.cpp @@ -147,6 +147,10 @@ PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) : 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 ); // Set previous size and position