KiCad PCB EDA Suite
dialog_dxf_import_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version Jul 2 2017)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
9 
10 #include "dialog_dxf_import_base.h"
11 
13 
14 DIALOG_DXF_IMPORT_BASE::DIALOG_DXF_IMPORT_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|wxALL, 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|wxBOTTOM|wxRIGHT|wxTOP, 5 );
32 
33  m_buttonBrowse = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 );
34  bSizerFile->Add( m_buttonBrowse, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
35 
36 
37  bSizerMain->Add( bSizerFile, 0, wxALL|wxEXPAND, 5 );
38 
39  wxBoxSizer* bSizerMiddle;
40  bSizerMiddle = new wxBoxSizer( wxHORIZONTAL );
41 
42  wxString m_rbOffsetOptionChoices[] = { _("Center of page"), _("Upper left corner of page"), _("Center left side of page"), _("Lower left corner of page"), _("User defined position") };
43  int m_rbOffsetOptionNChoices = sizeof( m_rbOffsetOptionChoices ) / sizeof( wxString );
44  m_rbOffsetOption = new wxRadioBox( this, wxID_ORIGIN_SELECT, _("Place DXF origin (0,0) point:"), wxDefaultPosition, wxDefaultSize, m_rbOffsetOptionNChoices, m_rbOffsetOptionChoices, 1, wxRA_SPECIFY_COLS );
45  m_rbOffsetOption->SetSelection( 0 );
46  bSizerMiddle->Add( m_rbOffsetOption, 1, wxALL, 5 );
47 
48  wxBoxSizer* bSizerUserPos;
49  bSizerUserPos = new wxBoxSizer( wxVERTICAL );
50 
51  wxBoxSizer* bSizerPosSettings;
52  bSizerPosSettings = new wxBoxSizer( wxVERTICAL );
53 
54  m_staticText6 = new wxStaticText( this, wxID_ANY, _("User defined position:"), wxDefaultPosition, wxDefaultSize, 0 );
55  m_staticText6->Wrap( -1 );
56  bSizerPosSettings->Add( m_staticText6, 0, wxALL, 5 );
57 
58  wxFlexGridSizer* fgSizerUserPosition;
59  fgSizerUserPosition = new wxFlexGridSizer( 0, 3, 0, 0 );
60  fgSizerUserPosition->AddGrowableCol( 2 );
61  fgSizerUserPosition->SetFlexibleDirection( wxBOTH );
62  fgSizerUserPosition->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
63 
64 
65  fgSizerUserPosition->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
66 
67  m_staticTextXpos = new wxStaticText( this, wxID_ANY, _("X Position:"), wxDefaultPosition, wxDefaultSize, 0 );
68  m_staticTextXpos->Wrap( -1 );
69  fgSizerUserPosition->Add( m_staticTextXpos, 0, wxALIGN_CENTER_VERTICAL|wxALL, 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  fgSizerUserPosition->Add( m_DxfPcbXCoord, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
83 
84 
85  fgSizerUserPosition->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
86 
87  m_staticTextYpos = new wxStaticText( this, wxID_ANY, _("Y Position:"), wxDefaultPosition, wxDefaultSize, 0 );
88  m_staticTextYpos->Wrap( -1 );
89  fgSizerUserPosition->Add( m_staticTextYpos, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
90 
91  m_DxfPcbYCoord = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
92  #ifdef __WXGTK__
93  if ( !m_DxfPcbYCoord->HasFlag( wxTE_MULTILINE ) )
94  {
95  m_DxfPcbYCoord->SetMaxLength( 10 );
96  }
97  #else
98  m_DxfPcbYCoord->SetMaxLength( 10 );
99  #endif
100  m_DxfPcbYCoord->SetToolTip( _("DXF origin on PCB Grid, Y Coordinate") );
101 
102  fgSizerUserPosition->Add( m_DxfPcbYCoord, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
103 
104 
105  fgSizerUserPosition->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
106 
107  m_staticTextUnits = new wxStaticText( this, wxID_ANY, _("Position Units:"), wxDefaultPosition, wxDefaultSize, 0 );
108  m_staticTextUnits->Wrap( -1 );
109  fgSizerUserPosition->Add( m_staticTextUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
110 
111  wxString m_DxfPcbPositionUnitsChoices[] = { _("mm"), _("inch") };
112  int m_DxfPcbPositionUnitsNChoices = sizeof( m_DxfPcbPositionUnitsChoices ) / sizeof( wxString );
113  m_DxfPcbPositionUnits = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DxfPcbPositionUnitsNChoices, m_DxfPcbPositionUnitsChoices, 0 );
114  m_DxfPcbPositionUnits->SetSelection( 0 );
115  m_DxfPcbPositionUnits->SetToolTip( _("Select PCB grid units") );
116 
117  fgSizerUserPosition->Add( m_DxfPcbPositionUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
118 
119 
120  bSizerPosSettings->Add( fgSizerUserPosition, 1, wxEXPAND, 5 );
121 
122 
123  bSizerUserPos->Add( bSizerPosSettings, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 );
124 
125 
126  bSizerMiddle->Add( bSizerUserPos, 1, 0, 5 );
127 
128 
129  bSizerMain->Add( bSizerMiddle, 1, wxALL|wxEXPAND, 5 );
130 
131  wxBoxSizer* bSizerLayer;
132  bSizerLayer = new wxBoxSizer( wxVERTICAL );
133 
134  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
135  bSizerLayer->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
136 
137  m_staticTextPrms = new wxStaticText( this, wxID_ANY, _("Import parameters:"), wxDefaultPosition, wxDefaultSize, 0 );
138  m_staticTextPrms->Wrap( -1 );
139  bSizerLayer->Add( m_staticTextPrms, 0, wxALL, 5 );
140 
141  wxBoxSizer* bSizer7;
142  bSizer7 = new wxBoxSizer( wxHORIZONTAL );
143 
144 
145  bSizer7->Add( 0, 0, 0, wxRIGHT|wxLEFT, 10 );
146 
147  wxFlexGridSizer* fgSizerImportSettings;
148  fgSizerImportSettings = new wxFlexGridSizer( 0, 3, 0, 0 );
149  fgSizerImportSettings->AddGrowableCol( 1 );
150  fgSizerImportSettings->SetFlexibleDirection( wxBOTH );
151  fgSizerImportSettings->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
152 
153  m_staticTextLineWidth = new wxStaticText( this, wxID_ANY, _("Default Line Width:"), wxDefaultPosition, wxDefaultSize, 0 );
154  m_staticTextLineWidth->Wrap( -1 );
155  fgSizerImportSettings->Add( m_staticTextLineWidth, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
156 
157  m_textCtrlLineWidth = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
158  fgSizerImportSettings->Add( m_textCtrlLineWidth, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
159 
160  wxString m_choiceUnitLineWidthChoices[] = { _("mm"), _("mils"), _("inches") };
161  int m_choiceUnitLineWidthNChoices = sizeof( m_choiceUnitLineWidthChoices ) / sizeof( wxString );
162  m_choiceUnitLineWidth = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitLineWidthNChoices, m_choiceUnitLineWidthChoices, 0 );
163  m_choiceUnitLineWidth->SetSelection( 0 );
164  fgSizerImportSettings->Add( m_choiceUnitLineWidth, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
165 
166  m_staticTextBrdlayer = new wxStaticText( this, wxID_ANY, _("Graphic Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
167  m_staticTextBrdlayer->Wrap( -1 );
168  fgSizerImportSettings->Add( m_staticTextBrdlayer, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT|wxTOP, 5 );
169 
170  m_SelLayerBox = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
171  fgSizerImportSettings->Add( m_SelLayerBox, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 );
172 
173 
174  bSizer7->Add( fgSizerImportSettings, 1, wxEXPAND, 5 );
175 
176 
177  bSizerLayer->Add( bSizer7, 1, wxEXPAND, 5 );
178 
179 
180  bSizerMain->Add( bSizerLayer, 0, wxALL|wxEXPAND, 5 );
181 
182  m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
183  bSizerMain->Add( m_staticline, 0, wxALL|wxEXPAND, 5 );
184 
185  m_sdbSizer = new wxStdDialogButtonSizer();
186  m_sdbSizerOK = new wxButton( this, wxID_OK );
187  m_sdbSizer->AddButton( m_sdbSizerOK );
188  m_sdbSizerCancel = new wxButton( this, wxID_CANCEL );
189  m_sdbSizer->AddButton( m_sdbSizerCancel );
190  m_sdbSizer->Realize();
191 
192  bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxBOTTOM|wxLEFT|wxRIGHT, 5 );
193 
194 
195  this->SetSizer( bSizerMain );
196  this->Layout();
197 
198  this->Centre( wxBOTH );
199 
200  // Connect Events
201  m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DXF_IMPORT_BASE::OnBrowseDxfFiles ), NULL, this );
202  m_rbOffsetOption->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_DXF_IMPORT_BASE::OriginOptionOnUpdateUI ), NULL, this );
203  m_DxfPcbPositionUnits->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DXF_IMPORT_BASE::onUnitPositionSelection ), NULL, this );
204  m_choiceUnitLineWidth->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DXF_IMPORT_BASE::onUnitWidthSelection ), NULL, this );
205 }
206 
208 {
209  // Disconnect Events
210  m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_DXF_IMPORT_BASE::OnBrowseDxfFiles ), NULL, this );
211  m_rbOffsetOption->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_DXF_IMPORT_BASE::OriginOptionOnUpdateUI ), NULL, this );
212  m_DxfPcbPositionUnits->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DXF_IMPORT_BASE::onUnitPositionSelection ), NULL, this );
213  m_choiceUnitLineWidth->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_DXF_IMPORT_BASE::onUnitWidthSelection ), NULL, this );
214 
215 }
DIALOG_DXF_IMPORT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Import DXF File"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(475, 388), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxStdDialogButtonSizer * m_sdbSizer
virtual void onUnitPositionSelection(wxCommandEvent &event)
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:60
virtual void onUnitWidthSelection(wxCommandEvent &event)
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
virtual void OriginOptionOnUpdateUI(wxUpdateUIEvent &event)
#define wxID_ORIGIN_SELECT
virtual void OnBrowseDxfFiles(wxCommandEvent &event)
wxStaticText * m_staticTextLineWidth