KiCad PCB EDA Suite
dialog_edit_component_in_schematic_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 30 2017)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
8 #include "widgets/wx_grid.h"
9 
11 
13 
14 DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
15 {
16  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
17 
18  wxBoxSizer* mainSizer;
19  mainSizer = new wxBoxSizer( wxVERTICAL );
20 
21  wxStaticBoxSizer* sbFields;
22  sbFields = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields") ), wxVERTICAL );
23 
24  m_grid = new WX_GRID( sbFields->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
25 
26  // Grid
27  m_grid->CreateGrid( 4, 11 );
28  m_grid->EnableEditing( true );
29  m_grid->EnableGridLines( true );
30  m_grid->EnableDragGridSize( false );
31  m_grid->SetMargins( 0, 0 );
32 
33  // Columns
34  m_grid->SetColSize( 0, 72 );
35  m_grid->SetColSize( 1, 120 );
36  m_grid->SetColSize( 2, 48 );
37  m_grid->SetColSize( 3, 72 );
38  m_grid->SetColSize( 4, 72 );
39  m_grid->SetColSize( 5, 48 );
40  m_grid->SetColSize( 6, 48 );
41  m_grid->SetColSize( 7, 84 );
42  m_grid->SetColSize( 8, 84 );
43  m_grid->SetColSize( 9, 84 );
44  m_grid->SetColSize( 10, 84 );
45  m_grid->EnableDragColMove( false );
46  m_grid->EnableDragColSize( true );
47  m_grid->SetColLabelSize( 22 );
48  m_grid->SetColLabelValue( 0, _("Name") );
49  m_grid->SetColLabelValue( 1, _("Value") );
50  m_grid->SetColLabelValue( 2, _("Show") );
51  m_grid->SetColLabelValue( 3, _("H Align") );
52  m_grid->SetColLabelValue( 4, _("V Align") );
53  m_grid->SetColLabelValue( 5, _("Italic") );
54  m_grid->SetColLabelValue( 6, _("Bold") );
55  m_grid->SetColLabelValue( 7, _("Text Size") );
56  m_grid->SetColLabelValue( 8, _("Orientation") );
57  m_grid->SetColLabelValue( 9, _("X Position") );
58  m_grid->SetColLabelValue( 10, _("Y Position") );
59  m_grid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
60 
61  // Rows
62  m_grid->EnableDragRowSize( true );
63  m_grid->SetRowLabelSize( 0 );
64  m_grid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
65 
66  // Label Appearance
67 
68  // Cell Defaults
69  m_grid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
70  m_grid->SetMinSize( wxSize( -1,180 ) );
71 
72  sbFields->Add( m_grid, 1, wxEXPAND|wxBOTTOM, 5 );
73 
74  wxBoxSizer* bButtonSize;
75  bButtonSize = new wxBoxSizer( wxHORIZONTAL );
76 
77  m_bpAdd = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
78  m_bpAdd->SetToolTip( _("Add field") );
79  m_bpAdd->SetMinSize( wxSize( 30,30 ) );
80 
81  bButtonSize->Add( m_bpAdd, 0, wxRIGHT, 5 );
82 
83  m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
84  m_bpMoveUp->SetToolTip( _("Move up") );
85  m_bpMoveUp->SetMinSize( wxSize( 30,30 ) );
86 
87  bButtonSize->Add( m_bpMoveUp, 0, wxRIGHT, 5 );
88 
89  m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
90  m_bpMoveDown->SetToolTip( _("Move down") );
91  m_bpMoveDown->SetMinSize( wxSize( 30,30 ) );
92 
93  bButtonSize->Add( m_bpMoveDown, 0, wxRIGHT, 5 );
94 
95 
96  bButtonSize->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
97 
98  m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
99  m_bpDelete->SetToolTip( _("Delete field") );
100  m_bpDelete->SetMinSize( wxSize( 30,30 ) );
101 
102  bButtonSize->Add( m_bpDelete, 0, wxRIGHT, 5 );
103 
104 
105  bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
106 
107  m_updateFieldValues = new wxButton( sbFields->GetStaticBox(), wxID_ANY, _("Update Fields from Library..."), wxDefaultPosition, wxDefaultSize, 0 );
108  m_updateFieldValues->SetToolTip( _("Sets fields to the original library values") );
109 
110  bButtonSize->Add( m_updateFieldValues, 0, wxALL|wxEXPAND, 5 );
111 
112 
113  sbFields->Add( bButtonSize, 0, wxEXPAND, 10 );
114 
115 
116  mainSizer->Add( sbFields, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
117 
118  wxBoxSizer* lowerSizer;
119  lowerSizer = new wxBoxSizer( wxHORIZONTAL );
120 
121  wxStaticBoxSizer* sbSizerLibraryReference;
122  sbSizerLibraryReference = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbol") ), wxVERTICAL );
123 
124  wxFlexGridSizer* fgSizer1;
125  fgSizer1 = new wxFlexGridSizer( 3, 2, 0, 0 );
126  fgSizer1->AddGrowableCol( 1 );
127  fgSizer1->SetFlexibleDirection( wxBOTH );
128  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
129 
130  m_staticText3 = new wxStaticText( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Library Reference:"), wxDefaultPosition, wxDefaultSize, 0 );
131  m_staticText3->Wrap( -1 );
132  fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
133 
134  wxBoxSizer* bLibraryReferenceSizer;
135  bLibraryReferenceSizer = new wxBoxSizer( wxHORIZONTAL );
136 
137  m_libraryNameTextCtrl = new wxTextCtrl( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
138  m_libraryNameTextCtrl->SetToolTip( _("Name of the symbol in the library to which this symbol is linked") );
139 
140  bLibraryReferenceSizer->Add( m_libraryNameTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
141 
142  m_buttonBrowseLibrary = new wxBitmapButton( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
143  m_buttonBrowseLibrary->SetToolTip( _("Browse library") );
144  m_buttonBrowseLibrary->SetMinSize( wxSize( 30,29 ) );
145 
146  bLibraryReferenceSizer->Add( m_buttonBrowseLibrary, 0, wxALIGN_CENTER_VERTICAL, 5 );
147 
148 
149  fgSizer1->Add( bLibraryReferenceSizer, 1, wxEXPAND|wxRIGHT, 5 );
150 
151  m_unitLabel = new wxStaticText( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Unit:"), wxDefaultPosition, wxDefaultSize, 0 );
152  m_unitLabel->Wrap( -1 );
153  fgSizer1->Add( m_unitLabel, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
154 
155  wxArrayString m_unitChoiceChoices;
156  m_unitChoice = new wxChoice( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_unitChoiceChoices, 0 );
157  m_unitChoice->SetSelection( 0 );
158  m_unitChoice->SetMinSize( wxSize( 100,-1 ) );
159 
160  fgSizer1->Add( m_unitChoice, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
161 
162 
163  fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
164 
165  m_cbAlternateSymbol = new wxCheckBox( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Alternate symbol (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
166  m_cbAlternateSymbol->SetToolTip( _("Use the alternate shape of this symbol.\nFor gates, this is the \"De Morgan\" conversion") );
167 
168  fgSizer1->Add( m_cbAlternateSymbol, 0, wxALL, 5 );
169 
170 
171  sbSizerLibraryReference->Add( fgSizer1, 0, wxEXPAND, 5 );
172 
173 
174  lowerSizer->Add( sbSizerLibraryReference, 5, wxEXPAND|wxRIGHT|wxLEFT, 10 );
175 
176  wxString m_rbOrientationChoices[] = { _("0"), _("+90"), _("+180"), _("-90") };
177  int m_rbOrientationNChoices = sizeof( m_rbOrientationChoices ) / sizeof( wxString );
178  m_rbOrientation = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_rbOrientationNChoices, m_rbOrientationChoices, 1, wxRA_SPECIFY_COLS );
179  m_rbOrientation->SetSelection( 0 );
180  m_rbOrientation->SetToolTip( _("Select if the symbol is to be rotated when drawn") );
181 
182  lowerSizer->Add( m_rbOrientation, 2, wxEXPAND|wxRIGHT|wxLEFT, 8 );
183 
184  wxString m_rbMirrorChoices[] = { _("Default"), _("Mirror around X axis"), _("Mirror around Y axis") };
185  int m_rbMirrorNChoices = sizeof( m_rbMirrorChoices ) / sizeof( wxString );
186  m_rbMirror = new wxRadioBox( this, wxID_ANY, _("Aspect"), wxDefaultPosition, wxDefaultSize, m_rbMirrorNChoices, m_rbMirrorChoices, 1, wxRA_SPECIFY_COLS );
187  m_rbMirror->SetSelection( 1 );
188  m_rbMirror->SetToolTip( _("Pick the graphical transformation to be used when displaying the symbol") );
189 
190  lowerSizer->Add( m_rbMirror, 2, wxEXPAND|wxRIGHT|wxLEFT, 8 );
191 
192 
193  mainSizer->Add( lowerSizer, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
194 
195  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
196  mainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
197 
198  wxBoxSizer* bSizer101;
199  bSizer101 = new wxBoxSizer( wxHORIZONTAL );
200 
201  wxBoxSizer* bSizer11;
202  bSizer11 = new wxBoxSizer( wxHORIZONTAL );
203 
204  wxStaticText* timeStampLabel;
205  timeStampLabel = new wxStaticText( this, wxID_ANY, _("Unique ID:"), wxDefaultPosition, wxDefaultSize, 0 );
206  timeStampLabel->Wrap( -1 );
207  bSizer11->Add( timeStampLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
208 
209  m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
210  m_textCtrlTimeStamp->SetToolTip( _("Unique ID that identifies the symbol") );
211 
212  bSizer11->Add( m_textCtrlTimeStamp, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
213 
214 
215  bSizer101->Add( bSizer11, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
216 
217 
218  bSizer101->Add( 0, 0, 1, wxEXPAND, 5 );
219 
220  m_spiceFieldsButton = new wxButton( this, wxID_ANY, _("Edit Spice Model..."), wxDefaultPosition, wxDefaultSize, 0 );
221  bSizer101->Add( m_spiceFieldsButton, 0, wxEXPAND|wxALL, 5 );
222 
223 
224  bSizer101->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 15 );
225 
226  m_stdDialogButtonSizer = new wxStdDialogButtonSizer();
227  m_stdDialogButtonSizerOK = new wxButton( this, wxID_OK );
229  m_stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL );
231  m_stdDialogButtonSizer->Realize();
232 
233  bSizer101->Add( m_stdDialogButtonSizer, 0, wxEXPAND|wxALL, 5 );
234 
235 
236  mainSizer->Add( bSizer101, 0, wxEXPAND, 5 );
237 
238 
239  this->SetSizer( mainSizer );
240  this->Layout();
241  mainSizer->Fit( this );
242 
243  // Connect Events
244  this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnInitDlg ) );
245  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnUpdateUI ) );
246  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnSizeGrid ), NULL, this );
247  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnAddField ), NULL, this );
248  m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveUp ), NULL, this );
249  m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveDown ), NULL, this );
250  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnDeleteField ), NULL, this );
251  m_updateFieldValues->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::UpdateFieldsFromLibrary ), NULL, this );
252  m_buttonBrowseLibrary->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this );
253  m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this );
254 }
255 
257 {
258  // Disconnect Events
259  this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnInitDlg ) );
260  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnUpdateUI ) );
261  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnSizeGrid ), NULL, this );
262  m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnAddField ), NULL, this );
263  m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveUp ), NULL, this );
264  m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveDown ), NULL, this );
265  m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnDeleteField ), NULL, this );
266  m_updateFieldValues->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::UpdateFieldsFromLibrary ), NULL, this );
267  m_buttonBrowseLibrary->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this );
268  m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this );
269 
270 }
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:83
DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Symbol Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU)