15DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWindowID
id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
DIALOG_SHIM( parent, id, title, pos, size, style )
17 this->SetSizeHints( wxDefaultSize, wxDefaultSize );
19 wxBoxSizer* bSizerMain;
20 bSizerMain =
new wxBoxSizer( wxVERTICAL );
22 wxBoxSizer* bSizerFile;
23 bSizerFile =
new wxBoxSizer( wxHORIZONTAL );
25 m_staticTextFile =
new wxStaticText(
this, wxID_ANY,
_(
"File:"), wxDefaultPosition, wxDefaultSize, 0 );
29 m_textCtrlFileName =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
38 bSizerMain->Add( bSizerFile, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 10 );
40 wxFlexGridSizer* fgSizer3;
41 fgSizer3 =
new wxFlexGridSizer( 0, 3, 5, 3 );
42 fgSizer3->AddGrowableCol( 1 );
43 fgSizer3->SetFlexibleDirection( wxBOTH );
44 fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
46 m_importScaleLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Import scale:"), wxDefaultPosition, wxDefaultSize, 0 );
50 m_importScaleCtrl =
new wxTextCtrl(
this, wxID_ANY,
_(
"1.0"), wxDefaultPosition, wxSize( 120,-1 ), 0 );
54 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
56 m_importWidthLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Imported width:"), wxDefaultPosition, wxDefaultSize, 0 );
60 m_importWidthCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
65 m_importWidthUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
69 m_importHeightLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Imported height:"), wxDefaultPosition, wxDefaultSize, 0 );
73 m_importHeightCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
78 m_importHeightUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
83 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
85 m_aspectRatioCheckbox =
new wxCheckBox(
this, wxID_ANY,
_(
"Lock height / width ratio"), wxDefaultPosition, wxDefaultSize, 0 );
90 fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
92 m_lineWidthLabel =
new wxStaticText(
this, wxID_ANY,
_(
"DXF default line width:"), wxDefaultPosition, wxDefaultSize, 0 );
94 m_lineWidthLabel->SetToolTip(
_(
"Used when the DXF items in file have no line thickness set") );
98 m_lineWidthCtrl =
new wxTextCtrl(
this, wxID_ANY,
_(
"0.2"), wxDefaultPosition, wxDefaultSize, 0 );
99 fgSizer3->Add(
m_lineWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
101 m_lineWidthUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
105 m_dxfUnitsLabel =
new wxStaticText(
this, wxID_ANY,
_(
"DXF default units:"), wxDefaultPosition, wxDefaultSize, 0 );
109 fgSizer3->Add(
m_dxfUnitsLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
111 wxArrayString m_dxfUnitsChoiceChoices;
112 m_dxfUnitsChoice =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_dxfUnitsChoiceChoices, 0 );
117 bSizerMain->Add( fgSizer3, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
119 m_imagePanel =
new wxPanel(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
120 wxBoxSizer* bSizerImageOptions;
121 bSizerImageOptions =
new wxBoxSizer( wxHORIZONTAL );
123 wxBoxSizer* bSizerImageControls;
124 bSizerImageControls =
new wxBoxSizer( wxVERTICAL );
137 bSizerImageOptions->Add( bSizerImageControls, 1, wxEXPAND|wxLEFT, 5 );
142 bSizerImageOptions->Add(
m_previewBitmap, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
151 bSizerMain->Add( 0, 5, 0, wxEXPAND, 5 );
153 m_staticline2 =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
156 wxBoxSizer* bSizerPlaceAt;
157 bSizerPlaceAt =
new wxBoxSizer( wxHORIZONTAL );
159 m_placeAtCheckbox =
new wxCheckBox(
this, wxID_ANY,
_(
"Place at:"), wxDefaultPosition, wxDefaultSize, 0 );
164 m_xLabel =
new wxStaticText(
this, wxID_ANY,
_(
"X:"), wxDefaultPosition, wxDefaultSize, 0 );
166 bSizerPlaceAt->Add(
m_xLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
168 m_xCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
170 if ( !
m_xCtrl->HasFlag( wxTE_MULTILINE ) )
177 m_xCtrl->SetToolTip(
_(
"DXF origin on PCB Grid, X Coordinate") );
179 bSizerPlaceAt->Add(
m_xCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
181 m_yLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Y:"), wxDefaultPosition, wxDefaultSize, 0 );
183 bSizerPlaceAt->Add(
m_yLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
185 m_yCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
187 if ( !
m_yCtrl->HasFlag( wxTE_MULTILINE ) )
194 m_yCtrl->SetToolTip(
_(
"DXF origin on PCB Grid, Y Coordinate") );
196 bSizerPlaceAt->Add(
m_yCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
198 m_yUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
200 bSizerPlaceAt->Add(
m_yUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
202 m_originLabel =
new wxStaticText(
this, wxID_ANY,
_(
"From:"), wxDefaultPosition, wxDefaultSize, 0 );
204 bSizerPlaceAt->Add(
m_originLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 10 );
206 wxString m_originCtrlChoices[] = {
_(
"Page origin"),
_(
"Drill/place file origin"),
_(
"Grid origin"),
_(
"User defined origin") };
207 int m_originCtrlNChoices =
sizeof( m_originCtrlChoices ) /
sizeof( wxString );
208 m_originCtrl =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_originCtrlNChoices, m_originCtrlChoices, 0 );
210 bSizerPlaceAt->Add(
m_originCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
213 bSizerMain->Add( bSizerPlaceAt, 1, wxEXPAND|wxLEFT, 5 );
215 wxBoxSizer* bSizerTargetLayer;
216 bSizerTargetLayer =
new wxBoxSizer( wxHORIZONTAL );
218 m_radioBtnCurrentLayer =
new wxRadioButton(
this, wxID_ANY,
_(
"Current layer"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
222 m_radioBtnMapLayers =
new wxRadioButton(
this, wxID_ANY,
_(
"Map layers"), wxDefaultPosition, wxDefaultSize, 0 );
225 m_radioBtnSingleLayer =
new wxRadioButton(
this, wxID_ANY,
_(
"Single layer:"), wxDefaultPosition, wxDefaultSize, 0 );
226 bSizerTargetLayer->Add(
m_radioBtnSingleLayer, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
229 bSizerTargetLayer->Add(
m_SelLayerBox, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
232 bSizerMain->Add( bSizerTargetLayer, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
234 wxBoxSizer* bSizerGroupOpt;
235 bSizerGroupOpt =
new wxBoxSizer( wxVERTICAL );
237 m_cbGroupItems =
new wxCheckBox(
this, wxID_ANY,
_(
"Group imported items"), wxDefaultPosition, wxDefaultSize, 0 );
239 m_cbGroupItems->SetToolTip(
_(
"Add all imported items to a new group") );
241 bSizerGroupOpt->Add(
m_cbGroupItems, 0, wxTOP|wxBOTTOM|wxLEFT, 5 );
244 bSizerMain->Add( bSizerGroupOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
246 m_staticline3 =
new wxStaticLine(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
249 wxBoxSizer* bSizer11;
250 bSizer11 =
new wxBoxSizer( wxHORIZONTAL );
252 m_rbFixDiscontinuities =
new wxCheckBox(
this, wxID_ANY,
_(
"Fix discontinuities"), wxDefaultPosition, wxDefaultSize, 0 );
254 m_rbFixDiscontinuities->SetToolTip(
_(
"Trim/extend open shapes or add segments to make vertices of shapes coincide") );
258 m_toleranceLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Tolerance:"), wxDefaultPosition, wxDefaultSize, 0 );
262 m_toleranceCtrl =
new wxTextCtrl(
this, wxID_ANY,
_(
"1"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
263 bSizer11->Add(
m_toleranceCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
265 m_toleranceUnits =
new wxStaticText(
this, wxID_ANY,
_(
"mm"), wxDefaultPosition, wxDefaultSize, 0 );
267 bSizer11->Add(
m_toleranceUnits, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
270 bSizerMain->Add( bSizer11, 0, wxEXPAND|wxRIGHT|wxLEFT, 10 );
273 bSizerMain->Add( 0, 3, 1, wxEXPAND, 5 );
282 bSizerMain->Add(
m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
285 this->SetSizer( bSizerMain );
287 bSizerMain->Fit(
this );
289 this->Centre( wxBOTH );