KiCad PCB EDA Suite
panel_attenuators_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version 3.10.0)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
11 
12 PANEL_ATTENUATORS_BASE::PANEL_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 )
13 {
14  wxBoxSizer* bSizerAtt;
15  bSizerAtt = new wxBoxSizer( wxHORIZONTAL );
16 
17  wxBoxSizer* bLeftSizerAtt;
18  bLeftSizerAtt = new wxBoxSizer( wxVERTICAL );
19 
20  bLeftSizerAtt->SetMinSize( wxSize( 260,-1 ) );
21  wxString m_AttenuatorsSelectionChoices[] = { _("Pi"), _("Tee"), _("Bridged tee"), _("Resistive splitter") };
22  int m_AttenuatorsSelectionNChoices = sizeof( m_AttenuatorsSelectionChoices ) / sizeof( wxString );
23  m_AttenuatorsSelection = new wxRadioBox( this, wxID_ANY, _("Attenuators"), wxDefaultPosition, wxDefaultSize, m_AttenuatorsSelectionNChoices, m_AttenuatorsSelectionChoices, 1, wxRA_SPECIFY_COLS );
24  m_AttenuatorsSelection->SetSelection( 2 );
25  bLeftSizerAtt->Add( m_AttenuatorsSelection, 0, wxEXPAND|wxALL, 5 );
26 
27 
28  bLeftSizerAtt->Add( 0, 5, 0, wxEXPAND, 5 );
29 
30  m_attenuatorBitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
31  bLeftSizerAtt->Add( m_attenuatorBitmap, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 );
32 
33 
34  bSizerAtt->Add( bLeftSizerAtt, 0, wxEXPAND|wxRIGHT, 5 );
35 
36  wxBoxSizer* bMiddleSizerAtt;
37  bMiddleSizerAtt = new wxBoxSizer( wxVERTICAL );
38 
39  wxStaticBoxSizer* sbSizerAttPrms;
40  sbSizerAttPrms = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Parameters") ), wxVERTICAL );
41 
42  wxFlexGridSizer* fgSizerAttPrms;
43  fgSizerAttPrms = new wxFlexGridSizer( 3, 3, 3, 0 );
44  fgSizerAttPrms->AddGrowableRow( 1 );
45  fgSizerAttPrms->SetFlexibleDirection( wxBOTH );
46  fgSizerAttPrms->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
47 
48  m_attenuationLabel = new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY, _("Attenuation (a):"), wxDefaultPosition, wxDefaultSize, 0 );
49  m_attenuationLabel->Wrap( -1 );
50  fgSizerAttPrms->Add( m_attenuationLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
51 
52  m_AttValueCtrl = new wxTextCtrl( sbSizerAttPrms->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
53  fgSizerAttPrms->Add( m_AttValueCtrl, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
54 
55  m_attUnit = new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY, _("dB"), wxDefaultPosition, wxDefaultSize, 0 );
56  m_attUnit->Wrap( -1 );
57  fgSizerAttPrms->Add( m_attUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
58 
59  m_attenuationZinLabel = new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY, _("Zin:"), wxDefaultPosition, wxDefaultSize, 0 );
60  m_attenuationZinLabel->Wrap( -1 );
61  fgSizerAttPrms->Add( m_attenuationZinLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
62 
63  m_ZinValueCtrl = new wxTextCtrl( sbSizerAttPrms->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
64  fgSizerAttPrms->Add( m_ZinValueCtrl, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
65 
66  m_attZinUnit = new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY, _("Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
67  m_attZinUnit->Wrap( -1 );
68  fgSizerAttPrms->Add( m_attZinUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
69 
70  m_ZoutLabel = new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY, _("Zout:"), wxDefaultPosition, wxDefaultSize, 0 );
71  m_ZoutLabel->Wrap( -1 );
72  fgSizerAttPrms->Add( m_ZoutLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
73 
74  m_ZoutValueCtrl = new wxTextCtrl( sbSizerAttPrms->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
75  fgSizerAttPrms->Add( m_ZoutValueCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
76 
77  m_attZoutUnit = new wxStaticText( sbSizerAttPrms->GetStaticBox(), wxID_ANY, _("Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
78  m_attZoutUnit->Wrap( -1 );
79  fgSizerAttPrms->Add( m_attZoutUnit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
80 
81 
82  sbSizerAttPrms->Add( fgSizerAttPrms, 0, wxEXPAND|wxBOTTOM, 5 );
83 
84 
85  bMiddleSizerAtt->Add( sbSizerAttPrms, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
86 
87  wxBoxSizer* bSizerAttButt;
88  bSizerAttButt = new wxBoxSizer( wxHORIZONTAL );
89 
90  m_buttonAlcAtt = new wxButton( this, wxID_ANY, _("Calculate"), wxDefaultPosition, wxDefaultSize, 0 );
91  bSizerAttButt->Add( m_buttonAlcAtt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
92 
93  m_bpButtonCalcAtt = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
94  bSizerAttButt->Add( m_bpButtonCalcAtt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
95 
96 
97  bMiddleSizerAtt->Add( bSizerAttButt, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
98 
99  wxStaticBoxSizer* sbSizerAttValues;
100  sbSizerAttValues = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Values") ), wxVERTICAL );
101 
102  wxFlexGridSizer* fgSizerAttResults;
103  fgSizerAttResults = new wxFlexGridSizer( 3, 3, 3, 0 );
104  fgSizerAttResults->AddGrowableCol( 1 );
105  fgSizerAttResults->SetFlexibleDirection( wxBOTH );
106  fgSizerAttResults->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
107 
108  m_attenuatorR1Label = new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY, _("R1:"), wxDefaultPosition, wxDefaultSize, 0 );
109  m_attenuatorR1Label->Wrap( -1 );
110  fgSizerAttResults->Add( m_attenuatorR1Label, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
111 
112  m_Att_R1_Value = new wxTextCtrl( sbSizerAttValues->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
113  fgSizerAttResults->Add( m_Att_R1_Value, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 );
114 
115  m_attR1Unit = new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY, _("Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
116  m_attR1Unit->Wrap( -1 );
117  fgSizerAttResults->Add( m_attR1Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
118 
119  m_attenuatorR2Label = new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY, _("R2:"), wxDefaultPosition, wxDefaultSize, 0 );
120  m_attenuatorR2Label->Wrap( -1 );
121  fgSizerAttResults->Add( m_attenuatorR2Label, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
122 
123  m_Att_R2_Value = new wxTextCtrl( sbSizerAttValues->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
124  fgSizerAttResults->Add( m_Att_R2_Value, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 );
125 
126  m_attR2Unit = new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY, _("Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
127  m_attR2Unit->Wrap( -1 );
128  fgSizerAttResults->Add( m_attR2Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
129 
130  m_attenuatorR3Label = new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY, _("R3:"), wxDefaultPosition, wxDefaultSize, 0 );
131  m_attenuatorR3Label->Wrap( -1 );
132  fgSizerAttResults->Add( m_attenuatorR3Label, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
133 
134  m_Att_R3_Value = new wxTextCtrl( sbSizerAttValues->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
135  fgSizerAttResults->Add( m_Att_R3_Value, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
136 
137  m_attR3Unit = new wxStaticText( sbSizerAttValues->GetStaticBox(), wxID_ANY, _("Ohms"), wxDefaultPosition, wxDefaultSize, 0 );
138  m_attR3Unit->Wrap( -1 );
139  fgSizerAttResults->Add( m_attR3Unit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
140 
141 
142  sbSizerAttValues->Add( fgSizerAttResults, 0, wxEXPAND|wxBOTTOM, 5 );
143 
144 
145  bMiddleSizerAtt->Add( sbSizerAttValues, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
146 
147  wxBoxSizer* bSizerMessages;
148  bSizerMessages = new wxBoxSizer( wxVERTICAL );
149 
150  wxBoxSizer* bSizerIndentLabel;
151  bSizerIndentLabel = new wxBoxSizer( wxHORIZONTAL );
152 
153  m_staticTextAttMsg = new wxStaticText( this, wxID_ANY, _("Messages"), wxDefaultPosition, wxDefaultSize, 0 );
154  m_staticTextAttMsg->Wrap( -1 );
155  bSizerIndentLabel->Add( m_staticTextAttMsg, 0, wxALL, 2 );
156 
157 
158  bSizerMessages->Add( bSizerIndentLabel, 0, wxLEFT, 6 );
159 
160  m_Attenuator_Messages = new HTML_WINDOW( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_NO_SELECTION|wxHW_SCROLLBAR_AUTO );
161  bSizerMessages->Add( m_Attenuator_Messages, 1, wxEXPAND|wxBOTTOM|wxRIGHT, 8 );
162 
163 
164  bMiddleSizerAtt->Add( bSizerMessages, 1, wxEXPAND|wxLEFT, 3 );
165 
166 
167  bSizerAtt->Add( bMiddleSizerAtt, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
168 
169  wxStaticBoxSizer* sbRightSizerFormula;
170  sbRightSizerFormula = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Formula") ), wxVERTICAL );
171 
172  m_panelAttFormula = new HTML_WINDOW( sbRightSizerFormula->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO );
173  sbRightSizerFormula->Add( m_panelAttFormula, 1, wxEXPAND|wxBOTTOM, 5 );
174 
175 
176  bSizerAtt->Add( sbRightSizerFormula, 1, wxEXPAND|wxALL, 5 );
177 
178 
179  this->SetSizer( bSizerAtt );
180  this->Layout();
181 
182  // Connect Events
183  m_AttenuatorsSelection->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( PANEL_ATTENUATORS_BASE::OnAttenuatorSelection ), NULL, this );
184  m_buttonAlcAtt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_ATTENUATORS_BASE::OnCalculateAttenuator ), NULL, this );
185  m_bpButtonCalcAtt->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_ATTENUATORS_BASE::OnCalculateAttenuator ), NULL, this );
186 }
187 
189 {
190  // Disconnect Events
191  m_AttenuatorsSelection->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( PANEL_ATTENUATORS_BASE::OnAttenuatorSelection ), NULL, this );
192  m_buttonAlcAtt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_ATTENUATORS_BASE::OnCalculateAttenuator ), NULL, this );
193  m_bpButtonCalcAtt->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_ATTENUATORS_BASE::OnCalculateAttenuator ), NULL, this );
194 
195 }
virtual void OnAttenuatorSelection(wxCommandEvent &event)
wxStaticText * m_attenuationZinLabel
wxStaticBitmap * m_attenuatorBitmap
PANEL_ATTENUATORS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(500, 300), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
#define _(s)
Add dark theme support to wxHtmlWindow.
Definition: html_window.h:33
wxBitmapButton * m_bpButtonCalcAtt
const char * name
Definition: DXF_plotter.cpp:56
virtual void OnCalculateAttenuator(wxCommandEvent &event)