KiCad PCB EDA Suite
dialog_import_gfx_base.cpp
Go to the documentation of this file.
1
2// C++ code generated with wxFormBuilder (version Oct 26 2018)
3// http://www.wxformbuilder.org/
4//
5// PLEASE DO *NOT* EDIT THIS FILE!
7
9
11
13
14DIALOG_IMPORT_GFX_BASE::DIALOG_IMPORT_GFX_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* bSizerMain;
19 bSizerMain = new wxBoxSizer( wxVERTICAL );
20
21 wxBoxSizer* bSizerFile;
22 bSizerFile = new wxBoxSizer( wxHORIZONTAL );
23
24 m_staticTextFile = new wxStaticText( this, wxID_ANY, _("File"), wxDefaultPosition, wxDefaultSize, 0 );
25 m_staticTextFile->Wrap( -1 );
26 m_staticTextFile->SetToolTip( _("Only vectors will be imported. Bitmaps and fonts will be ignored.") );
27
28 bSizerFile->Add( m_staticTextFile, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
29
30 m_textCtrlFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
31 m_textCtrlFileName->SetToolTip( _("Only vectors will be imported. Bitmaps and fonts will be ignored.") );
32 m_textCtrlFileName->SetMinSize( wxSize( 300,-1 ) );
33
34 bSizerFile->Add( m_textCtrlFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
35
36 m_browseButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW|0 );
37 bSizerFile->Add( m_browseButton, 0, wxALL, 5 );
38
39
40 bSizerMain->Add( bSizerFile, 0, wxALL|wxEXPAND, 10 );
41
42 wxStaticBoxSizer* sbSizer2;
43 sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Placement") ), wxVERTICAL );
44
45 wxBoxSizer* bSizerOptions;
46 bSizerOptions = new wxBoxSizer( wxVERTICAL );
47
48 m_rbInteractivePlacement = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_ANY, _("Interactive placement"), wxDefaultPosition, wxDefaultSize, 0 );
49 m_rbInteractivePlacement->SetValue( true );
50 bSizerOptions->Add( m_rbInteractivePlacement, 0, wxEXPAND|wxBOTTOM, 5 );
51
52 wxBoxSizer* bSizerUserPos;
53 bSizerUserPos = new wxBoxSizer( wxHORIZONTAL );
54
55 m_rbAbsolutePlacement = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_ANY, _("At"), wxDefaultPosition, wxDefaultSize, 0 );
56 bSizerUserPos->Add( m_rbAbsolutePlacement, 0, wxALIGN_CENTER_VERTICAL, 5 );
57
58 wxBoxSizer* bSizerPosSettings;
59 bSizerPosSettings = new wxBoxSizer( wxHORIZONTAL );
60
61 m_staticTextXpos = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
62 m_staticTextXpos->Wrap( -1 );
63 bSizerPosSettings->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
64
65 m_DxfPcbXCoord = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
66 #ifdef __WXGTK__
67 if ( !m_DxfPcbXCoord->HasFlag( wxTE_MULTILINE ) )
68 {
69 m_DxfPcbXCoord->SetMaxLength( 10 );
70 }
71 #else
72 m_DxfPcbXCoord->SetMaxLength( 10 );
73 #endif
74 m_DxfPcbXCoord->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") );
75
76 bSizerPosSettings->Add( m_DxfPcbXCoord, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
77
78 m_staticTextYpos = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
79 m_staticTextYpos->Wrap( -1 );
80 bSizerPosSettings->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
81
82 m_DxfPcbYCoord = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
83 #ifdef __WXGTK__
84 if ( !m_DxfPcbYCoord->HasFlag( wxTE_MULTILINE ) )
85 {
86 m_DxfPcbYCoord->SetMaxLength( 10 );
87 }
88 #else
89 m_DxfPcbYCoord->SetMaxLength( 10 );
90 #endif
91 m_DxfPcbYCoord->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") );
92
93 bSizerPosSettings->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
94
95 m_staticTextUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Units"), wxDefaultPosition, wxDefaultSize, 0 );
96 m_staticTextUnits->Wrap( -1 );
97 bSizerPosSettings->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
98
99 wxString m_DxfPcbPositionUnitsChoices[] = { _("mm"), _("inch") };
100 int m_DxfPcbPositionUnitsNChoices = sizeof( m_DxfPcbPositionUnitsChoices ) / sizeof( wxString );
101 m_DxfPcbPositionUnits = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DxfPcbPositionUnitsNChoices, m_DxfPcbPositionUnitsChoices, 0 );
102 m_DxfPcbPositionUnits->SetSelection( 0 );
103 m_DxfPcbPositionUnits->SetToolTip( _("Select PCB grid units") );
104
105 bSizerPosSettings->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
106
107
108 bSizerUserPos->Add( bSizerPosSettings, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 );
109
110
111 bSizerOptions->Add( bSizerUserPos, 0, wxEXPAND, 5 );
112
113
114 sbSizer2->Add( bSizerOptions, 0, wxEXPAND, 5 );
115
116
117 bSizerMain->Add( sbSizer2, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
118
119 wxStaticBoxSizer* sbSizer1;
120 sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Import Parameters") ), wxVERTICAL );
121
122 wxBoxSizer* bSizer7;
123 bSizer7 = new wxBoxSizer( wxHORIZONTAL );
124
125 wxFlexGridSizer* fgSizerImportSettings;
126 fgSizerImportSettings = new wxFlexGridSizer( 0, 3, 5, 5 );
127 fgSizerImportSettings->AddGrowableCol( 1 );
128 fgSizerImportSettings->SetFlexibleDirection( wxBOTH );
129 fgSizerImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
130
131 m_staticTextBrdlayer = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Graphic layer:"), wxDefaultPosition, wxDefaultSize, 0 );
132 m_staticTextBrdlayer->Wrap( -1 );
133 fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL, 5 );
134
135 m_SelLayerBox = new PCB_LAYER_BOX_SELECTOR( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
136 fgSizerImportSettings->Add( m_SelLayerBox, 0, wxEXPAND, 5 );
137
138
139 fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
140
141 m_staticTextscale = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Import scale:"), wxDefaultPosition, wxDefaultSize, 0 );
142 m_staticTextscale->Wrap( -1 );
143 fgSizerImportSettings->Add( m_staticTextscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
144
145 m_textCtrlImportScale = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
146 fgSizerImportSettings->Add( m_textCtrlImportScale, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
147
148
149 fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
150
151
152 bSizer7->Add( fgSizerImportSettings, 1, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
153
154
155 sbSizer1->Add( bSizer7, 1, wxEXPAND, 5 );
156
157 m_staticline1 = new wxStaticLine( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
158 sbSizer1->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
159
160 wxBoxSizer* bSizer8;
161 bSizer8 = new wxBoxSizer( wxVERTICAL );
162
163 m_groupItems = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Group items"), wxDefaultPosition, wxDefaultSize, 0 );
164 m_groupItems->SetToolTip( _("Add all imported items into a new group") );
165
166 bSizer8->Add( m_groupItems, 0, wxEXPAND|wxBOTTOM, 5 );
167
168
169 sbSizer1->Add( bSizer8, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
170
171
172 bSizerMain->Add( sbSizer1, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 10 );
173
174 wxStaticBoxSizer* sbSizer3;
175 sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF Parameters") ), wxVERTICAL );
176
177 wxBoxSizer* bSizer81;
178 bSizer81 = new wxBoxSizer( wxHORIZONTAL );
179
180 wxFlexGridSizer* fgDxfImportSettings;
181 fgDxfImportSettings = new wxFlexGridSizer( 0, 3, 5, 5 );
182 fgDxfImportSettings->AddGrowableCol( 1 );
183 fgDxfImportSettings->SetFlexibleDirection( wxBOTH );
184 fgDxfImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
185
186 m_staticTextLineWidth = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
187 m_staticTextLineWidth->Wrap( -1 );
188 fgDxfImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
189
190 m_textCtrlLineWidth = new wxTextCtrl( sbSizer3->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
191 fgDxfImportSettings->Add( m_textCtrlLineWidth, 0, wxEXPAND, 5 );
192
193 wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
194 int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
195 m_choiceUnitLineWidth = new wxChoice( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
196 m_choiceUnitLineWidth->SetSelection( 0 );
197 fgDxfImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
198
199 m_staticTextLineWidth1 = new wxStaticText( sbSizer3->GetStaticBox(), wxID_ANY, _("Default units:"), wxDefaultPosition, wxDefaultSize, 0 );
200 m_staticTextLineWidth1->Wrap( -1 );
201 fgDxfImportSettings->Add( m_staticTextLineWidth1, 0, wxALIGN_CENTER_VERTICAL, 5 );
202
203 wxArrayString m_choiceDxfUnitsChoices;
204 m_choiceDxfUnits = new wxChoice( sbSizer3->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceDxfUnitsChoices, 0 );
205 m_choiceDxfUnits->SetSelection( 0 );
206 fgDxfImportSettings->Add( m_choiceDxfUnits, 0, wxEXPAND, 5 );
207
208
209 fgDxfImportSettings->Add( 0, 0, 1, wxEXPAND, 5 );
210
211
212 bSizer81->Add( fgDxfImportSettings, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
213
214
215 sbSizer3->Add( bSizer81, 1, wxEXPAND, 5 );
216
217
218 bSizerMain->Add( sbSizer3, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
219
220 m_sdbSizer = new wxStdDialogButtonSizer();
221 m_sdbSizerOK = new wxButton( this, wxID_OK );
222 m_sdbSizer->AddButton( m_sdbSizerOK );
223 m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
224 m_sdbSizer->AddButton( m_sdbSizerCancel );
225 m_sdbSizer->Realize();
226
227 bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
228
229
230 this->SetSizer( bSizerMain );
231 this->Layout();
232 bSizerMain->Fit( this );
233
234 this->Centre( wxBOTH );
235
236 // Connect Events
237 m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onBrowseFiles ), NULL, this );
238 m_rbInteractivePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onInteractivePlacement ), NULL, this );
239 m_rbInteractivePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
240 m_rbAbsolutePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
241 m_rbAbsolutePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
242 m_DxfPcbPositionUnits->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
243 m_groupItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onGroupItems ), NULL, this );
244 m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
245}
246
248{
249 // Disconnect Events
250 m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onBrowseFiles ), NULL, this );
251 m_rbInteractivePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onInteractivePlacement ), NULL, this );
252 m_rbInteractivePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
253 m_rbAbsolutePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
254 m_rbAbsolutePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
255 m_DxfPcbPositionUnits->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
256 m_groupItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onGroupItems ), NULL, this );
257 m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
258
259}
virtual void onAbsolutePlacement(wxCommandEvent &event)
virtual void onUnitPositionSelection(wxCommandEvent &event)
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
wxRadioButton * m_rbInteractivePlacement
virtual void onBrowseFiles(wxCommandEvent &event)
DIALOG_IMPORT_GFX_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Import Vector Graphics File"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
virtual void onInteractivePlacement(wxCommandEvent &event)
virtual void onGroupItems(wxCommandEvent &event)
wxStaticText * m_staticTextLineWidth
virtual void onUnitWidthSelection(wxCommandEvent &event)
wxStdDialogButtonSizer * m_sdbSizer
virtual void originOptionOnUpdateUI(wxUpdateUIEvent &event)
wxRadioButton * m_rbAbsolutePlacement
wxStaticText * m_staticTextLineWidth1
Dialog helper object to sit in the inheritance tree between wxDialog and any class written by wxFormB...
Definition: dialog_shim.h:83
Class to display a pcb layer list in a wxBitmapComboBox.
#define _(s)