15PANEL_RF_ATTENUATORS_BASE::PANEL_RF_ATTENUATORS_BASE( wxWindow* parent, wxWindowID
id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString&
name ) :
CALCULATOR_PANEL( parent, id, pos, size, style,
name )
17 wxBoxSizer* bSizerAtt;
18 bSizerAtt =
new wxBoxSizer( wxHORIZONTAL );
20 wxBoxSizer* bLeftSizerAtt;
21 bLeftSizerAtt =
new wxBoxSizer( wxVERTICAL );
23 bLeftSizerAtt->SetMinSize( wxSize( 260,-1 ) );
24 wxString m_AttenuatorsSelectionChoices[] = {
_(
"Pi"),
_(
"Tee"),
_(
"Bridged tee"),
_(
"Resistive splitter") };
25 int m_AttenuatorsSelectionNChoices =
sizeof( m_AttenuatorsSelectionChoices ) /
sizeof( wxString );
26 m_AttenuatorsSelection =
new wxRadioBox(
this, wxID_ANY,
_(
"Attenuators"), wxDefaultPosition, wxDefaultSize, m_AttenuatorsSelectionNChoices, m_AttenuatorsSelectionChoices, 1, wxRA_SPECIFY_COLS );
31 bLeftSizerAtt->Add( 0, 5, 0, wxEXPAND, 5 );
33 m_attenuatorBitmap =
new wxStaticBitmap(
this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
34 bLeftSizerAtt->Add(
m_attenuatorBitmap, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 10 );
37 bSizerAtt->Add( bLeftSizerAtt, 0, wxBOTTOM|wxEXPAND|wxRIGHT, 5 );
39 wxBoxSizer* bMiddleSizerAtt;
40 bMiddleSizerAtt =
new wxBoxSizer( wxVERTICAL );
42 wxStaticBoxSizer* sbSizerAttPrms;
43 sbSizerAttPrms =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Parameters") ), wxVERTICAL );
45 wxFlexGridSizer* fgSizerAttPrms;
46 fgSizerAttPrms =
new wxFlexGridSizer( 3, 3, 3, 0 );
47 fgSizerAttPrms->AddGrowableRow( 1 );
48 fgSizerAttPrms->SetFlexibleDirection( wxBOTH );
49 fgSizerAttPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
51 m_attenuationLabel =
new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY,
_(
"Attenuation (a):"), wxDefaultPosition, wxDefaultSize, 0 );
55 m_AttValueCtrl =
new wxTextCtrl( sbSizerAttPrms->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
58 fgSizerAttPrms->Add(
m_AttValueCtrl, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
60 m_attUnit =
new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY,
_(
"dB"), wxDefaultPosition, wxDefaultSize, 0 );
62 fgSizerAttPrms->Add(
m_attUnit, 0, wxALIGN_CENTER_VERTICAL, 5 );
64 m_attenuationZinLabel =
new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY,
_(
"Zin:"), wxDefaultPosition, wxDefaultSize, 0 );
68 m_ZinValueCtrl =
new wxTextCtrl( sbSizerAttPrms->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
71 fgSizerAttPrms->Add(
m_ZinValueCtrl, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
73 m_attZinUnit =
new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY,
_(
"Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
75 fgSizerAttPrms->Add(
m_attZinUnit, 0, wxALIGN_CENTER_VERTICAL, 5 );
77 m_ZoutLabel =
new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY,
_(
"Zout:"), wxDefaultPosition, wxDefaultSize, 0 );
79 fgSizerAttPrms->Add(
m_ZoutLabel, 0, wxALIGN_CENTER_VERTICAL, 5 );
81 m_ZoutValueCtrl =
new wxTextCtrl( sbSizerAttPrms->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
84 fgSizerAttPrms->Add(
m_ZoutValueCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
86 m_attZoutUnit =
new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY,
_(
"Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
88 fgSizerAttPrms->Add(
m_attZoutUnit, 0, wxALIGN_CENTER_VERTICAL, 5 );
91 sbSizerAttPrms->Add( fgSizerAttPrms, 0, wxALL|wxEXPAND, 5 );
94 bMiddleSizerAtt->Add( sbSizerAttPrms, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
96 wxBoxSizer* bSizerAttButt;
97 bSizerAttButt =
new wxBoxSizer( wxHORIZONTAL );
99 m_buttonAlcAtt =
new wxButton(
this, wxID_ANY,
_(
"Calculate"), wxDefaultPosition, wxDefaultSize, 0 );
102 bSizerAttButt->Add(
m_buttonAlcAtt, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
108 bMiddleSizerAtt->Add( bSizerAttButt, 0, 0, 5 );
110 wxStaticBoxSizer* sbSizerAttValues;
111 sbSizerAttValues =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Values") ), wxVERTICAL );
113 wxFlexGridSizer* fgSizerAttResults;
114 fgSizerAttResults =
new wxFlexGridSizer( 3, 3, 3, 0 );
115 fgSizerAttResults->AddGrowableCol( 1 );
116 fgSizerAttResults->SetFlexibleDirection( wxBOTH );
117 fgSizerAttResults->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
119 m_attenuatorR1Label =
new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY,
_(
"R1:"), wxDefaultPosition, wxDefaultSize, 0 );
123 m_Att_R1_Value =
new wxTextCtrl( sbSizerAttValues->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
124 fgSizerAttResults->Add(
m_Att_R1_Value, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 );
126 m_attR1Unit =
new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY,
_(
"Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
128 fgSizerAttResults->Add(
m_attR1Unit, 0, wxALIGN_CENTER_VERTICAL, 5 );
130 m_attenuatorR2Label =
new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY,
_(
"R2:"), wxDefaultPosition, wxDefaultSize, 0 );
134 m_Att_R2_Value =
new wxTextCtrl( sbSizerAttValues->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
135 fgSizerAttResults->Add(
m_Att_R2_Value, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 );
137 m_attR2Unit =
new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY,
_(
"Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
139 fgSizerAttResults->Add(
m_attR2Unit, 0, wxALIGN_CENTER_VERTICAL, 5 );
141 m_attenuatorR3Label =
new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY,
_(
"R3:"), wxDefaultPosition, wxDefaultSize, 0 );
145 m_Att_R3_Value =
new wxTextCtrl( sbSizerAttValues->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
146 fgSizerAttResults->Add(
m_Att_R3_Value, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
148 m_attR3Unit =
new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY,
_(
"Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
150 fgSizerAttResults->Add(
m_attR3Unit, 0, wxALIGN_CENTER_VERTICAL, 5 );
153 sbSizerAttValues->Add( fgSizerAttResults, 0, wxALL|wxEXPAND, 5 );
156 bMiddleSizerAtt->Add( sbSizerAttValues, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
158 wxBoxSizer* bSizerMessages;
159 bSizerMessages =
new wxBoxSizer( wxVERTICAL );
161 wxBoxSizer* bSizerIndentLabel;
162 bSizerIndentLabel =
new wxBoxSizer( wxHORIZONTAL );
164 m_staticTextAttMsg =
new wxStaticText(
this, wxID_ANY,
_(
"Messages"), wxDefaultPosition, wxDefaultSize, 0 );
169 bSizerMessages->Add( bSizerIndentLabel, 0, wxLEFT, 6 );
175 bMiddleSizerAtt->Add( bSizerMessages, 1, wxEXPAND|wxLEFT, 3 );
178 bSizerAtt->Add( bMiddleSizerAtt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
181 bSizer7 =
new wxBoxSizer( wxVERTICAL );
183 wxStaticBoxSizer* sbRightSizerFormula;
184 sbRightSizerFormula =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Formula") ), wxVERTICAL );
186 m_panelAttFormula =
new HTML_WINDOW( sbRightSizerFormula->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
192 bSizer7->Add( sbRightSizerFormula, 1, wxALL|wxEXPAND, 5 );
195 bSizerAtt->Add( bSizer7, 1, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
198 this->SetSizer( bSizerAtt );
200 bSizerAtt->Fit(
this );
Add dark theme support to wxHtmlWindow.
wxTextCtrl * m_ZinValueCtrl
wxStaticText * m_attenuatorR2Label
wxStaticText * m_attR3Unit
wxButton * m_buttonAlcAtt
wxTextCtrl * m_ZoutValueCtrl
wxStaticText * m_staticTextAttMsg
wxTextCtrl * m_Att_R2_Value
wxTextCtrl * m_Att_R1_Value
~PANEL_RF_ATTENUATORS_BASE()
wxStaticText * m_attZoutUnit
PANEL_RF_ATTENUATORS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
wxStaticText * m_attenuatorR1Label
wxStaticBitmap * m_attenuatorBitmap
HTML_WINDOW * m_panelAttFormula
virtual void OnCalculateAttenuator(wxCommandEvent &event)
wxStaticText * m_attR2Unit
HTML_WINDOW * m_Attenuator_Messages
wxStaticText * m_attZinUnit
wxTextCtrl * m_AttValueCtrl
STD_BITMAP_BUTTON * m_bpButtonCalcAtt
wxStaticText * m_ZoutLabel
wxStaticText * m_attenuationZinLabel
wxTextCtrl * m_Att_R3_Value
virtual void OnAttenuatorSelection(wxCommandEvent &event)
wxStaticText * m_attR1Unit
wxStaticText * m_attenuatorR3Label
wxStaticText * m_attenuationLabel
wxRadioBox * m_AttenuatorsSelection