KiCad PCB EDA Suite
dialog_import_gfx_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Dec 1 2018)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO *NOT* EDIT THIS FILE!
7 
9 
10 #include "dialog_import_gfx_base.h"
11 
13 
14 DIALOG_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  bSizerFile->Add( m_staticTextFile, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
27 
28  m_textCtrlFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
29  m_textCtrlFileName->SetMinSize( wxSize( 300,-1 ) );
30 
31  bSizerFile->Add( m_textCtrlFileName, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
32 
33  m_buttonBrowse = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
34  bSizerFile->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
35 
36 
37  bSizerMain->Add( bSizerFile, 0, wxALL|wxEXPAND, 5 );
38 
39  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
40  bSizerMain->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
41 
42  wxBoxSizer* bSizerPlacement;
43  bSizerPlacement = new wxBoxSizer( wxVERTICAL );
44 
45  m_staticTextPlacement = new wxStaticText( this, wxID_ANY, _("Placement:"), wxDefaultPosition, wxDefaultSize, 0 );
46  m_staticTextPlacement->Wrap( -1 );
47  m_staticTextPlacement->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
48 
49  bSizerPlacement->Add( m_staticTextPlacement, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
50 
51  wxBoxSizer* bSizerOptions;
52  bSizerOptions = new wxBoxSizer( wxVERTICAL );
53 
54  m_rbInteractivePlacement = new wxRadioButton( this, wxID_ANY, _("Interactive placement"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
55  m_rbInteractivePlacement->SetValue( true );
56  bSizerOptions->Add( m_rbInteractivePlacement, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
57 
58  wxBoxSizer* bSizerUserPos;
59  bSizerUserPos = new wxBoxSizer( wxHORIZONTAL );
60 
61  m_rbAbsolutePlacement = new wxRadioButton( this, wxID_ANY, _("At"), wxDefaultPosition, wxDefaultSize, wxRB_SINGLE );
62  bSizerUserPos->Add( m_rbAbsolutePlacement, 0, wxALIGN_CENTER_VERTICAL, 5 );
63 
64  wxBoxSizer* bSizerPosSettings;
65  bSizerPosSettings = new wxBoxSizer( wxHORIZONTAL );
66 
67  m_staticTextXpos = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
68  m_staticTextXpos->Wrap( -1 );
69  bSizerPosSettings->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
70 
71  m_DxfPcbXCoord = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
72  #ifdef __WXGTK__
73  if ( !m_DxfPcbXCoord->HasFlag( wxTE_MULTILINE ) )
74  {
75  m_DxfPcbXCoord->SetMaxLength( 10 );
76  }
77  #else
78  m_DxfPcbXCoord->SetMaxLength( 10 );
79  #endif
80  m_DxfPcbXCoord->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") );
81 
82  bSizerPosSettings->Add( m_DxfPcbXCoord, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
83 
84  m_staticTextYpos = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
85  m_staticTextYpos->Wrap( -1 );
86  bSizerPosSettings->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
87 
88  m_DxfPcbYCoord = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
89  #ifdef __WXGTK__
90  if ( !m_DxfPcbYCoord->HasFlag( wxTE_MULTILINE ) )
91  {
92  m_DxfPcbYCoord->SetMaxLength( 10 );
93  }
94  #else
95  m_DxfPcbYCoord->SetMaxLength( 10 );
96  #endif
97  m_DxfPcbYCoord->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") );
98 
99  bSizerPosSettings->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
100 
101  m_staticTextUnits = new wxStaticText( this, wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, 0 );
102  m_staticTextUnits->Wrap( -1 );
103  bSizerPosSettings->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
104 
105  wxString m_DxfPcbPositionUnitsChoices[] = { _("mm"), _("inch") };
106  int m_DxfPcbPositionUnitsNChoices = sizeof( m_DxfPcbPositionUnitsChoices ) / sizeof( wxString );
107  m_DxfPcbPositionUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DxfPcbPositionUnitsNChoices, m_DxfPcbPositionUnitsChoices, 0 );
108  m_DxfPcbPositionUnits->SetSelection( 0 );
109  m_DxfPcbPositionUnits->SetToolTip( _("Select PCB grid units") );
110 
111  bSizerPosSettings->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
112 
113 
114  bSizerUserPos->Add( bSizerPosSettings, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
115 
116 
117  bSizerOptions->Add( bSizerUserPos, 0, wxEXPAND, 5 );
118 
119 
120  bSizerPlacement->Add( bSizerOptions, 1, wxEXPAND|wxLEFT, 20 );
121 
122 
123  bSizerMain->Add( bSizerPlacement, 1, wxEXPAND, 5 );
124 
125  m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
126  bSizerMain->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
127 
128  wxBoxSizer* bSizerLayer;
129  bSizerLayer = new wxBoxSizer( wxVERTICAL );
130 
131  m_staticTextPrms = new wxStaticText( this, wxID_ANY, _("Import parameters:"), wxDefaultPosition, wxDefaultSize, 0 );
132  m_staticTextPrms->Wrap( -1 );
133  m_staticTextPrms->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
134 
135  bSizerLayer->Add( m_staticTextPrms, 0, wxALL|wxEXPAND, 5 );
136 
137  wxBoxSizer* bSizer7;
138  bSizer7 = new wxBoxSizer( wxHORIZONTAL );
139 
140 
141  bSizer7->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
142 
143  wxFlexGridSizer* fgSizerImportSettings;
144  fgSizerImportSettings = new wxFlexGridSizer( 0, 3, 5, 5 );
145  fgSizerImportSettings->AddGrowableCol( 1 );
146  fgSizerImportSettings->SetFlexibleDirection( wxBOTH );
147  fgSizerImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
148 
149  m_staticTextLineWidth = new wxStaticText( this, wxID_ANY, _("Line width (DXF import):"), wxDefaultPosition, wxDefaultSize, 0 );
150  m_staticTextLineWidth->Wrap( -1 );
151  fgSizerImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
152 
153  m_textCtrlLineWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
154  fgSizerImportSettings->Add( m_textCtrlLineWidth, 0, wxEXPAND, 5 );
155 
156  wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
157  int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
158  m_choiceUnitLineWidth = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
159  m_choiceUnitLineWidth->SetSelection( 0 );
160  fgSizerImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
161 
162  m_staticTextBrdlayer = new wxStaticText( this, wxID_ANY, _("Graphic layer:"), wxDefaultPosition, wxDefaultSize, 0 );
163  m_staticTextBrdlayer->Wrap( -1 );
164  fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL, 5 );
165 
166  m_SelLayerBox = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
167  fgSizerImportSettings->Add( m_SelLayerBox, 0, wxEXPAND, 5 );
168 
169 
170  fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
171 
172  m_staticTextscale = new wxStaticText( this, wxID_ANY, _("Import scale:"), wxDefaultPosition, wxDefaultSize, 0 );
173  m_staticTextscale->Wrap( -1 );
174  fgSizerImportSettings->Add( m_staticTextscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
175 
176  m_textCtrlImportScale = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
177  fgSizerImportSettings->Add( m_textCtrlImportScale, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
178 
179 
180  fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
181 
182 
183  bSizer7->Add( fgSizerImportSettings, 1, wxEXPAND|wxRIGHT|wxTOP, 5 );
184 
185 
186  bSizerLayer->Add( bSizer7, 1, wxEXPAND, 5 );
187 
188 
189  bSizerMain->Add( bSizerLayer, 0, wxBOTTOM|wxEXPAND, 5 );
190 
191 
192  bSizerMain->Add( 0, 0, 0, wxEXPAND, 5 );
193 
194  m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
195  bSizerMain->Add( m_staticline, 0, wxALL|wxEXPAND, 5 );
196 
197  m_sdbSizer = new wxStdDialogButtonSizer();
198  m_sdbSizerOK = new wxButton( this, wxID_OK );
199  m_sdbSizer->AddButton( m_sdbSizerOK );
200  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
201  m_sdbSizer->AddButton( m_sdbSizerCancel );
202  m_sdbSizer->Realize();
203 
204  bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
205 
206 
207  this->SetSizer( bSizerMain );
208  this->Layout();
209  bSizerMain->Fit( this );
210 
211  this->Centre( wxBOTH );
212 
213  // Connect Events
214  m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onBrowseFiles ), NULL, this );
215  m_rbInteractivePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onInteractivePlacement ), NULL, this );
216  m_rbInteractivePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
217  m_rbAbsolutePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
218  m_rbAbsolutePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
219  m_DxfPcbPositionUnits->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
220  m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
221 }
222 
224 {
225  // Disconnect Events
226  m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onBrowseFiles ), NULL, this );
227  m_rbInteractivePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onInteractivePlacement ), NULL, this );
228  m_rbInteractivePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
229  m_rbAbsolutePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
230  m_rbAbsolutePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
231  m_DxfPcbPositionUnits->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
232  m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
233 
234 }
virtual void onInteractivePlacement(wxCommandEvent &event)
wxRadioButton * m_rbInteractivePlacement
Class to display a pcb layer list in a wxBitmapComboBox.
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:83
virtual void onAbsolutePlacement(wxCommandEvent &event)
wxStaticText * m_staticTextLineWidth
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
wxStdDialogButtonSizer * m_sdbSizer
virtual void onUnitPositionSelection(wxCommandEvent &event)
virtual void onBrowseFiles(wxCommandEvent &event)
wxRadioButton * m_rbAbsolutePlacement
virtual void originOptionOnUpdateUI(wxUpdateUIEvent &event)
wxStaticText * m_staticTextPlacement
virtual void onUnitWidthSelection(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)