16DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID
id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style ) :
DIALOG_SHIM( parent, id, title, pos, size, style )
18 this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
22 wxFlexGridSizer* fgSizerTop;
23 fgSizerTop =
new wxFlexGridSizer( 0, 2, 5, 0 );
24 fgSizerTop->AddGrowableCol( 1 );
25 fgSizerTop->SetFlexibleDirection( wxBOTH );
26 fgSizerTop->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
28 wxBoxSizer* bVariantSizer;
29 bVariantSizer =
new wxBoxSizer( wxHORIZONTAL );
31 m_staticTextPlotFmt =
new wxStaticText(
this, wxID_ANY,
_(
"Plot format:"), wxDefaultPosition, wxDefaultSize, 0 );
36 fgSizerTop->Add( bVariantSizer, 0, wxALIGN_CENTER_VERTICAL, 5 );
38 wxBoxSizer* bFormatSizer;
39 bFormatSizer =
new wxBoxSizer( wxHORIZONTAL );
41 wxString m_plotFormatOptChoices[] = {
_(
"Gerber"),
_(
"Postscript"),
_(
"SVG"),
_(
"DXF"),
_(
"PDF") };
42 int m_plotFormatOptNChoices =
sizeof( m_plotFormatOptChoices ) /
sizeof( wxString );
43 m_plotFormatOpt =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_plotFormatOptNChoices, m_plotFormatOptChoices, 0 );
45 bFormatSizer->Add(
m_plotFormatOpt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 28 );
48 bFormatSizer->Add( 0, 0, 1, wxEXPAND, 5 );
50 m_variantLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Design variant:"), wxDefaultPosition, wxDefaultSize, 0 );
52 bFormatSizer->Add(
m_variantLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
54 wxArrayString m_variantChoiceCtrlChoices;
55 m_variantChoiceCtrl =
new wxChoice(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_variantChoiceCtrlChoices, 0 );
60 fgSizerTop->Add( bFormatSizer, 0, wxEXPAND, 5 );
62 m_staticTextDir =
new wxStaticText(
this, wxID_ANY,
_(
"Output directory:"), wxDefaultPosition, wxDefaultSize, 0 );
64 fgSizerTop->Add(
m_staticTextDir, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
66 wxBoxSizer* bupperSizer;
67 bupperSizer =
new wxBoxSizer( wxHORIZONTAL );
69 m_outputDirectoryName =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
70 m_outputDirectoryName->SetToolTip(
_(
"Target directory for plot files. Can be absolute or relative to the board file location.") );
80 bupperSizer->Add(
m_openDirButton, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
83 bupperSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT, 5 );
86 fgSizerTop->Add( bupperSizer, 0, wxEXPAND, 5 );
89 m_MainSizer->Add( fgSizerTop, 0, wxALL|wxEXPAND, 5 );
93 m_LayersSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Include Layers") ), wxHORIZONTAL );
95 wxArrayString m_layerCheckListBoxChoices;
106 wxStaticBoxSizer* sbOptionsSizer;
107 sbOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"General Options") ), wxVERTICAL );
109 wxGridBagSizer* gbSizer1;
110 gbSizer1 =
new wxGridBagSizer( 3, 0 );
111 gbSizer1->SetFlexibleDirection( wxHORIZONTAL );
112 gbSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
114 m_plotSheetRef =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Plot drawing sheet"), wxDefaultPosition, wxDefaultSize, 0 );
117 gbSizer1->Add(
m_plotSheetRef, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
119 m_subtractMaskFromSilk =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Subtract soldermask from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
122 gbSizer1->Add(
m_subtractMaskFromSilk, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
124 m_plotDNP =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Indicate DNP on fabrication layers"), wxDefaultPosition, wxDefaultSize, 0 );
125 m_plotDNP->SetToolTip(
_(
"Hide or cross-out DNP footprints on fabrication layers") );
127 gbSizer1->Add(
m_plotDNP, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
129 m_hideDNP =
new wxRadioButton( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Hide"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
130 m_hideDNP->SetToolTip(
_(
"Hide the footprint text and graphics") );
132 gbSizer1->Add(
m_hideDNP, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 25 );
134 m_crossoutDNP =
new wxRadioButton( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Cross-out"), wxDefaultPosition, wxDefaultSize, 0 );
135 gbSizer1->Add(
m_crossoutDNP, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 25 );
142 m_plotPadNumbers =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Include pad numbers"), wxDefaultPosition, wxDefaultSize, 0 );
143 gbSizer1->Add(
m_plotPadNumbers, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxLEFT, 25 );
145 m_zoneFillCheck =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Check zone fills before plotting"), wxDefaultPosition, wxDefaultSize, 0 );
147 gbSizer1->Add(
m_zoneFillCheck, wxGBPosition( 6, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
149 drillMarksLabel =
new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 );
151 gbSizer1->Add(
drillMarksLabel, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
153 wxString m_drillShapeOptChoices[] = {
_(
"None"),
_(
"Small"),
_(
"Actual size") };
154 int m_drillShapeOptNChoices =
sizeof( m_drillShapeOptChoices ) /
sizeof( wxString );
155 m_drillShapeOpt =
new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_drillShapeOptNChoices, m_drillShapeOptChoices, 0 );
157 gbSizer1->Add(
m_drillShapeOpt, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 5 );
159 scalingLabel =
new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Scaling:"), wxDefaultPosition, wxDefaultSize, 0 );
161 gbSizer1->Add(
scalingLabel, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
163 wxString m_scaleOptChoices[] = {
_(
"Auto"),
_(
"1:1"),
_(
"3:2"),
_(
"2:1"),
_(
"3:1") };
164 int m_scaleOptNChoices =
sizeof( m_scaleOptChoices ) /
sizeof( wxString );
165 m_scaleOpt =
new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_scaleOptNChoices, m_scaleOptChoices, 0 );
167 gbSizer1->Add(
m_scaleOpt, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 5 );
169 m_useAuxOriginCheckBox =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Use drill/place file origin"), wxDefaultPosition, wxDefaultSize, 0 );
170 m_useAuxOriginCheckBox->SetToolTip(
_(
"Use the drill/place file origin as the coordinate origin for plotted files") );
172 gbSizer1->Add(
m_useAuxOriginCheckBox, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
174 m_plotMirrorOpt =
new wxCheckBox( sbOptionsSizer->GetStaticBox(),
ID_MIROR_OPT,
_(
"Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 );
175 gbSizer1->Add(
m_plotMirrorOpt, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
177 m_plotPSNegativeOpt =
new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Negative plot"), wxDefaultPosition, wxDefaultSize, 0 );
178 gbSizer1->Add(
m_plotPSNegativeOpt, wxGBPosition( 4, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
181 sbOptionsSizer->Add( gbSizer1, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
188 m_bitmapAlert =
new wxStaticBitmap(
this, wxID_ANY, wxArtProvider::GetBitmap(
wxASCII_STR(wxART_WARNING),
wxASCII_STR(wxART_CMN_DIALOG) ), wxDefaultPosition, wxDefaultSize, 0 );
191 wxBoxSizer* bSizerWarningText;
192 bSizerWarningText =
new wxBoxSizer( wxVERTICAL );
194 m_staticTextAlert =
new wxStaticText(
this, wxID_ANY,
_(
"Global solder mask minimum width and/or margin are not set to 0. "), wxDefaultPosition, wxDefaultSize, 0 );
198 m_staticTextAlert1 =
new wxStaticText(
this, wxID_ANY,
_(
"Most board manufacturers expect 0 and use their own constraints for solder mask minimum width."), wxDefaultPosition, wxDefaultSize, 0 );
202 wxBoxSizer* bSizerSecondLine;
203 bSizerSecondLine =
new wxBoxSizer( wxHORIZONTAL );
206 bSizerSecondLine->Add( 0, 0, 1, wxEXPAND, 5 );
208 m_boardSetup =
new wxHyperlinkCtrl(
this, wxID_ANY,
_(
"Board setup"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
211 bSizerSecondLine->Add(
m_boardSetup, 0, wxLEFT|wxRIGHT|wxTOP, 2 );
214 bSizerWarningText->Add( bSizerSecondLine, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
222 m_GerberOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Gerber Options") ), wxHORIZONTAL );
224 wxGridBagSizer* gbSizer2;
225 gbSizer2 =
new wxGridBagSizer( 3, 0 );
226 gbSizer2->SetFlexibleDirection( wxHORIZONTAL );
227 gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
230 m_useGerberExtensions->SetToolTip(
_(
"Use Protel Gerber extensions (.GBL, .GTL, etc...)\nNo longer recommended. The official extension is .gbr") );
233 gbSizer2->Add(
m_useGerberExtensions, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
237 m_generateGerberJobFile->SetToolTip(
_(
"Generate a Gerber job file that contains info about the board,\nand the list of generated Gerber plot files") );
243 gbSizer2->Add(
coordFormatLabel, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
245 wxString m_coordFormatCtrlChoices[] = {
_(
"4.5, unit mm"),
_(
"4.6, unit mm") };
246 int m_coordFormatCtrlNChoices =
sizeof( m_coordFormatCtrlChoices ) /
sizeof( wxString );
249 gbSizer2->Add(
m_coordFormatCtrl, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxRIGHT|wxLEFT, 5 );
252 m_useGerberX2Format->SetToolTip(
_(
"Use X2 Gerber file format.\nInclude mainly X2 attributes in Gerber headers.\nIf not checked, use X1 format.\nIn X1 format, these attributes are included as comments in files.") );
254 gbSizer2->Add(
m_useGerberX2Format, wxGBPosition( 1, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 );
257 m_useGerberNetAttributes->SetToolTip(
_(
"Include netlist metadata and aperture attributes in Gerber files.\nThey are comments in the X1 format.\nUsed to check connectivity in CAM tools and Gerber viewers.") );
259 gbSizer2->Add(
m_useGerberNetAttributes, wxGBPosition( 2, 1 ), wxGBSpan( 1, 2 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 30 );
262 m_disableApertMacros->SetToolTip(
_(
"Disable aperture macros in Gerber files\nUse *only* for broken Gerber viewers.") );
264 gbSizer2->Add(
m_disableApertMacros, wxGBPosition( 3, 1 ), wxGBSpan( 1, 2 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 30 );
267 gbSizer2->AddGrowableCol( 2 );
274 m_PSOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"Postscript Options") ), wxVERTICAL );
276 wxFlexGridSizer* fgSizer2;
277 fgSizer2 =
new wxFlexGridSizer( 0, 6, 5, 0 );
278 fgSizer2->AddGrowableCol( 1 );
279 fgSizer2->AddGrowableCol( 4 );
280 fgSizer2->SetFlexibleDirection( wxBOTH );
281 fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
283 fgSizer2->SetMinSize( wxSize( 60,-1 ) );
289 m_fineAdjustXCtrl->SetToolTip(
_(
"Set global X scale adjust for exact scale PostScript output.") );
291 fgSizer2->Add(
m_fineAdjustXCtrl, 0, wxEXPAND|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
294 fgSizer2->Add( 0, 0, 1, wxEXPAND, 5 );
301 m_fineAdjustYCtrl->SetToolTip(
_(
"Set global Y scale adjust for exact scale PostScript output.") );
306 fgSizer2->Add( 0, 0, 1, wxEXPAND|wxRIGHT|wxLEFT, 10 );
313 m_widthAdjustCtrl->SetToolTip(
_(
"Set global width correction for exact width PostScript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)].") );
315 fgSizer2->Add(
m_widthAdjustCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
330 m_SizerDXF_options =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"DXF Options") ), wxHORIZONTAL );
332 wxGridBagSizer* gbSizer5;
333 gbSizer5 =
new wxGridBagSizer( 5, 5 );
334 gbSizer5->SetFlexibleDirection( wxBOTH );
335 gbSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
339 m_DXF_plotModeOpt->SetToolTip(
_(
"Uncheck to plot graphic items using their center lines") );
342 gbSizer5->Add(
m_DXF_plotModeOpt, wxGBPosition( 0, 0 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
346 gbSizer5->Add(
DXF_exportUnitsLabel, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
348 wxString m_DXF_plotUnitsChoices[] = {
_(
"Inches"),
_(
"Millimeters") };
349 int m_DXF_plotUnitsNChoices =
sizeof( m_DXF_plotUnitsChoices ) /
sizeof( wxString );
350 m_DXF_plotUnits =
new wxChoice(
m_SizerDXF_options->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DXF_plotUnitsNChoices, m_DXF_plotUnitsChoices, 0 );
352 m_DXF_plotUnits->SetToolTip(
_(
"The units to use for the exported DXF file") );
354 gbSizer5->Add(
m_DXF_plotUnits, wxGBPosition( 0, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
357 m_DXF_plotTextStrokeFontOpt->SetToolTip(
_(
"Check to use KiCad stroke font\nUncheck to plot single-line ASCII texts as editable text (using DXF font)") );
372 m_svgOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"SVG Options") ), wxHORIZONTAL );
374 wxGridBagSizer* gbSizer3;
375 gbSizer3 =
new wxGridBagSizer( 5, 0 );
376 gbSizer3->SetFlexibleDirection( wxBOTH );
377 gbSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
381 gbSizer3->Add(
svgPrecisionLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
384 m_svgPrecsision->SetToolTip(
_(
"This number defines how many digits are exported that are below 1 mm.\nUser unit is 10^-<N> mm\nChoose 4 if you are not sure.") );
386 gbSizer3->Add(
m_svgPrecsision, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
390 gbSizer3->Add(
m_staticText18, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
392 wxString m_SVGColorChoiceChoices[] = {
_(
"Color"),
_(
"Black and white") };
393 int m_SVGColorChoiceNChoices =
sizeof( m_SVGColorChoiceChoices ) /
sizeof( wxString );
394 m_SVGColorChoice =
new wxChoice(
m_svgOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_SVGColorChoiceNChoices, m_SVGColorChoiceChoices, 0 );
396 gbSizer3->Add(
m_SVGColorChoice, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
407 m_PDFOptionsSizer =
new wxStaticBoxSizer(
new wxStaticBox(
this, wxID_ANY,
_(
"PDF Options") ), wxHORIZONTAL );
409 wxGridBagSizer* gbSizer4;
410 gbSizer4 =
new wxGridBagSizer( 5, 0 );
411 gbSizer4->SetFlexibleDirection( wxBOTH );
412 gbSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
416 gbSizer4->Add(
m_staticText19, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
418 wxString m_PDFColorChoiceChoices[] = {
_(
"Color"),
_(
"Black and white") };
419 int m_PDFColorChoiceNChoices =
sizeof( m_PDFColorChoiceChoices ) /
sizeof( wxString );
420 m_PDFColorChoice =
new wxChoice(
m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_PDFColorChoiceNChoices, m_PDFColorChoiceChoices, 0 );
422 gbSizer4->Add(
m_PDFColorChoice, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
430 m_pdfMetadata =
new wxCheckBox(
m_PDFOptionsSizer->GetStaticBox(), wxID_ANY,
_(
"Generate metadata from AUTHOR && SUBJECT variables"), wxDefaultPosition, wxDefaultSize, 0 );
431 m_pdfMetadata->SetToolTip(
_(
"Generate PDF document properties from AUTHOR and SUBJECT text variables") );
433 gbSizer4->Add(
m_pdfMetadata, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT, 5 );
436 gbSizer4->Add(
m_pdfSingle, wxGBPosition( 4, 0 ), wxGBSpan( 1, 2 ), wxLEFT|wxRIGHT, 5 );
457 wxBoxSizer* sbSizerMsg;
458 sbSizerMsg =
new wxBoxSizer( wxVERTICAL );
470 m_buttonDRC =
new wxButton(
this, wxID_ANY,
_(
"Run DRC..."), wxDefaultPosition, wxDefaultSize, 0 );
473 m_DRCExclusionsWarning =
new wxStaticText(
this, wxID_ANY,
_(
"(%d known DRC violations; %d exclusions)"), wxDefaultPosition, wxDefaultSize, 0 );
496 this->Centre( wxBOTH );