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->SetMinSize( wxSize( 30,30 ) );
79 
80  bButtonSize->Add( m_bpAdd, 0, wxRIGHT, 5 );
81 
82  m_bpMoveUp = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
83  m_bpMoveUp->SetMinSize( wxSize( 30,30 ) );
84 
85  bButtonSize->Add( m_bpMoveUp, 0, wxRIGHT, 5 );
86 
87  m_bpMoveDown = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
88  m_bpMoveDown->SetMinSize( wxSize( 30,30 ) );
89 
90  bButtonSize->Add( m_bpMoveDown, 0, wxRIGHT, 5 );
91 
92 
93  bButtonSize->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
94 
95  m_bpDelete = new wxBitmapButton( sbFields->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
96  m_bpDelete->SetMinSize( wxSize( 30,30 ) );
97 
98  bButtonSize->Add( m_bpDelete, 0, wxRIGHT, 5 );
99 
100 
101  bButtonSize->Add( 0, 0, 1, wxEXPAND, 5 );
102 
103  m_updateFieldValues = new wxButton( sbFields->GetStaticBox(), wxID_ANY, _(" Update Fields from Library... "), wxDefaultPosition, wxDefaultSize, 0 );
104  m_updateFieldValues->SetToolTip( _("Sets fields to the original library values") );
105 
106  bButtonSize->Add( m_updateFieldValues, 0, wxALL|wxEXPAND, 5 );
107 
108 
109  sbFields->Add( bButtonSize, 0, wxEXPAND, 10 );
110 
111 
112  mainSizer->Add( sbFields, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
113 
114  wxBoxSizer* lowerSizer;
115  lowerSizer = new wxBoxSizer( wxHORIZONTAL );
116 
117  wxStaticBoxSizer* sbSizerLibraryReference;
118  sbSizerLibraryReference = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbol") ), wxVERTICAL );
119 
120  wxFlexGridSizer* fgSizer1;
121  fgSizer1 = new wxFlexGridSizer( 3, 2, 0, 0 );
122  fgSizer1->AddGrowableCol( 1 );
123  fgSizer1->SetFlexibleDirection( wxBOTH );
124  fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
125 
126  m_staticText3 = new wxStaticText( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Library Reference:"), wxDefaultPosition, wxDefaultSize, 0 );
127  m_staticText3->Wrap( -1 );
128  fgSizer1->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
129 
130  wxBoxSizer* bLibraryReferenceSizer;
131  bLibraryReferenceSizer = new wxBoxSizer( wxHORIZONTAL );
132 
133  m_libraryNameTextCtrl = new wxTextCtrl( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
134  m_libraryNameTextCtrl->SetToolTip( _("Name of the symbol in the library to which this symbol is linked") );
135 
136  bLibraryReferenceSizer->Add( m_libraryNameTextCtrl, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
137 
138  m_buttonBrowseLibrary = new wxBitmapButton( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
139  m_buttonBrowseLibrary->SetMinSize( wxSize( 30,29 ) );
140 
141  bLibraryReferenceSizer->Add( m_buttonBrowseLibrary, 0, wxALIGN_CENTER_VERTICAL, 5 );
142 
143 
144  fgSizer1->Add( bLibraryReferenceSizer, 1, wxEXPAND|wxRIGHT, 5 );
145 
146  m_unitLabel = new wxStaticText( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Unit:"), wxDefaultPosition, wxDefaultSize, 0 );
147  m_unitLabel->Wrap( -1 );
148  fgSizer1->Add( m_unitLabel, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
149 
150  wxArrayString m_unitChoiceChoices;
151  m_unitChoice = new wxChoice( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_unitChoiceChoices, 0 );
152  m_unitChoice->SetSelection( 0 );
153  m_unitChoice->SetMinSize( wxSize( 100,-1 ) );
154 
155  fgSizer1->Add( m_unitChoice, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
156 
157 
158  fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
159 
160  m_cbAlternateSymbol = new wxCheckBox( sbSizerLibraryReference->GetStaticBox(), wxID_ANY, _("Alternate symbol (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
161  m_cbAlternateSymbol->SetToolTip( _("Use the alternate shape of this symbol.\nFor gates, this is the \"De Morgan\" conversion") );
162 
163  fgSizer1->Add( m_cbAlternateSymbol, 0, wxALL, 5 );
164 
165 
166  sbSizerLibraryReference->Add( fgSizer1, 0, wxEXPAND, 5 );
167 
168 
169  lowerSizer->Add( sbSizerLibraryReference, 5, wxEXPAND|wxRIGHT|wxLEFT, 10 );
170 
171  wxString m_rbOrientationChoices[] = { _("0"), _("+90"), _("+180"), _("-90") };
172  int m_rbOrientationNChoices = sizeof( m_rbOrientationChoices ) / sizeof( wxString );
173  m_rbOrientation = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_rbOrientationNChoices, m_rbOrientationChoices, 1, wxRA_SPECIFY_COLS );
174  m_rbOrientation->SetSelection( 0 );
175  m_rbOrientation->SetToolTip( _("Select if the symbol is to be rotated when drawn") );
176 
177  lowerSizer->Add( m_rbOrientation, 2, wxEXPAND|wxRIGHT|wxLEFT, 8 );
178 
179  wxString m_rbMirrorChoices[] = { _("Default"), _("Mirror around X axis "), _("Mirror around Y axis ") };
180  int m_rbMirrorNChoices = sizeof( m_rbMirrorChoices ) / sizeof( wxString );
181  m_rbMirror = new wxRadioBox( this, wxID_ANY, _("Aspect"), wxDefaultPosition, wxDefaultSize, m_rbMirrorNChoices, m_rbMirrorChoices, 1, wxRA_SPECIFY_COLS );
182  m_rbMirror->SetSelection( 2 );
183  m_rbMirror->SetToolTip( _("Pick the graphical transformation to be used when displaying the symbol") );
184 
185  lowerSizer->Add( m_rbMirror, 2, wxEXPAND|wxRIGHT|wxLEFT, 8 );
186 
187 
188  mainSizer->Add( lowerSizer, 0, wxEXPAND|wxTOP|wxRIGHT, 5 );
189 
190  m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
191  mainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
192 
193  wxBoxSizer* bSizer101;
194  bSizer101 = new wxBoxSizer( wxHORIZONTAL );
195 
196  wxBoxSizer* bSizer11;
197  bSizer11 = new wxBoxSizer( wxHORIZONTAL );
198 
199  wxStaticText* timeStampLabel;
200  timeStampLabel = new wxStaticText( this, wxID_ANY, _("Unique ID:"), wxDefaultPosition, wxDefaultSize, 0 );
201  timeStampLabel->Wrap( -1 );
202  bSizer11->Add( timeStampLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
203 
204  m_textCtrlTimeStamp = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
205  m_textCtrlTimeStamp->SetToolTip( _("Unique ID that identifies the symbol") );
206 
207  bSizer11->Add( m_textCtrlTimeStamp, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
208 
209 
210  bSizer101->Add( bSizer11, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
211 
212 
213  bSizer101->Add( 0, 0, 1, wxEXPAND, 5 );
214 
215  m_spiceFieldsButton = new wxButton( this, wxID_ANY, _(" Edit Spice Model... "), wxDefaultPosition, wxDefaultSize, 0 );
216  bSizer101->Add( m_spiceFieldsButton, 0, wxEXPAND|wxALL, 5 );
217 
218 
219  bSizer101->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
220 
221  m_stdDialogButtonSizer = new wxStdDialogButtonSizer();
222  m_stdDialogButtonSizerOK = new wxButton( this, wxID_OK );
224  m_stdDialogButtonSizerCancel = new wxButton( this, wxID_CANCEL );
226  m_stdDialogButtonSizer->Realize();
227 
228  bSizer101->Add( m_stdDialogButtonSizer, 0, wxEXPAND|wxALL, 5 );
229 
230 
231  mainSizer->Add( bSizer101, 0, wxEXPAND, 5 );
232 
233 
234  this->SetSizer( mainSizer );
235  this->Layout();
236  mainSizer->Fit( this );
237 
238  // Connect Events
239  this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnInitDlg ) );
240  this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnUpdateUI ) );
241  m_grid->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnSizeGrid ), NULL, this );
242  m_bpAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnAddField ), NULL, this );
243  m_bpMoveUp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveUp ), NULL, this );
244  m_bpMoveDown->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveDown ), NULL, this );
245  m_bpDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnDeleteField ), NULL, this );
246  m_updateFieldValues->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::UpdateFieldsFromLibrary ), NULL, this );
247  m_buttonBrowseLibrary->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this );
248  m_spiceFieldsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this );
249 }
250 
252 {
253  // Disconnect Events
254  this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnInitDlg ) );
255  this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnUpdateUI ) );
256  m_grid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnSizeGrid ), NULL, this );
257  m_bpAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnAddField ), NULL, this );
258  m_bpMoveUp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveUp ), NULL, this );
259  m_bpMoveDown->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnMoveDown ), NULL, this );
260  m_bpDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnDeleteField ), NULL, this );
261  m_updateFieldValues->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::UpdateFieldsFromLibrary ), NULL, this );
262  m_buttonBrowseLibrary->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnBrowseLibrary ), NULL, this );
263  m_spiceFieldsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EDIT_COMPONENT_IN_SCHEMATIC_BASE::OnEditSpiceModel ), NULL, this );
264 
265 }
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:53
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)