From c95a15001c7303c38eac513a39b452310b1724a2 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 7 Aug 2011 19:49:05 +0200 Subject: [PATCH] Pcb Calculator: fix wxWidgets 2.8 compatibility --- .../dialogs/pcb_calculator_frame_base.cpp | 22 +++++++++---------- .../dialogs/pcb_calculator_frame_base.fbp | 22 +++++++++---------- .../tracks_width_versus_current.cpp | 14 +++++------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp index 5c45d027af..4a30d3e1a8 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp @@ -143,11 +143,11 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow wxStaticBoxSizer* sbSizerTW_Prms; sbSizerTW_Prms = new wxStaticBoxSizer( new wxStaticBox( m_panelTrackWidth, wxID_ANY, _("Parameters:") ), wxVERTICAL ); - m_staticText89 = new wxStaticText( m_panelTrackWidth, wxID_ANY, _("Valid max values:\n35A for external traces and 17.5A for internal.\n400mil widths.\nMaximum temperature rise of 100°C."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText89 = new wxStaticText( m_panelTrackWidth, wxID_ANY, _("Valid max values:\n35A for external traces and 17.5A for internal.\n400mil widths.\nMaximum temperature rise of 100°C."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText89->Wrap( -1 ); m_staticText89->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - sbSizerTW_Prms->Add( m_staticText89, 0, wxALL, 5 ); + sbSizerTW_Prms->Add( m_staticText89, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxFlexGridSizer* fgSizer10; fgSizer10 = new wxFlexGridSizer( 4, 3, 0, 0 ); @@ -160,7 +160,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizer10->Add( m_staticTextCurrent, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); m_TrackCurrentValue = new wxTextCtrl( m_panelTrackWidth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer10->Add( m_TrackCurrentValue, 0, wxALL|wxEXPAND, 5 ); + fgSizer10->Add( m_TrackCurrentValue, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_staticText62 = new wxStaticText( m_panelTrackWidth, wxID_ANY, _("A"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText62->Wrap( -1 ); @@ -171,9 +171,9 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizer10->Add( m_staticText63, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); m_TrackDeltaTValue = new wxTextCtrl( m_panelTrackWidth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer10->Add( m_TrackDeltaTValue, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + fgSizer10->Add( m_TrackDeltaTValue, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_staticText64 = new wxStaticText( m_panelTrackWidth, wxID_ANY, _("°C"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText64 = new wxStaticText( m_panelTrackWidth, wxID_ANY, _("deg C"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText64->Wrap( -1 ); fgSizer10->Add( m_staticText64, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -182,29 +182,29 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizer10->Add( m_staticText65, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 ); m_TrackThicknessValue = new wxTextCtrl( m_panelTrackWidth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer10->Add( m_TrackThicknessValue, 0, wxALL|wxEXPAND, 5 ); + fgSizer10->Add( m_TrackThicknessValue, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); wxArrayString m_TW_CuThickness_choiceUnitChoices; m_TW_CuThickness_choiceUnit = new UNIT_SELECTOR_LEN( m_panelTrackWidth, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_TW_CuThickness_choiceUnitChoices, 0 ); m_TW_CuThickness_choiceUnit->SetSelection( 0 ); - fgSizer10->Add( m_TW_CuThickness_choiceUnit, 0, wxALL|wxEXPAND, 5 ); + fgSizer10->Add( m_TW_CuThickness_choiceUnit, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_staticText66 = new wxStaticText( m_panelTrackWidth, wxID_ANY, _("Conductor length"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText66->Wrap( -1 ); fgSizer10->Add( m_staticText66, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT|wxLEFT, 5 ); m_TrackLengthValue = new wxTextCtrl( m_panelTrackWidth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer10->Add( m_TrackLengthValue, 0, wxALL|wxEXPAND, 5 ); + fgSizer10->Add( m_TrackLengthValue, 0, wxEXPAND|wxALL, 5 ); wxArrayString m_TW_CuLength_choiceUnitChoices; m_TW_CuLength_choiceUnit = new UNIT_SELECTOR_LEN( m_panelTrackWidth, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_TW_CuLength_choiceUnitChoices, 0 ); m_TW_CuLength_choiceUnit->SetSelection( 0 ); - fgSizer10->Add( m_TW_CuLength_choiceUnit, 0, wxALL|wxEXPAND, 5 ); + fgSizer10->Add( m_TW_CuLength_choiceUnit, 0, wxEXPAND|wxALL, 5 ); - sbSizerTW_Prms->Add( fgSizer10, 1, wxEXPAND, 5 ); + sbSizerTW_Prms->Add( fgSizer10, 0, wxEXPAND, 5 ); m_htmlWinFormulas = new wxHtmlWindow( m_panelTrackWidth, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_NO_SELECTION|wxHW_SCROLLBAR_AUTO|wxSIMPLE_BORDER ); - sbSizerTW_Prms->Add( m_htmlWinFormulas, 1, wxALL|wxEXPAND, 5 ); + sbSizerTW_Prms->Add( m_htmlWinFormulas, 1, wxEXPAND|wxTOP, 5 ); bSizerTrackWidth->Add( sbSizerTW_Prms, 1, wxALL|wxEXPAND, 5 ); diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp index 1b0b5fa43b..c8385b6aa4 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp @@ -8,7 +8,7 @@ source_name 0 res - ANSI + UTF-8 connect pcb_calculator_frame_base 1000 @@ -2303,7 +2303,7 @@ 5 - wxALL + wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -2391,7 +2391,7 @@ 5 wxEXPAND - 1 + 0 3 wxBOTH @@ -2493,7 +2493,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -2758,7 +2758,7 @@ 5 - wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -2876,7 +2876,7 @@ 0 0 wxID_ANY - °C + deg C 0 @@ -3023,7 +3023,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL 0 1 @@ -3114,7 +3114,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 1 @@ -3288,7 +3288,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxALL 0 1 @@ -3379,7 +3379,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxALL 0 1 @@ -3468,7 +3468,7 @@ 5 - wxALL|wxEXPAND + wxEXPAND|wxTOP 1 1 diff --git a/pcb_calculator/tracks_width_versus_current.cpp b/pcb_calculator/tracks_width_versus_current.cpp index 08ec4c5a53..d4893eda1e 100644 --- a/pcb_calculator/tracks_width_versus_current.cpp +++ b/pcb_calculator/tracks_width_versus_current.cpp @@ -188,15 +188,13 @@ void PCB_CALCULATOR_FRAME::TW_Init() m_TrackLengthValue->SetValue( msg ); // Init formulas text - m_htmlWinFormulas->AppendToPage( _( "
The formulas (from IPC 2221) are:
" ) ); - m_htmlWinFormulas->AppendToPage( _( - "
Internal traces : I = 0.024 * dT^0.44 * A^0.725
" ) ); - m_htmlWinFormulas->AppendToPage( _( - "
External traces: I = 0.048 * dT^0.44 * A^0.725
" ) ); + m_htmlWinFormulas->AppendToPage( _( "
The formula (from IPC 2221) is:


" ) ); + m_htmlWinFormulas->AppendToPage( _( "
I = K * dT0.44 * (W*H)0.725
" ) ); + m_htmlWinFormulas->AppendToPage( _( "
Internal traces : K = 0.024
" ) ); + m_htmlWinFormulas->AppendToPage( _( "
External traces: K = 0.048
" ) ); m_htmlWinFormulas->AppendToPage( _( "
where:
" ) ); m_htmlWinFormulas->AppendToPage( _( "
I = maximum current in Amps
" ) ); - m_htmlWinFormulas->AppendToPage( _( - "
dT = temperature rise above ambient in °C
" ) ); - m_htmlWinFormulas->AppendToPage( _( "
A = cross-sectional area in mils²
" ) ); + m_htmlWinFormulas->AppendToPage( _( "
dT = temperature rise above ambient in \0B0 C
" ) ); + m_htmlWinFormulas->AppendToPage( _( "
W,H = Width and Thickness in mils
" ) ); }