KiCad PCB EDA Suite
dialog_lib_edit_pin_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Sep 8 2016)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
8 #include "pin_shape_combobox.h"
9 #include "pin_type_combobox.h"
10 #include "wx/bmpcbox.h"
11 
13 
15 
16 DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
17 {
18  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
19 
20  wxBoxSizer* mainSizer;
21  mainSizer = new wxBoxSizer( wxVERTICAL );
22 
23  wxBoxSizer* bUpperSizer;
24  bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
25 
26  wxBoxSizer* bLeftSizer;
27  bLeftSizer = new wxBoxSizer( wxVERTICAL );
28 
29  wxFlexGridSizer* fgSizerPins;
30  fgSizerPins = new wxFlexGridSizer( 5, 2, 0, 0 );
31  fgSizerPins->AddGrowableCol( 1 );
32  fgSizerPins->SetFlexibleDirection( wxBOTH );
33  fgSizerPins->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
34 
35  m_staticTextPinName = new wxStaticText( this, wxID_ANY, _("Pin &name:"), wxDefaultPosition, wxDefaultSize, 0 );
36  m_staticTextPinName->Wrap( -1 );
37  fgSizerPins->Add( m_staticTextPinName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
38 
39  m_textPinName = new wxTextCtrl( this, ID_M_TEXTPINNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
40  fgSizerPins->Add( m_textPinName, 0, wxEXPAND|wxTOP|wxBOTTOM, 3 );
41 
42  m_staticTextPadName = new wxStaticText( this, ID_M_STATICTEXTPADNAME, _("Pin n&umber:"), wxDefaultPosition, wxDefaultSize, 0 );
43  m_staticTextPadName->Wrap( -1 );
44  m_staticTextPadName->SetToolTip( _("Pin number: 1 to 4 ASCII letters and/or digits") );
45 
46  fgSizerPins->Add( m_staticTextPadName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
47 
48  m_textPadName = new wxTextCtrl( this, ID_M_TEXTPADNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
49  fgSizerPins->Add( m_textPadName, 0, wxEXPAND|wxTOP|wxBOTTOM, 3 );
50 
51  m_staticTextOrient = new wxStaticText( this, wxID_ANY, _("&Orientation:"), wxDefaultPosition, wxDefaultSize, 0 );
52  m_staticTextOrient->Wrap( -1 );
53  fgSizerPins->Add( m_staticTextOrient, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
54 
55  m_choiceOrientation = new wxBitmapComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
56  fgSizerPins->Add( m_choiceOrientation, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
57 
58  m_staticTextEType = new wxStaticText( this, wxID_ANY, _("&Electrical type:"), wxDefaultPosition, wxDefaultSize, 0 );
59  m_staticTextEType->Wrap( -1 );
60  m_staticTextEType->SetToolTip( _("Used by the ERC.") );
61 
62  fgSizerPins->Add( m_staticTextEType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
63 
64  m_choiceElectricalType = new PinTypeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
65  fgSizerPins->Add( m_choiceElectricalType, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
66 
67  m_staticTextGstyle = new wxStaticText( this, wxID_ANY, _("Graphic &Style:"), wxDefaultPosition, wxDefaultSize, 0 );
68  m_staticTextGstyle->Wrap( -1 );
69  fgSizerPins->Add( m_staticTextGstyle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
70 
71  m_choiceStyle = new PinShapeComboBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
72  fgSizerPins->Add( m_choiceStyle, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
73 
74 
75  bLeftSizer->Add( fgSizerPins, 0, wxALL|wxEXPAND, 5 );
76 
77  wxBoxSizer* boarderSizer;
78  boarderSizer = new wxBoxSizer( wxVERTICAL );
79 
80  wxStaticBoxSizer* sbSizerPinSharing;
81  sbSizerPinSharing = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Sharing") ), wxVERTICAL );
82 
83  m_checkApplyToAllParts = new wxCheckBox( sbSizerPinSharing->GetStaticBox(), wxID_ANY, _("Common to all &units in component"), wxDefaultPosition, wxDefaultSize, 0 );
84  sbSizerPinSharing->Add( m_checkApplyToAllParts, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
85 
86  m_checkApplyToAllConversions = new wxCheckBox( sbSizerPinSharing->GetStaticBox(), wxID_ANY, _("Common to all body &styles (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
87  sbSizerPinSharing->Add( m_checkApplyToAllConversions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
88 
89 
90  boarderSizer->Add( sbSizerPinSharing, 0, wxEXPAND|wxALL, 5 );
91 
92  wxStaticBoxSizer* sbSizerSchematicProperties;
93  sbSizerSchematicProperties = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Schematic Properties") ), wxVERTICAL );
94 
95  m_checkShow = new wxCheckBox( sbSizerSchematicProperties->GetStaticBox(), wxID_ANY, _("&Visible"), wxDefaultPosition, wxDefaultSize, 0 );
96  m_checkShow->SetValue(true);
97  sbSizerSchematicProperties->Add( m_checkShow, 0, wxALL, 3 );
98 
99 
100  boarderSizer->Add( sbSizerSchematicProperties, 0, wxEXPAND|wxALL, 5 );
101 
102 
103  bLeftSizer->Add( boarderSizer, 0, wxEXPAND|wxTOP|wxBOTTOM, 12 );
104 
105 
106  bUpperSizer->Add( bLeftSizer, 1, wxEXPAND, 5 );
107 
108  wxBoxSizer* bRightSizer;
109  bRightSizer = new wxBoxSizer( wxVERTICAL );
110 
111  wxFlexGridSizer* fgSizerTextsSizes;
112  fgSizerTextsSizes = new wxFlexGridSizer( 0, 3, 0, 0 );
113  fgSizerTextsSizes->AddGrowableCol( 1 );
114  fgSizerTextsSizes->SetFlexibleDirection( wxBOTH );
115  fgSizerTextsSizes->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL );
116 
117  m_staticTextNameSize = new wxStaticText( this, ID_M_STATICTEXTNAMESIZE, _("N&ame text size:"), wxDefaultPosition, wxDefaultSize, 0 );
118  m_staticTextNameSize->Wrap( -1 );
119  fgSizerTextsSizes->Add( m_staticTextNameSize, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
120 
121  m_textPinNameTextSize = new wxTextCtrl( this, ID_M_TEXTPINNAMETEXTSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
122  fgSizerTextsSizes->Add( m_textPinNameTextSize, 1, wxEXPAND|wxTOP|wxBOTTOM, 3 );
123 
124  m_staticNameTextSizeUnits = new wxStaticText( this, ID_M_STATICNAMETEXTSIZEUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
125  m_staticNameTextSizeUnits->Wrap( -1 );
126  fgSizerTextsSizes->Add( m_staticNameTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
127 
128  m_staticTextPadNameSize = new wxStaticText( this, ID_M_STATICTEXTPADNAMESIZE, _("Number te&xt size:"), wxDefaultPosition, wxDefaultSize, 0 );
129  m_staticTextPadNameSize->Wrap( -1 );
130  fgSizerTextsSizes->Add( m_staticTextPadNameSize, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
131 
132  m_textPadNameTextSize = new wxTextCtrl( this, ID_M_TEXTPADNAMETEXTSIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
133  fgSizerTextsSizes->Add( m_textPadNameTextSize, 0, wxEXPAND|wxTOP, 3 );
134 
135  m_staticNumberTextSizeUnits = new wxStaticText( this, ID_M_STATICNUMBERTEXTSIZEUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
136  m_staticNumberTextSizeUnits->Wrap( -1 );
137  fgSizerTextsSizes->Add( m_staticNumberTextSizeUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
138 
139  m_staticTextPinLen = new wxStaticText( this, ID_M_STATICTEXTPINLEN, _("&Length:"), wxDefaultPosition, wxDefaultSize, 0 );
140  m_staticTextPinLen->Wrap( -1 );
141  fgSizerTextsSizes->Add( m_staticTextPinLen, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
142 
143  m_textLength = new wxTextCtrl( this, ID_M_TEXTLENGTH, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
144  fgSizerTextsSizes->Add( m_textLength, 0, wxEXPAND|wxTOP, 5 );
145 
146  m_staticLengthUnits = new wxStaticText( this, ID_M_STATICLENGTHUNITS, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
147  m_staticLengthUnits->Wrap( -1 );
148  fgSizerTextsSizes->Add( m_staticLengthUnits, 0, wxALL, 5 );
149 
150  m_staticTextPinPosX = new wxStaticText( this, wxID_ANY, _("Pin Pos X:"), wxDefaultPosition, wxDefaultSize, 0 );
151  m_staticTextPinPosX->Wrap( -1 );
152  fgSizerTextsSizes->Add( m_staticTextPinPosX, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
153 
154  m_textPinPosX = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
155  fgSizerTextsSizes->Add( m_textPinPosX, 0, wxEXPAND|wxTOP, 5 );
156 
157  m_staticPosXUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
158  m_staticPosXUnits->Wrap( -1 );
159  fgSizerTextsSizes->Add( m_staticPosXUnits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
160 
161  m_staticPinPosY = new wxStaticText( this, wxID_ANY, _("Pin Pos Y:"), wxDefaultPosition, wxDefaultSize, 0 );
162  m_staticPinPosY->Wrap( -1 );
163  fgSizerTextsSizes->Add( m_staticPinPosY, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
164 
165  m_textPinPosY = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
166  fgSizerTextsSizes->Add( m_textPinPosY, 0, wxEXPAND|wxTOP, 5 );
167 
168  m_staticPosYUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
169  m_staticPosYUnits->Wrap( -1 );
170  fgSizerTextsSizes->Add( m_staticPosYUnits, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
171 
172 
173  bRightSizer->Add( fgSizerTextsSizes, 0, wxALL|wxEXPAND, 5 );
174 
175  m_panelShowPin = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
176  m_panelShowPin->SetMinSize( wxSize( 150,150 ) );
177 
178  bRightSizer->Add( m_panelShowPin, 1, wxEXPAND | wxALL, 5 );
179 
180 
181  bUpperSizer->Add( bRightSizer, 1, wxEXPAND|wxRIGHT, 5 );
182 
183 
184  mainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
185 
186  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
187  mainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
188 
189  m_sdbSizerButtons = new wxStdDialogButtonSizer();
190  m_sdbSizerButtonsOK = new wxButton( this, wxID_OK );
192  m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL );
194  m_sdbSizerButtons->Realize();
195 
196  mainSizer->Add( m_sdbSizerButtons, 0, wxALL|wxALIGN_RIGHT, 5 );
197 
198 
199  this->SetSizer( mainSizer );
200  this->Layout();
201 
202  this->Centre( wxBOTH );
203 
204  // Connect Events
205  this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnCloseDialog ) );
206  this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnInitDialog ) );
207  m_textPinName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
208  m_textPadName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
209  m_choiceOrientation->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
210  m_choiceElectricalType->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
211  m_choiceStyle->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
212  m_checkApplyToAllParts->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
213  m_checkApplyToAllConversions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
214  m_checkShow->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
215  m_textPinNameTextSize->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
216  m_textPadNameTextSize->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
217  m_textLength->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
218  m_panelShowPin->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPaintShowPanel ), NULL, this );
219  m_sdbSizerButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnCancelButtonClick ), NULL, this );
220  m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnOKButtonClick ), NULL, this );
221 }
222 
224 {
225  // Disconnect Events
226  this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnCloseDialog ) );
227  this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnInitDialog ) );
228  m_textPinName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
229  m_textPadName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
230  m_choiceOrientation->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
231  m_choiceElectricalType->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
232  m_choiceStyle->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
233  m_checkApplyToAllParts->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
234  m_checkApplyToAllConversions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
235  m_checkShow->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
236  m_textPinNameTextSize->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
237  m_textPadNameTextSize->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
238  m_textLength->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
239  m_panelShowPin->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPaintShowPanel ), NULL, this );
240  m_sdbSizerButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnCancelButtonClick ), NULL, this );
241  m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnOKButtonClick ), NULL, this );
242 
243 }
virtual void OnCloseDialog(wxCloseEvent &event)
virtual void OnInitDialog(wxInitDialogEvent &event)
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:60
virtual void OnOKButtonClick(wxCommandEvent &event)
ComboBox widget for pin shape.
virtual void OnPropertiesChange(wxCommandEvent &event)
DIALOG_LIB_EDIT_PIN_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Pin Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(625, 428), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void OnPaintShowPanel(wxPaintEvent &event)
virtual void OnCancelButtonClick(wxCommandEvent &event)
wxStdDialogButtonSizer * m_sdbSizerButtons
wxBitmapComboBox * m_choiceOrientation
PinTypeComboBox * m_choiceElectricalType
ComboBox widget for pin type.