diff --git a/pcb_calculator/attenuators.cpp b/pcb_calculator/attenuators.cpp index eb17803c35..4c0280e778 100644 --- a/pcb_calculator/attenuators.cpp +++ b/pcb_calculator/attenuators.cpp @@ -5,8 +5,8 @@ /* * This program source code file is part of KICAD, a free EDA CAD application. * - * Copyright (C) 2011 jean-pierre.charras - * Copyright (C) 2011 Kicad Developers, see change_log.txt for contributors. + * Copyright (C) 2015 jean-pierre.charras + * Copyright (C) 2015 Kicad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -46,7 +46,7 @@ void PCB_CALCULATOR_FRAME::SetAttenuator( unsigned aIdx ) aIdx = m_attenuator_list.size() - 1; m_currAttenuator = m_attenuator_list[aIdx]; TransfAttenuatorDataToPanel(); - m_Attenuator_Messages->Clear(); + m_Attenuator_Messages->SetPage( wxEmptyString ); m_Att_R1_Value->SetValue( wxEmptyString ); m_Att_R2_Value->SetValue( wxEmptyString ); m_Att_R3_Value->SetValue( wxEmptyString ); @@ -100,13 +100,17 @@ void PCB_CALCULATOR_FRAME::TransfAttenuatorResultsToPanel() { wxString msg; - m_Attenuator_Messages->Clear(); + m_Attenuator_Messages->SetPage( wxEmptyString ); if( m_currAttenuator->m_Error ) { - msg.Printf( _( "Error!\nSet attenuation more than %f dB" ), + msg.Printf( _( "Attenuation more than %f dB" ), m_currAttenuator->m_MinimumATT ); - m_Attenuator_Messages->AppendText( msg ); + m_Attenuator_Messages->AppendToPage( wxT( "
Error!

" ) ); + m_Attenuator_Messages->AppendToPage( msg ); + m_Attenuator_Messages->AppendToPage( wxT( "
" ) ); + + // Display -- as resistor values: msg = wxT( "--" ); m_Att_R1_Value->SetValue( msg ); m_Att_R2_Value->SetValue( msg ); diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp index d278530daf..e08d290d81 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -247,7 +247,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow m_panelRegulators->SetSizer( bSizerMainReg ); m_panelRegulators->Layout(); bSizerMainReg->Fit( m_panelRegulators ); - m_Notebook->AddPage( m_panelRegulators, _("Regulators"), false ); + m_Notebook->AddPage( m_panelRegulators, _("Regulators"), true ); m_panelTrackWidth = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizerTrackWidth; bSizerTrackWidth = new wxBoxSizer( wxHORIZONTAL ); @@ -734,7 +734,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizerSubstPrms->Add( m_SubsPrm9_choiceUnit, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 ); - sbSubstrateBoxSizer->Add( fgSizerSubstPrms, 1, wxEXPAND, 5 ); + sbSubstrateBoxSizer->Add( fgSizerSubstPrms, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); bMiddleSizer->Add( sbSubstrateBoxSizer, 0, wxEXPAND|wxBOTTOM, 5 ); @@ -762,7 +762,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizeCmpPrms->Add( m_choiceUnit_Frequency, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 ); - sbCmpPrmsSizer->Add( fgSizeCmpPrms, 0, wxEXPAND, 5 ); + sbCmpPrmsSizer->Add( fgSizeCmpPrms, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); bMiddleSizer->Add( sbCmpPrmsSizer, 0, wxEXPAND|wxTOP, 5 ); @@ -834,7 +834,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizerPhysPrms->Add( 0, 0, 0, 0, 5 ); - sbRightBoxizer->Add( fgSizerPhysPrms, 0, wxEXPAND, 5 ); + sbRightBoxizer->Add( fgSizerPhysPrms, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); btranslineRightSizer->Add( sbRightBoxizer, 0, wxBOTTOM|wxEXPAND, 5 ); @@ -915,10 +915,10 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizerResults->Add( m_choiceUnit_ElecPrm3, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - sbElectricalResultsSizer->Add( fgSizerResults, 0, wxEXPAND, 5 ); + sbElectricalResultsSizer->Add( fgSizerResults, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - bRightSizer->Add( sbElectricalResultsSizer, 0, wxEXPAND, 5 ); + bRightSizer->Add( sbElectricalResultsSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxStaticBoxSizer* sbMessagesSizer; sbMessagesSizer = new wxStaticBoxSizer( new wxStaticBox( m_panelTransline, wxID_ANY, _("Results:") ), wxVERTICAL ); @@ -998,7 +998,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow m_panelTransline->SetSizer( bSizeTransline ); m_panelTransline->Layout(); bSizeTransline->Fit( m_panelTransline ); - m_Notebook->AddPage( m_panelTransline, _("TransLine"), true ); + m_Notebook->AddPage( m_panelTransline, _("TransLine"), false ); m_panelAttenuators = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxStaticBoxSizer* sbSizerAtt; sbSizerAtt = new wxStaticBoxSizer( new wxStaticBox( m_panelAttenuators, wxID_ANY, _("label") ), wxHORIZONTAL ); @@ -1070,13 +1070,13 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow sbSizerAttPrms->Add( fgSizerAttPrms, 0, wxEXPAND, 5 ); - bMiddleSizerAtt->Add( sbSizerAttPrms, 0, wxEXPAND, 5 ); + bMiddleSizerAtt->Add( sbSizerAttPrms, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); wxBoxSizer* bSizerAttButt; bSizerAttButt = new wxBoxSizer( wxHORIZONTAL ); m_buttonAlcAtt = new wxButton( m_panelAttenuators, wxID_ANY, _("Calculate"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerAttButt->Add( m_buttonAlcAtt, 0, wxALL, 5 ); + bSizerAttButt->Add( m_buttonAlcAtt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmapAnalyse1 = new wxStaticBitmap( m_panelAttenuators, wxID_ANY, wxBitmap( arrow_bottom_xpm ), wxDefaultPosition, wxDefaultSize, 0 ); bSizerAttButt->Add( m_bitmapAnalyse1, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -1130,17 +1130,17 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow fgSizerAttResults->Add( m_attR3Unit, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - sbSizerAttValues->Add( fgSizerAttResults, 0, wxEXPAND, 5 ); + sbSizerAttValues->Add( fgSizerAttResults, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - bMiddleSizerAtt->Add( sbSizerAttValues, 0, wxEXPAND, 5 ); + bMiddleSizerAtt->Add( sbSizerAttValues, 0, wxEXPAND|wxTOP, 5 ); m_staticTextAttMsg = new wxStaticText( m_panelAttenuators, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextAttMsg->Wrap( -1 ); bMiddleSizerAtt->Add( m_staticTextAttMsg, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - m_Attenuator_Messages = new wxTextCtrl( m_panelAttenuators, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); - bMiddleSizerAtt->Add( m_Attenuator_Messages, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_Attenuator_Messages = new wxHtmlWindow( m_panelAttenuators, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_NO_SELECTION|wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER ); + bMiddleSizerAtt->Add( m_Attenuator_Messages, 1, wxALL|wxEXPAND, 5 ); sbSizerAtt->Add( bMiddleSizerAtt, 0, wxEXPAND, 5 ); @@ -1154,7 +1154,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow sbRightSizerFormula->Add( m_panelAttFormula, 1, wxALL|wxEXPAND, 5 ); - sbSizerAtt->Add( sbRightSizerFormula, 1, wxEXPAND, 5 ); + sbSizerAtt->Add( sbRightSizerFormula, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); m_panelAttenuators->SetSizer( sbSizerAtt ); diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp index a19832957a..39d0e425c7 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp @@ -44,7 +44,7 @@ PCB_CALCULATOR_FRAME_BASE - 702,489 + 753,485 wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER KIWAY_PLAYER; kiway_player.h PCB Calculator @@ -270,7 +270,7 @@ Regulators - 0 + 1 1 1 @@ -3342,16 +3342,16 @@ - + bSizerTrackWidth wxHORIZONTAL none - + 5 wxALL|wxEXPAND 1 - + wxID_ANY Parameters: @@ -3442,11 +3442,11 @@ - + 5 wxEXPAND 0 - + 3 wxBOTH 1 @@ -8181,7 +8181,7 @@ TransLine - 1 + 0 1 1 @@ -8256,7 +8256,7 @@ - + bSizeTransline wxHORIZONTAL @@ -8546,7 +8546,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 1 3 @@ -10936,7 +10936,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 0 3 @@ -11218,11 +11218,11 @@ - + 5 wxEXPAND 1 - + bRightSizer wxVERTICAL @@ -11250,7 +11250,7 @@ none 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 0 4 @@ -12604,7 +12604,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 0 wxID_ANY @@ -12616,7 +12616,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 0 3 @@ -13420,11 +13420,11 @@ - + 5 wxEXPAND|wxTOP 1 - + wxID_ANY Results: @@ -14897,7 +14897,7 @@ none 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 0 wxID_ANY @@ -15709,7 +15709,7 @@ none 5 - wxALL + wxALL|wxALIGN_CENTER_VERTICAL 0 1 @@ -15880,7 +15880,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP 0 wxID_ANY @@ -15892,7 +15892,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 0 3 @@ -16764,11 +16764,11 @@ - + 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + wxALL|wxEXPAND 1 - + 1 1 1 @@ -16799,7 +16799,6 @@ 0 - 0 @@ -16814,21 +16813,19 @@ Resizable 1 - wxTE_MULTILINE|wxTE_READONLY + wxHW_NO_SELECTION|wxHW_SCROLLBAR_AUTO 0 - - wxFILTER_NONE - wxDefaultValidator - - - + wxSUNKEN_BORDER + + + @@ -16848,10 +16845,6 @@ - - - - @@ -16859,7 +16852,7 @@ 5 - wxEXPAND + wxEXPAND|wxTOP|wxBOTTOM 1 wxID_ANY diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.h b/pcb_calculator/dialogs/pcb_calculator_frame_base.h index f6dbef0008..55e61b3c75 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.h +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -242,7 +242,7 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER wxTextCtrl* m_Att_R3_Value; wxStaticText* m_attR3Unit; wxStaticText* m_staticTextAttMsg; - wxTextCtrl* m_Attenuator_Messages; + wxHtmlWindow* m_Attenuator_Messages; wxPanel* m_panelAttFormula; wxPanel* m_panelColorCode; wxRadioBox* m_rbToleranceSelection; @@ -293,7 +293,7 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER public: - PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PCB Calculator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 702,489 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); + PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PCB Calculator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 753,485 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); ~PCB_CALCULATOR_FRAME_BASE();