From 4465c175a0d04e0d1cd46f52f89418507e2dbd2b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 15 Aug 2017 19:46:37 +0200 Subject: [PATCH] Pcb_calculator: Minor enhancement in transline page --- .../dialogs/pcb_calculator_frame_base.cpp | 29 ++- .../dialogs/pcb_calculator_frame_base.fbp | 192 +++++++++++++++++- .../dialogs/pcb_calculator_frame_base.h | 5 +- pcb_calculator/transline_dlg_funct.cpp | 1 + 4 files changed, 218 insertions(+), 9 deletions(-) diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp index b90b423762..063723816a 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.cpp @@ -784,11 +784,32 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow bMiddleSizer->Add( sbCmpPrmsSizer, 0, wxEXPAND|wxTOP, 5 ); wxBoxSizer* bSizerHelpBitmaps; - bSizerHelpBitmaps = new wxBoxSizer( wxHORIZONTAL ); + bSizerHelpBitmaps = new wxBoxSizer( wxVERTICAL ); m_bmCMicrostripZoddZeven = new wxStaticBitmap( m_panelTransline, wxID_ANY, wxBitmap( microstrip_zodd_zeven_xpm ), wxDefaultPosition, wxDefaultSize, 0 ); bSizerHelpBitmaps->Add( m_bmCMicrostripZoddZeven, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_fgSizerZcomment = new wxFlexGridSizer( 0, 2, 0, 0 ); + m_fgSizerZcomment->AddGrowableCol( 0 ); + m_fgSizerZcomment->AddGrowableCol( 1 ); + m_fgSizerZcomment->SetFlexibleDirection( wxBOTH ); + m_fgSizerZcomment->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextZdiff = new wxStaticText( m_panelTransline, wxID_ANY, _("Zdiff = Zodd * 2"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextZdiff->Wrap( -1 ); + m_staticTextZdiff->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + m_fgSizerZcomment->Add( m_staticTextZdiff, 0, wxALL, 5 ); + + m_staticTextZcommon = new wxStaticText( m_panelTransline, wxID_ANY, _("Zcommon = Zeven / 2"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextZcommon->Wrap( -1 ); + m_staticTextZcommon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); + + m_fgSizerZcomment->Add( m_staticTextZcommon, 0, wxALL, 5 ); + + + bSizerHelpBitmaps->Add( m_fgSizerZcomment, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bMiddleSizer->Add( bSizerHelpBitmaps, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); @@ -1017,7 +1038,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"), false ); + m_Notebook->AddPage( m_panelTransline, _("TransLine"), true ); 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 ); @@ -1171,7 +1192,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow m_panelAttenuators->SetSizer( sbSizerAtt ); m_panelAttenuators->Layout(); sbSizerAtt->Fit( m_panelAttenuators ); - m_Notebook->AddPage( m_panelAttenuators, _("RF Attenuators"), true ); + m_Notebook->AddPage( m_panelAttenuators, _("RF Attenuators"), false ); m_panelColorCode = new wxPanel( m_Notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizerPanelColorCode; bSizerPanelColorCode = new wxBoxSizer( wxHORIZONTAL ); @@ -1180,7 +1201,7 @@ PCB_CALCULATOR_FRAME_BASE::PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindow int m_rbToleranceSelectionNChoices = sizeof( m_rbToleranceSelectionChoices ) / sizeof( wxString ); m_rbToleranceSelection = new wxRadioBox( m_panelColorCode, wxID_ANY, _("Tolerance"), wxDefaultPosition, wxDefaultSize, m_rbToleranceSelectionNChoices, m_rbToleranceSelectionChoices, 1, wxRA_SPECIFY_COLS ); m_rbToleranceSelection->SetSelection( 0 ); - bSizerPanelColorCode->Add( m_rbToleranceSelection, 0, wxALL|wxALIGN_TOP, 5 ); + bSizerPanelColorCode->Add( m_rbToleranceSelection, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); wxFlexGridSizer* fgSizerColoCode; fgSizerColoCode = new wxFlexGridSizer( 2, 6, 0, 0 ); diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp b/pcb_calculator/dialogs/pcb_calculator_frame_base.fbp index 5267723099..0eac5af761 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 - 877,485 + 877,580 wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER KIWAY_PLAYER; kiway_player.h PCB Calculator @@ -8724,7 +8724,7 @@ TransLine - 0 + 1 1 1 @@ -11768,7 +11768,7 @@ bSizerHelpBitmaps - wxHORIZONTAL + wxVERTICAL none 5 @@ -11851,6 +11851,190 @@ + + 5 + wxALIGN_CENTER_HORIZONTAL|wxEXPAND + 0 + + 2 + wxBOTH + 0,1 + + 0 + + m_fgSizerZcomment + wxFLEX_GROWMODE_SPECIFIED + protected + 0 + 0 + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,93,92,-1,70,0 + 0 + 0 + wxID_ANY + Zdiff = Zodd * 2 + + 0 + + + 0 + + 1 + m_staticTextZdiff + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,93,92,-1,70,0 + 0 + 0 + wxID_ANY + Zcommon = Zeven / 2 + + 0 + + + 0 + + 1 + m_staticTextZcommon + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -15286,7 +15470,7 @@ RF Attenuators - 1 + 0 1 1 diff --git a/pcb_calculator/dialogs/pcb_calculator_frame_base.h b/pcb_calculator/dialogs/pcb_calculator_frame_base.h index 98d63f651d..ccf18026ce 100644 --- a/pcb_calculator/dialogs/pcb_calculator_frame_base.h +++ b/pcb_calculator/dialogs/pcb_calculator_frame_base.h @@ -190,6 +190,9 @@ class PCB_CALCULATOR_FRAME_BASE : public KIWAY_PLAYER wxTextCtrl* m_Value_Frequency_Ctrl; UNIT_SELECTOR_FREQUENCY* m_choiceUnit_Frequency; wxStaticBitmap* m_bmCMicrostripZoddZeven; + wxFlexGridSizer* m_fgSizerZcomment; + wxStaticText* m_staticTextZdiff; + wxStaticText* m_staticTextZcommon; wxStaticText* m_phys_prm1_label; wxTextCtrl* m_Phys_prm1_Value; UNIT_SELECTOR_LEN* m_choiceUnit_Param1; @@ -305,7 +308,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( 877,485 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL, const wxString& name = wxT("pcb_calculator") ); + PCB_CALCULATOR_FRAME_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("PCB Calculator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 877,580 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL, const wxString& name = wxT("pcb_calculator") ); ~PCB_CALCULATOR_FRAME_BASE(); diff --git a/pcb_calculator/transline_dlg_funct.cpp b/pcb_calculator/transline_dlg_funct.cpp index 1609fa6857..dac46f913b 100644 --- a/pcb_calculator/transline_dlg_funct.cpp +++ b/pcb_calculator/transline_dlg_funct.cpp @@ -154,6 +154,7 @@ void PCB_CALCULATOR_FRAME::TranslineTypeSelection( enum TRANSLINE_TYPE_ID aType // This helper bitmap is shown for coupled microstrip only: m_bmCMicrostripZoddZeven->Show( aType == C_MICROSTRIP_TYPE ); + m_fgSizerZcomment->Show( aType == C_MICROSTRIP_TYPE ); TRANSLINE_IDENT* tr_ident = m_transline_list[m_currTransLineType]; m_currTransLine = tr_ident->m_TLine;