KiCad PCB EDA Suite
dialog_import_gfx_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 
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  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_buttonBrowse = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
37  m_buttonBrowse->SetToolTip( _("Only vectors will be imported. Bitmaps and fonts will be ignored.") );
38 
39  bSizerFile->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
40 
41 
42  bSizerMain->Add( bSizerFile, 0, wxALL|wxEXPAND, 5 );
43 
44  wxStaticBoxSizer* sbSizer2;
45  sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Placement:") ), wxVERTICAL );
46 
47  wxBoxSizer* bSizerOptions;
48  bSizerOptions = new wxBoxSizer( wxVERTICAL );
49 
50  m_rbInteractivePlacement = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_ANY, _("Interactive placement"), wxDefaultPosition, wxDefaultSize, 0 );
51  m_rbInteractivePlacement->SetValue( true );
52  bSizerOptions->Add( m_rbInteractivePlacement, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
53 
54  wxBoxSizer* bSizerUserPos;
55  bSizerUserPos = new wxBoxSizer( wxHORIZONTAL );
56 
57  m_rbAbsolutePlacement = new wxRadioButton( sbSizer2->GetStaticBox(), wxID_ANY, _("At"), wxDefaultPosition, wxDefaultSize, 0 );
58  bSizerUserPos->Add( m_rbAbsolutePlacement, 0, wxALIGN_CENTER_VERTICAL, 5 );
59 
60  wxBoxSizer* bSizerPosSettings;
61  bSizerPosSettings = new wxBoxSizer( wxHORIZONTAL );
62 
63  m_staticTextXpos = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
64  m_staticTextXpos->Wrap( -1 );
65  bSizerPosSettings->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
66 
67  m_DxfPcbXCoord = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
68  #ifdef __WXGTK__
69  if ( !m_DxfPcbXCoord->HasFlag( wxTE_MULTILINE ) )
70  {
71  m_DxfPcbXCoord->SetMaxLength( 10 );
72  }
73  #else
74  m_DxfPcbXCoord->SetMaxLength( 10 );
75  #endif
76  m_DxfPcbXCoord->SetToolTip( _("DXF origin on PCB Grid, X Coordinate") );
77 
78  bSizerPosSettings->Add( m_DxfPcbXCoord, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
79 
80  m_staticTextYpos = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
81  m_staticTextYpos->Wrap( -1 );
82  bSizerPosSettings->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
83 
84  m_DxfPcbYCoord = new wxTextCtrl( sbSizer2->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
85  #ifdef __WXGTK__
86  if ( !m_DxfPcbYCoord->HasFlag( wxTE_MULTILINE ) )
87  {
88  m_DxfPcbYCoord->SetMaxLength( 10 );
89  }
90  #else
91  m_DxfPcbYCoord->SetMaxLength( 10 );
92  #endif
93  m_DxfPcbYCoord->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") );
94 
95  bSizerPosSettings->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
96 
97  m_staticTextUnits = new wxStaticText( sbSizer2->GetStaticBox(), wxID_ANY, _("Units:"), wxDefaultPosition, wxDefaultSize, 0 );
98  m_staticTextUnits->Wrap( -1 );
99  bSizerPosSettings->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
100 
101  wxString m_DxfPcbPositionUnitsChoices[] = { _("mm"), _("inch") };
102  int m_DxfPcbPositionUnitsNChoices = sizeof( m_DxfPcbPositionUnitsChoices ) / sizeof( wxString );
103  m_DxfPcbPositionUnits = new wxChoice( sbSizer2->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DxfPcbPositionUnitsNChoices, m_DxfPcbPositionUnitsChoices, 0 );
104  m_DxfPcbPositionUnits->SetSelection( 0 );
105  m_DxfPcbPositionUnits->SetToolTip( _("Select PCB grid units") );
106 
107  bSizerPosSettings->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
108 
109 
110  bSizerUserPos->Add( bSizerPosSettings, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 );
111 
112 
113  bSizerOptions->Add( bSizerUserPos, 0, wxEXPAND, 5 );
114 
115 
116  sbSizer2->Add( bSizerOptions, 1, wxEXPAND|wxLEFT, 20 );
117 
118 
119  bSizerMain->Add( sbSizer2, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
120 
121  wxStaticBoxSizer* sbSizer1;
122  sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Import parameters:") ), wxVERTICAL );
123 
124  wxBoxSizer* bSizer7;
125  bSizer7 = new wxBoxSizer( wxHORIZONTAL );
126 
127 
128  bSizer7->Add( 0, 0, 0, wxLEFT|wxRIGHT, 10 );
129 
130  wxFlexGridSizer* fgSizerImportSettings;
131  fgSizerImportSettings = new wxFlexGridSizer( 0, 3, 5, 5 );
132  fgSizerImportSettings->AddGrowableCol( 1 );
133  fgSizerImportSettings->SetFlexibleDirection( wxBOTH );
134  fgSizerImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
135 
136  m_staticTextLineWidth = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Line width (DXF import):"), wxDefaultPosition, wxDefaultSize, 0 );
137  m_staticTextLineWidth->Wrap( -1 );
138  fgSizerImportSettings->Add( m_staticTextLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
139 
140  m_textCtrlLineWidth = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
141  fgSizerImportSettings->Add( m_textCtrlLineWidth, 0, wxEXPAND, 5 );
142 
143  wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
144  int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
145  m_choiceUnitLineWidth = new wxChoice( sbSizer1->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
146  m_choiceUnitLineWidth->SetSelection( 0 );
147  fgSizerImportSettings->Add( m_choiceUnitLineWidth, 0, wxALIGN_CENTER_VERTICAL, 5 );
148 
149  m_staticTextBrdlayer = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Graphic layer:"), wxDefaultPosition, wxDefaultSize, 0 );
150  m_staticTextBrdlayer->Wrap( -1 );
151  fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL, 5 );
152 
153  m_SelLayerBox = new PCB_LAYER_BOX_SELECTOR( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
154  fgSizerImportSettings->Add( m_SelLayerBox, 0, wxEXPAND, 5 );
155 
156 
157  fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
158 
159  m_staticTextscale = new wxStaticText( sbSizer1->GetStaticBox(), wxID_ANY, _("Import scale:"), wxDefaultPosition, wxDefaultSize, 0 );
160  m_staticTextscale->Wrap( -1 );
161  fgSizerImportSettings->Add( m_staticTextscale, 0, wxALIGN_CENTER_VERTICAL, 5 );
162 
163  m_textCtrlImportScale = new wxTextCtrl( sbSizer1->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
164  fgSizerImportSettings->Add( m_textCtrlImportScale, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
165 
166 
167  fgSizerImportSettings->Add( 0, 0, 0, 0, 5 );
168 
169 
170  bSizer7->Add( fgSizerImportSettings, 1, wxBOTTOM|wxEXPAND|wxRIGHT|wxTOP, 5 );
171 
172 
173  sbSizer1->Add( bSizer7, 1, wxEXPAND, 5 );
174 
175 
176  bSizerMain->Add( sbSizer1, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );
177 
178 
179  bSizerMain->Add( 0, 0, 0, wxEXPAND, 5 );
180 
181  m_sdbSizer = new wxStdDialogButtonSizer();
182  m_sdbSizerOK = new wxButton( this, wxID_OK );
183  m_sdbSizer->AddButton( m_sdbSizerOK );
184  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
185  m_sdbSizer->AddButton( m_sdbSizerCancel );
186  m_sdbSizer->Realize();
187 
188  bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
189 
190 
191  this->SetSizer( bSizerMain );
192  this->Layout();
193  bSizerMain->Fit( this );
194 
195  this->Centre( wxBOTH );
196 
197  // Connect Events
198  m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onBrowseFiles ), NULL, this );
199  m_rbInteractivePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onInteractivePlacement ), NULL, this );
200  m_rbInteractivePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
201  m_rbAbsolutePlacement->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
202  m_rbAbsolutePlacement->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
203  m_DxfPcbPositionUnits->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
204  m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
205 }
206 
208 {
209  // Disconnect Events
210  m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onBrowseFiles ), NULL, this );
211  m_rbInteractivePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onInteractivePlacement ), NULL, this );
212  m_rbInteractivePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
213  m_rbAbsolutePlacement->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onAbsolutePlacement ), NULL, this );
214  m_rbAbsolutePlacement->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_IMPORT_GFX_BASE::originOptionOnUpdateUI ), NULL, this );
215  m_DxfPcbPositionUnits->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitPositionSelection ), NULL, this );
216  m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_IMPORT_GFX_BASE::onUnitWidthSelection ), NULL, this );
217 
218 }
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
#define _(s)
virtual void onUnitPositionSelection(wxCommandEvent &event)
virtual void onBrowseFiles(wxCommandEvent &event)
wxRadioButton * m_rbAbsolutePlacement
virtual void originOptionOnUpdateUI(wxUpdateUIEvent &event)
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)