From b2c848579a965ee22a518031054d969e676b1516 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Thu, 13 Jun 2019 01:17:47 +0100 Subject: [PATCH] pcbnew: Update plot dialog to contain a unit selector for DXF --- pcbnew/dialogs/dialog_plot_base.cpp | 24 ++++- pcbnew/dialogs/dialog_plot_base.fbp | 154 ++++++++++++++++++++++++++-- pcbnew/dialogs/dialog_plot_base.h | 4 +- 3 files changed, 169 insertions(+), 13 deletions(-) diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index d60ef19a81..7e14300cc5 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -304,9 +304,9 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_SizerDXF_options = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("DXF Options") ), wxVERTICAL ); - m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot all layers in outline (polygon) mode"), wxDefaultPosition, wxDefaultSize, 0 ); + m_DXF_plotModeOpt = new wxCheckBox( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Plot graphic items using their contours"), wxDefaultPosition, wxDefaultSize, 0 ); m_DXF_plotModeOpt->SetValue(true); - m_DXF_plotModeOpt->SetToolTip( _("DXF only:\nCheck to plot all layers in polygon mode.\nUncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab)\nand plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask)") ); + m_DXF_plotModeOpt->SetToolTip( _("Uncheck to plot graphic items using their center lines") ); m_SizerDXF_options->Add( m_DXF_plotModeOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -315,6 +315,24 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_SizerDXF_options->Add( m_DXF_plotTextStrokeFontOpt, 0, wxALL, 5 ); + wxBoxSizer* dxfSizer1; + dxfSizer1 = new wxBoxSizer( wxHORIZONTAL ); + + DXF_exportUnitsLabel = new wxStaticText( m_SizerDXF_options->GetStaticBox(), wxID_ANY, _("Export units:"), wxDefaultPosition, wxDefaultSize, 0 ); + DXF_exportUnitsLabel->Wrap( -1 ); + dxfSizer1->Add( DXF_exportUnitsLabel, 0, wxALIGN_CENTER|wxALIGN_LEFT|wxALL, 5 ); + + wxString m_DXF_plotUnitsChoices[] = { _("Inches"), _("Millimeters") }; + int m_DXF_plotUnitsNChoices = sizeof( m_DXF_plotUnitsChoices ) / sizeof( wxString ); + m_DXF_plotUnits = new wxChoice( m_SizerDXF_options->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DXF_plotUnitsNChoices, m_DXF_plotUnitsChoices, 0 ); + m_DXF_plotUnits->SetSelection( 0 ); + m_DXF_plotUnits->SetToolTip( _("The units to use for the exported DXF file") ); + + dxfSizer1->Add( m_DXF_plotUnits, 0, wxALIGN_CENTER|wxALL, 5 ); + + + m_SizerDXF_options->Add( dxfSizer1, 1, wxEXPAND, 5 ); + m_PlotOptionsSizer->Add( m_SizerDXF_options, 0, wxEXPAND|wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 1368bb541a..cbbe0e9628 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -1862,7 +1862,7 @@ 5 wxALL|wxEXPAND 0 - + wxID_ANY Gerber Options @@ -1870,11 +1870,11 @@ wxHORIZONTAL 1 protected - + 5 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 - + wxHORIZONTAL 2 @@ -2493,11 +2493,11 @@ - + 5 wxALIGN_CENTER_VERTICAL|wxBOTTOM 0 - + 1 1 1 @@ -2554,11 +2554,11 @@ -1 - + 5 wxEXPAND 11 - + 0 protected 0 @@ -3163,7 +3163,7 @@ 0 0 wxID_ANY - Plot all layers in outline (polygon) mode + Plot graphic items using their contours 0 @@ -3184,7 +3184,7 @@ 0 - DXF only: Check to plot all layers in polygon mode. Uncheck to plot in sketch mode layers that don't support polygons (*.SilkS, *_User, Edge.Cuts, Margin, *.CrtYd, *.Fab) and plot in polygon mode other layers (*.Cu, *.Adhes, *.Paste, *.Mask) + Uncheck to plot graphic items using their center lines wxFILTER_NONE wxDefaultValidator @@ -3259,6 +3259,142 @@ + + 5 + wxEXPAND + 1 + + + dxfSizer1 + wxHORIZONTAL + none + + 5 + wxALIGN_CENTER|wxALIGN_LEFT|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Export units: + 0 + + 0 + + + 0 + + 1 + DXF_exportUnitsLabel + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + -1 + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Inches" "Millimeters" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_DXF_plotUnits + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + ; ; forward_declare + 0 + The units to use for the exported DXF file + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index f4cf8b3bfb..063d263521 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 1 2018) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -110,6 +110,8 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxStaticBoxSizer* m_SizerDXF_options; wxCheckBox* m_DXF_plotModeOpt; wxCheckBox* m_DXF_plotTextStrokeFontOpt; + wxStaticText* DXF_exportUnitsLabel; + wxChoice* m_DXF_plotUnits; WX_HTML_REPORT_PANEL* m_messagesPanel; wxBoxSizer* m_sizerButtons; wxButton* m_buttonDRC;