Pcb calculator panels: ensure sizer are correctly updated.
On wxWidgets 3.0, SetSizeHints must be called once the panel is fully populated. On wxWidgets 3.1.5, SetSizeHints is not mandatory but can be called to ensure right sizes once the panel is fully populated.
This commit is contained in:
parent
895f4ca989
commit
2662433374
|
@ -47,6 +47,7 @@ PANEL_ATTENUATORS::PANEL_ATTENUATORS( wxWindow* parent, wxWindowID id,
|
||||||
m_AttenuatorList.push_back( new ATTENUATOR_BRIDGE() );
|
m_AttenuatorList.push_back( new ATTENUATOR_BRIDGE() );
|
||||||
m_AttenuatorList.push_back( new ATTENUATOR_SPLITTER() );
|
m_AttenuatorList.push_back( new ATTENUATOR_SPLITTER() );
|
||||||
m_CurrAttenuator = m_AttenuatorList[0];
|
m_CurrAttenuator = m_AttenuatorList[0];
|
||||||
|
SetAttenuator( 0 ); // Ensure an attenuator and especially its bitmap are set
|
||||||
|
|
||||||
m_staticTextAttMsg->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
m_staticTextAttMsg->SetFont( KIUI::GetInfoFont( this ).Italic() );
|
||||||
|
|
||||||
|
@ -55,6 +56,9 @@ PANEL_ATTENUATORS::PANEL_ATTENUATORS( wxWindow* parent, wxWindowID id,
|
||||||
m_attR1Unit->SetLabel( wxT( "Ω" ) );
|
m_attR1Unit->SetLabel( wxT( "Ω" ) );
|
||||||
m_attR2Unit->SetLabel( wxT( "Ω" ) );
|
m_attR2Unit->SetLabel( wxT( "Ω" ) );
|
||||||
m_attR3Unit->SetLabel( wxT( "Ω" ) );
|
m_attR3Unit->SetLabel( wxT( "Ω" ) );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,9 @@ PANEL_BOARD_CLASS::PANEL_BOARD_CLASS( wxWindow* parent, wxWindowID id,
|
||||||
{
|
{
|
||||||
// Autosize the row label column to be sure label are not truncated
|
// Autosize the row label column to be sure label are not truncated
|
||||||
m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
|
m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,9 @@ PANEL_COLOR_CODE::PANEL_COLOR_CODE( wxWindow* parent, wxWindowID id,
|
||||||
{
|
{
|
||||||
initColorCodePanel();
|
initColorCodePanel();
|
||||||
ToleranceSelection( m_rbToleranceSelection->GetSelection() );
|
ToleranceSelection( m_rbToleranceSelection->GetSelection() );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,9 @@ PANEL_ELECTRICAL_SPACING::PANEL_ELECTRICAL_SPACING( wxWindow* parent, wxWindowID
|
||||||
{
|
{
|
||||||
// Autosize the row label column to be sure label are not truncated
|
// Autosize the row label column to be sure label are not truncated
|
||||||
m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
|
m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,14 @@ PANEL_E_SERIE::PANEL_E_SERIE( wxWindow* parent, wxWindowID id,
|
||||||
m_reqResUnits->SetLabel( wxT( "kΩ" ) );
|
m_reqResUnits->SetLabel( wxT( "kΩ" ) );
|
||||||
m_exclude1Units->SetLabel( wxT( "kΩ" ) );
|
m_exclude1Units->SetLabel( wxT( "kΩ" ) );
|
||||||
m_exclude2Units->SetLabel( wxT( "kΩ" ) );
|
m_exclude2Units->SetLabel( wxT( "kΩ" ) );
|
||||||
|
|
||||||
|
// show markdown formula explanation in lower help panel
|
||||||
|
wxString msg;
|
||||||
|
ConvertMarkdown2Html( wxGetTranslation( eseries_help ), msg );
|
||||||
|
m_panelESeriesHelp->SetPage( msg );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,10 +71,4 @@ void PANEL_E_SERIE::SaveSettings( PCB_CALCULATOR_SETTINGS* aCfg )
|
||||||
|
|
||||||
void PANEL_E_SERIE::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
|
void PANEL_E_SERIE::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
|
||||||
{
|
{
|
||||||
// initialize ESeries tab at each pcb-calculator start
|
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
// show markdown formula explanation in lower help panel
|
|
||||||
ConvertMarkdown2Html( wxGetTranslation( eseries_help ), msg );
|
|
||||||
m_panelESeriesHelp->SetPage( msg );
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,9 @@ PANEL_REGULATOR::PANEL_REGULATOR( wxWindow* parent, wxWindowID id,
|
||||||
|
|
||||||
m_choiceRegulatorSelector->Append( m_RegulatorList.GetRegList() );
|
m_choiceRegulatorSelector->Append( m_RegulatorList.GetRegList() );
|
||||||
SelectLastSelectedRegulator();
|
SelectLastSelectedRegulator();
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
PANEL_REGULATOR::~PANEL_REGULATOR()
|
PANEL_REGULATOR::~PANEL_REGULATOR()
|
||||||
|
|
|
@ -58,6 +58,9 @@ PANEL_TRACK_WIDTH::PANEL_TRACK_WIDTH( wxWindow* parent, wxWindowID id,
|
||||||
|
|
||||||
m_TWMode = TW_MASTER_CURRENT;
|
m_TWMode = TW_MASTER_CURRENT;
|
||||||
m_TWNested = false;
|
m_TWNested = false;
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,11 @@ void PANEL_TRANSLINE::LoadSettings( PCB_CALCULATOR_SETTINGS* aCfg )
|
||||||
|
|
||||||
TranslineTypeSelection( m_currTransLineType );
|
TranslineTypeSelection( m_currTransLineType );
|
||||||
m_TranslineSelection->SetSelection( m_currTransLineType );
|
m_TranslineSelection->SetSelection( m_currTransLineType );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
// It also remove a minor cosmetic issue on wxWidgets 3.5 on MSW
|
||||||
|
// Called here after the current selected transline bitmaps are enabled/disabled
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,9 @@ PANEL_VIA_SIZE::PANEL_VIA_SIZE( wxWindow* parent, wxWindowID id,
|
||||||
m_viaReactanceUnits->SetLabel( wxT( "Ω" ) );
|
m_viaReactanceUnits->SetLabel( wxT( "Ω" ) );
|
||||||
|
|
||||||
m_viaBitmap->SetBitmap( KiBitmap( BITMAPS::viacalc ) );
|
m_viaBitmap->SetBitmap( KiBitmap( BITMAPS::viacalc ) );
|
||||||
|
|
||||||
|
// Needed on wxWidgets 3.0 to ensure sizers are correctly set
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue