From 3a6a919097990aafc97bd2ae27231321805898de Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 16 Apr 2021 13:12:55 +0100 Subject: [PATCH] Improve clarity in the Print dialog around edge cuts layer. Fixes https://gitlab.com/kicad/code/kicad/issues/8200 --- common/dialogs/dialog_print_generic_base.cpp | 57 ++++--- common/dialogs/dialog_print_generic_base.fbp | 40 +++-- common/dialogs/dialog_print_generic_base.h | 8 +- include/dialogs/dialog_print_generic.h | 6 +- pcbnew/dialogs/dialog_export_svg.cpp | 43 ++++- pcbnew/dialogs/dialog_export_svg_base.cpp | 28 +-- pcbnew/dialogs/dialog_export_svg_base.fbp | 170 ++++++++++--------- pcbnew/dialogs/dialog_export_svg_base.h | 9 +- pcbnew/dialogs/dialog_plot.cpp | 14 +- pcbnew/dialogs/dialog_plot_base.cpp | 6 +- pcbnew/dialogs/dialog_plot_base.fbp | 4 +- pcbnew/dialogs/dialog_plot_base.h | 2 +- pcbnew/dialogs/dialog_print_pcbnew.cpp | 154 +++++++++-------- pcbnew/pcb_plot_params.h | 11 +- pcbnew/pcbnew_printout.cpp | 28 +-- pcbnew/pcbnew_printout.h | 8 +- 16 files changed, 330 insertions(+), 258 deletions(-) diff --git a/common/dialogs/dialog_print_generic_base.cpp b/common/dialogs/dialog_print_generic_base.cpp index 7815a18d64..f57fe06ff9 100644 --- a/common/dialogs/dialog_print_generic_base.cpp +++ b/common/dialogs/dialog_print_generic_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -16,76 +16,79 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow wxBoxSizer* bMainSizer; bMainSizer = new wxBoxSizer( wxVERTICAL ); - bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); + m_bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bOptionsSizer; - bOptionsSizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bRightCol; + bRightCol = new wxBoxSizer( wxVERTICAL ); - sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); + m_sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); - gbOptionsSizer = new wxGridBagSizer( 2, 0 ); - gbOptionsSizer->SetFlexibleDirection( wxBOTH ); - gbOptionsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - gbOptionsSizer->SetEmptyCellSize( wxSize( -1,10 ) ); + m_gbOptionsSizer = new wxGridBagSizer( 3, 0 ); + m_gbOptionsSizer->SetFlexibleDirection( wxBOTH ); + m_gbOptionsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + m_gbOptionsSizer->SetEmptyCellSize( wxSize( -1,10 ) ); - m_outputModeLabel = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Output mode:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_outputModeLabel = new wxStaticText( m_sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Output mode:"), wxDefaultPosition, wxDefaultSize, 0 ); m_outputModeLabel->Wrap( -1 ); - gbOptionsSizer->Add( m_outputModeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_gbOptionsSizer->Add( m_outputModeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxString m_outputModeChoices[] = { _("Color"), _("Black and white") }; int m_outputModeNChoices = sizeof( m_outputModeChoices ) / sizeof( wxString ); - m_outputMode = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_outputModeNChoices, m_outputModeChoices, 0 ); + m_outputMode = new wxChoice( m_sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_outputModeNChoices, m_outputModeChoices, 0 ); m_outputMode->SetSelection( 0 ); - gbOptionsSizer->Add( m_outputMode, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 ); + m_gbOptionsSizer->Add( m_outputMode, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - m_titleBlock = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_FRAME_SEL, _("Print border and title block"), wxDefaultPosition, wxDefaultSize, 0 ); + m_titleBlock = new wxCheckBox( m_sbOptionsSizer->GetStaticBox(), wxID_FRAME_SEL, _("Print border and title block"), wxDefaultPosition, wxDefaultSize, 0 ); m_titleBlock->SetValue(true); m_titleBlock->SetToolTip( _("Print Frame references.") ); - gbOptionsSizer->Add( m_titleBlock, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxALL|wxEXPAND, 5 ); + m_gbOptionsSizer->Add( m_titleBlock, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - gbOptionsSizer->AddGrowableCol( 1 ); + m_gbOptionsSizer->AddGrowableCol( 1 ); - sbOptionsSizer->Add( gbOptionsSizer, 1, wxEXPAND, 5 ); + m_sbOptionsSizer->Add( m_gbOptionsSizer, 1, wxEXPAND|wxBOTTOM|wxRIGHT, 5 ); - bOptionsSizer->Add( sbOptionsSizer, 1, wxEXPAND|wxALL, 5 ); + bRightCol->Add( m_sbOptionsSizer, 1, wxEXPAND|wxALL, 5 ); wxStaticBoxSizer* bScaleSizer; bScaleSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Scale") ), wxVERTICAL ); m_scale1 = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("1:1"), wxDefaultPosition, wxDefaultSize, 0 ); - bScaleSizer->Add( m_scale1, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bScaleSizer->Add( m_scale1, 0, wxRIGHT|wxLEFT, 5 ); - bScaleSizer->Add( 0, 2, 0, 0, 5 ); + bScaleSizer->Add( 0, 5, 0, 0, 5 ); m_scaleFit = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("Fit to page"), wxDefaultPosition, wxDefaultSize, 0 ); - bScaleSizer->Add( m_scaleFit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bScaleSizer->Add( m_scaleFit, 0, wxRIGHT|wxLEFT, 5 ); + + + bScaleSizer->Add( 0, 3, 0, wxEXPAND, 5 ); wxBoxSizer* bSizerScaleCustom; bSizerScaleCustom = new wxBoxSizer( wxHORIZONTAL ); m_scaleCustom = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("Custom:"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerScaleCustom->Add( m_scaleCustom, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizerScaleCustom->Add( m_scaleCustom, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_scaleCustomText = new wxTextCtrl( bScaleSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_scaleCustomText->SetToolTip( _("Set X scale adjust for exact scale plotting") ); - bSizerScaleCustom->Add( m_scaleCustomText, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bSizerScaleCustom->Add( m_scaleCustomText, 1, wxEXPAND|wxRIGHT, 5 ); - bScaleSizer->Add( bSizerScaleCustom, 1, wxEXPAND, 5 ); + bScaleSizer->Add( bSizerScaleCustom, 1, wxEXPAND|wxBOTTOM, 5 ); - bOptionsSizer->Add( bScaleSizer, 0, wxALL|wxEXPAND, 5 ); + bRightCol->Add( bScaleSizer, 0, wxALL|wxEXPAND, 5 ); - bUpperSizer->Add( bOptionsSizer, 1, wxEXPAND, 5 ); + m_bUpperSizer->Add( bRightCol, 1, wxEXPAND, 5 ); - bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 ); + bMainSizer->Add( m_bUpperSizer, 1, wxEXPAND|wxALL, 5 ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); diff --git a/common/dialogs/dialog_print_generic_base.fbp b/common/dialogs/dialog_print_generic_base.fbp index bbc4c9d237..28d0e906dd 100644 --- a/common/dialogs/dialog_print_generic_base.fbp +++ b/common/dialogs/dialog_print_generic_base.fbp @@ -14,7 +14,6 @@ dialog_print_generic_base 1000 none - 1 DIALOG_PRINT_GENERIC @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -67,7 +65,7 @@ 1 - bUpperSizer + m_bUpperSizer wxHORIZONTAL protected @@ -76,7 +74,7 @@ 1 - bOptionsSizer + bRightCol wxVERTICAL none @@ -87,13 +85,13 @@ wxID_ANY Options - sbOptionsSizer + m_sbOptionsSizer wxVERTICAL 1 protected 5 - wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT 1 -1,10 @@ -102,15 +100,15 @@ 0 - gbOptionsSizer + m_gbOptionsSizer wxFLEX_GROWMODE_SPECIFIED protected - 2 + 3 5 1 0 - wxALIGN_CENTER_VERTICAL|wxALL + wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -174,7 +172,7 @@ 5 1 1 - wxALL|wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 1 @@ -241,7 +239,7 @@ 5 3 0 - wxALL|wxEXPAND + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 1 1 @@ -322,7 +320,7 @@ none 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT 0 1 @@ -389,14 +387,14 @@ 0 - 2 + 5 protected 0 5 - wxBOTTOM|wxRIGHT|wxLEFT + wxRIGHT|wxLEFT 0 1 @@ -461,6 +459,16 @@ 5 wxEXPAND + 0 + + 3 + protected + 0 + + + + 5 + wxEXPAND|wxBOTTOM 1 @@ -469,7 +477,7 @@ none 5 - wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT 0 1 @@ -533,7 +541,7 @@ 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + wxEXPAND|wxRIGHT 1 1 diff --git a/common/dialogs/dialog_print_generic_base.h b/common/dialogs/dialog_print_generic_base.h index 843ee3bf01..c2489339d8 100644 --- a/common/dialogs/dialog_print_generic_base.h +++ b/common/dialogs/dialog_print_generic_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -47,9 +47,9 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM wxID_PRINT_OPTIONS }; - wxBoxSizer* bUpperSizer; - wxStaticBoxSizer* sbOptionsSizer; - wxGridBagSizer* gbOptionsSizer; + wxBoxSizer* m_bUpperSizer; + wxStaticBoxSizer* m_sbOptionsSizer; + wxGridBagSizer* m_gbOptionsSizer; wxStaticText* m_outputModeLabel; wxChoice* m_outputMode; wxCheckBox* m_titleBlock; diff --git a/include/dialogs/dialog_print_generic.h b/include/dialogs/dialog_print_generic.h index 7eb37b05c3..02ab8e25df 100644 --- a/include/dialogs/dialog_print_generic.h +++ b/include/dialogs/dialog_print_generic.h @@ -48,17 +48,17 @@ protected: wxSizer* getMainSizer() { - return bUpperSizer; + return m_bUpperSizer; } wxGridBagSizer* getOptionsSizer() { - return gbOptionsSizer; + return m_gbOptionsSizer; } wxStaticBox* getOptionsBox() { - return sbOptionsSizer->GetStaticBox(); + return m_sbOptionsSizer->GetStaticBox(); } /** diff --git a/pcbnew/dialogs/dialog_export_svg.cpp b/pcbnew/dialogs/dialog_export_svg.cpp index bc333edfcf..a4b8d15610 100644 --- a/pcbnew/dialogs/dialog_export_svg.cpp +++ b/pcbnew/dialogs/dialog_export_svg.cpp @@ -61,6 +61,7 @@ private: void OnButtonPlot( wxCommandEvent& event ) override; + void onPagePerLayerClicked( wxCommandEvent& event ) override; void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) override; void ExportSVGFile( bool aOnlyOneFile ); @@ -100,7 +101,7 @@ DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG( PCB_EDIT_FRAME* aParent, BOARD* aBoard ) : DIALOG_EXPORT_SVG::~DIALOG_EXPORT_SVG() { m_printBW = m_ModeColorOption->GetSelection(); - m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; + m_oneFileOnly = !m_checkboxPagePerLayer->GetValue(); m_outputDirectory = m_outputDirectoryName->GetValue(); m_outputDirectory.Replace( wxT( "\\" ), wxT( "/" ) ); @@ -109,10 +110,19 @@ DIALOG_EXPORT_SVG::~DIALOG_EXPORT_SVG() cfg->m_ExportSvg.black_and_white = m_printBW; cfg->m_ExportSvg.mirror = m_printMirror; cfg->m_ExportSvg.one_file = m_oneFileOnly; - cfg->m_ExportSvg.plot_board_edges = m_PrintBoardEdgesCtrl->GetValue(); cfg->m_ExportSvg.page_size = m_rbSvgPageSizeOpt->GetSelection(); cfg->m_ExportSvg.output_dir = m_outputDirectory.ToStdString(); + if( m_checkboxPagePerLayer->GetValue() ) + { + m_oneFileOnly = false; + cfg->m_ExportSvg.plot_board_edges = m_checkboxEdgesOnAllPages->GetValue(); + } + else + { + m_oneFileOnly = true; + } + cfg->m_ExportSvg.layers.clear(); for( unsigned layer = 0; layer < arrayDim( m_boxSelectLayer ); ++layer ) @@ -128,7 +138,7 @@ DIALOG_EXPORT_SVG::~DIALOG_EXPORT_SVG() void DIALOG_EXPORT_SVG::initDialog() { - auto cfg = m_parent->GetPcbNewSettings(); + PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings(); m_printBW = cfg->m_ExportSvg.black_and_white; m_printMirror = cfg->m_ExportSvg.mirror; @@ -136,13 +146,15 @@ void DIALOG_EXPORT_SVG::initDialog() m_outputDirectory = cfg->m_ExportSvg.output_dir; m_rbSvgPageSizeOpt->SetSelection( cfg->m_ExportSvg.page_size ); - m_PrintBoardEdgesCtrl->SetValue( cfg->m_ExportSvg.plot_board_edges ); + m_checkboxPagePerLayer->SetValue( !m_oneFileOnly ); + + wxCommandEvent dummy; + onPagePerLayerClicked( dummy ); m_outputDirectoryName->SetValue( m_outputDirectory ); m_ModeColorOption->SetSelection( m_printBW ? 1 : 0 ); m_printMirrorOpt->SetValue( m_printMirror ); - m_rbFileOpt->SetSelection( m_oneFileOnly ? 1 : 0 ); for( LSEQ seq = m_board->GetEnabledLayers().UIOrder(); seq; ++seq ) { @@ -215,6 +227,23 @@ void DIALOG_EXPORT_SVG::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) } +void DIALOG_EXPORT_SVG::onPagePerLayerClicked( wxCommandEvent& event ) +{ + PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings(); + + if( m_checkboxPagePerLayer->GetValue() ) + { + m_checkboxEdgesOnAllPages->Enable( true ); + m_checkboxEdgesOnAllPages->SetValue( cfg->m_ExportSvg.plot_board_edges ); + } + else + { + m_checkboxEdgesOnAllPages->Enable( false ); + m_checkboxEdgesOnAllPages->SetValue( false ); + } +} + + void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile ) { m_outputDirectory = m_outputDirectoryName->GetValue(); @@ -251,7 +280,7 @@ void DIALOG_EXPORT_SVG::ExportSVGFile( bool aOnlyOneFile ) m_printMaskLayer = aOnlyOneFile ? all_selected : LSET( layer ); - if( m_PrintBoardEdgesCtrl->IsChecked() ) + if( m_checkboxEdgesOnAllPages->GetValue() ) m_printMaskLayer.set( Edge_Cuts ); if( CreateSVGFile( svgPath ) ) @@ -336,7 +365,7 @@ bool DIALOG_EXPORT_SVG::CreateSVGFile( const wxString& aFullFileName ) void DIALOG_EXPORT_SVG::OnButtonPlot( wxCommandEvent& event ) { - m_oneFileOnly = m_rbFileOpt->GetSelection() == 1; + m_oneFileOnly = !m_checkboxPagePerLayer->GetValue(); ExportSVGFile( m_oneFileOnly ); } diff --git a/pcbnew/dialogs/dialog_export_svg_base.cpp b/pcbnew/dialogs/dialog_export_svg_base.cpp index 1a8559df2e..5bfa6d81a9 100644 --- a/pcbnew/dialogs/dialog_export_svg_base.cpp +++ b/pcbnew/dialogs/dialog_export_svg_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Dec 30 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -91,22 +91,22 @@ DIALOG_EXPORT_SVG_BASE::DIALOG_EXPORT_SVG_BASE( wxWindow* parent, wxWindowID id, m_rbSvgPageSizeOpt->SetSelection( 0 ); sbOptionsSizer->Add( m_rbSvgPageSizeOpt, 0, wxEXPAND|wxALL, 5 ); - m_PrintBoardEdgesCtrl = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Print board edges"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PrintBoardEdgesCtrl->SetValue(true); - m_PrintBoardEdgesCtrl->SetToolTip( _("Print (or not) the edges layer on others layers") ); - - sbOptionsSizer->Add( m_PrintBoardEdgesCtrl, 0, wxALL, 5 ); - m_printMirrorOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Print mirrored"), wxDefaultPosition, wxDefaultSize, 0 ); m_printMirrorOpt->SetToolTip( _("Print the layer(s) horizontally mirrored") ); - sbOptionsSizer->Add( m_printMirrorOpt, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); + sbOptionsSizer->Add( m_printMirrorOpt, 0, wxALL, 5 ); - wxString m_rbFileOptChoices[] = { _("One file per layer"), _("All layers in a single file") }; - int m_rbFileOptNChoices = sizeof( m_rbFileOptChoices ) / sizeof( wxString ); - m_rbFileOpt = new wxRadioBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Pagination"), wxDefaultPosition, wxDefaultSize, m_rbFileOptNChoices, m_rbFileOptChoices, 1, wxRA_SPECIFY_COLS ); - m_rbFileOpt->SetSelection( 0 ); - sbOptionsSizer->Add( m_rbFileOpt, 0, wxALL|wxEXPAND, 5 ); + m_checkboxPagePerLayer = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Print one page per layer"), wxDefaultPosition, wxDefaultSize, 0 ); + sbOptionsSizer->Add( m_checkboxPagePerLayer, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + + sbOptionsSizer->Add( 0, 3, 0, wxEXPAND, 5 ); + + m_checkboxEdgesOnAllPages = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Print board edges on all pages"), wxDefaultPosition, wxDefaultSize, 0 ); + sbOptionsSizer->Add( m_checkboxEdgesOnAllPages, 0, wxRIGHT|wxLEFT, 28 ); + + + sbOptionsSizer->Add( 0, 0, 0, wxEXPAND|wxBOTTOM, 5 ); bUpperSizer->Add( sbOptionsSizer, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -141,6 +141,7 @@ DIALOG_EXPORT_SVG_BASE::DIALOG_EXPORT_SVG_BASE( wxWindow* parent, wxWindowID id, // Connect Events m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_SVG_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); + m_checkboxPagePerLayer->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_SVG_BASE::onPagePerLayerClicked ), NULL, this ); m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_SVG_BASE::OnButtonPlot ), NULL, this ); } @@ -148,6 +149,7 @@ DIALOG_EXPORT_SVG_BASE::~DIALOG_EXPORT_SVG_BASE() { // Disconnect Events m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_SVG_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); + m_checkboxPagePerLayer->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_SVG_BASE::onPagePerLayerClicked ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXPORT_SVG_BASE::OnButtonPlot ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_export_svg_base.fbp b/pcbnew/dialogs/dialog_export_svg_base.fbp index e012365e7c..797af9c74f 100644 --- a/pcbnew/dialogs/dialog_export_svg_base.fbp +++ b/pcbnew/dialogs/dialog_export_svg_base.fbp @@ -14,7 +14,6 @@ dialog_export_svg_base 1000 none - 1 dialog_export_svg @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -207,7 +205,6 @@ - 0 @@ -711,70 +708,6 @@ 5 wxALL 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Print board edges - - 0 - - - 0 - - 1 - m_PrintBoardEdgesCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Print (or not) the edges layer on others layers - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - 5 - wxBOTTOM|wxLEFT|wxRIGHT - 0 1 1 @@ -835,11 +768,11 @@ - + 5 - wxALL|wxEXPAND + wxTOP|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -853,7 +786,7 @@ 1 0 - "One file per layer" "All layers in a single file" + 0 1 1 @@ -868,8 +801,7 @@ 0 0 wxID_ANY - Pagination - 1 + Print one page per layer 0 @@ -877,7 +809,7 @@ 0 1 - m_rbFileOpt + m_checkboxPagePerLayer 1 @@ -885,11 +817,10 @@ 1 Resizable - 0 1 - wxRA_SPECIFY_COLS - + + ; ; forward_declare 0 @@ -899,6 +830,91 @@ + onPagePerLayerClicked + + + + 5 + wxEXPAND + 0 + + 3 + protected + 0 + + + + 28 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Print board edges on all pages + + 0 + + + 0 + + 1 + m_checkboxEdgesOnAllPages + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + 5 + wxEXPAND|wxBOTTOM + 0 + + 0 + protected + 0 diff --git a/pcbnew/dialogs/dialog_export_svg_base.h b/pcbnew/dialogs/dialog_export_svg_base.h index c925feed73..ad2ecd98f8 100644 --- a/pcbnew/dialogs/dialog_export_svg_base.h +++ b/pcbnew/dialogs/dialog_export_svg_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Dec 30 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -52,16 +52,17 @@ class DIALOG_EXPORT_SVG_BASE : public DIALOG_SHIM wxCheckListBox* m_TechnicalLayersList; wxRadioBox* m_ModeColorOption; wxRadioBox* m_rbSvgPageSizeOpt; - wxCheckBox* m_PrintBoardEdgesCtrl; wxCheckBox* m_printMirrorOpt; - wxRadioBox* m_rbFileOpt; + wxCheckBox* m_checkboxPagePerLayer; + wxCheckBox* m_checkboxEdgesOnAllPages; WX_HTML_REPORT_PANEL* m_messagesPanel; wxStdDialogButtonSizer* m_sdbSizer1; wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1Cancel; - // Virtual event handlers, override them in your derived class + // Virtual event handlers, overide them in your derived class virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } + virtual void onPagePerLayerClicked( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonPlot( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 0e7f7378a3..4564940343 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -164,7 +164,7 @@ void DIALOG_PLOT::init_Dialog() m_svgUnits->SetSelection( m_plotOpts.GetSvgUseInch() ); // Option for excluding contents of "Edges Pcb" layer - m_excludeEdgeLayerOpt->SetValue( m_plotOpts.GetExcludeEdgeLayer() ); + m_includeEdgeLayerOpt->SetValue( !m_plotOpts.GetExcludeEdgeLayer() ); // Option to exclude pads from silkscreen layers m_sketchPadsOnFabLayers->SetValue( m_plotOpts.GetSketchPadsOnFabLayers() ); @@ -447,7 +447,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); m_defaultPenSize.Enable( false ); - m_excludeEdgeLayerOpt->Enable( true ); + m_includeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( false ); m_scaleOpt->SetSelection( 1 ); m_fineAdjustXCtrl->Enable( false ); @@ -475,7 +475,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); m_defaultPenSize.Enable( false ); - m_excludeEdgeLayerOpt->Enable( true ); + m_includeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( true ); m_fineAdjustXCtrl->Enable( true ); m_fineAdjustYCtrl->Enable( true ); @@ -499,7 +499,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); m_defaultPenSize.Enable( false ); - m_excludeEdgeLayerOpt->Enable( true ); + m_includeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( false ); m_scaleOpt->SetSelection( 1 ); m_fineAdjustXCtrl->Enable( false ); @@ -524,7 +524,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); m_defaultPenSize.Enable( true ); - m_excludeEdgeLayerOpt->Enable( true ); + m_includeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( true ); m_fineAdjustXCtrl->Enable( false ); m_fineAdjustYCtrl->Enable( false ); @@ -548,7 +548,7 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); m_defaultPenSize.Enable( false ); - m_excludeEdgeLayerOpt->Enable( true ); + m_includeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( false ); m_scaleOpt->SetSelection( 1 ); m_fineAdjustXCtrl->Enable( false ); @@ -626,7 +626,7 @@ void DIALOG_PLOT::applyPlotSettings() int sel; PCB_PLOT_PARAMS tempOptions; - tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() ); + tempOptions.SetExcludeEdgeLayer( !m_includeEdgeLayerOpt->GetValue() ); tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() ); tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() ); tempOptions.SetSketchPadsOnFabLayers( m_sketchPadsOnFabLayers->GetValue() ); diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index cd9ec62ac9..34799ba93c 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -90,10 +90,10 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr gbSizer1->Add( m_plotInvisibleText, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); - m_excludeEdgeLayerOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Exclude PCB edge layer from other layers"), wxDefaultPosition, wxDefaultSize, 0 ); - m_excludeEdgeLayerOpt->SetToolTip( _("Do not plot the contents of the PCB edge layer on any other layers.") ); + m_includeEdgeLayerOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Plot Edge.Cuts on all layers"), wxDefaultPosition, wxDefaultSize, 0 ); + m_includeEdgeLayerOpt->SetToolTip( _("Do not plot the contents of the PCB edge layer on any other layers.") ); - gbSizer1->Add( m_excludeEdgeLayerOpt, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_includeEdgeLayerOpt, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sketchPadsOnFabLayers = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Sketch pads on fab layers"), wxDefaultPosition, wxDefaultSize, 0 ); m_sketchPadsOnFabLayers->SetToolTip( _("Include pad outlines on F.Fab and B.Fab layers when plotting") ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 69d21a525a..7144a3934b 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -832,7 +832,7 @@ 0 0 wxID_ANY - Exclude PCB edge layer from other layers + Plot Edge.Cuts on all layers 0 @@ -840,7 +840,7 @@ 0 1 - m_excludeEdgeLayerOpt + m_includeEdgeLayerOpt 1 diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index 54a5e2feca..e843d76785 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -73,7 +73,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxCheckBox* m_plotModuleValueOpt; wxCheckBox* m_plotModuleRefOpt; wxCheckBox* m_plotInvisibleText; - wxCheckBox* m_excludeEdgeLayerOpt; + wxCheckBox* m_includeEdgeLayerOpt; wxCheckBox* m_sketchPadsOnFabLayers; wxCheckBox* m_plotNoViaOnMaskOpt; wxCheckBox* m_useAuxOriginCheckBox; diff --git a/pcbnew/dialogs/dialog_print_pcbnew.cpp b/pcbnew/dialogs/dialog_print_pcbnew.cpp index 425df816d7..6e061484a0 100644 --- a/pcbnew/dialogs/dialog_print_pcbnew.cpp +++ b/pcbnew/dialogs/dialog_print_pcbnew.cpp @@ -60,8 +60,9 @@ private: void onSelectAllClick( wxCommandEvent& event ); void onDeselectAllClick( wxCommandEvent& event ); - void onUseThemeChecked( wxCommandEvent& event ); - void onColorModeChanged( wxCommandEvent& event ); + void onUseThemeClicked( wxCommandEvent& event ); + void onPagePerLayerClicked( wxCommandEvent& event ); + void onColorModeClicked( wxCommandEvent& event ); ///< (Un)check all items in a checklist box. void setListBoxValue( wxCheckListBox* aList, bool aValue ); @@ -91,16 +92,16 @@ private: // Extra widgets wxCheckListBox* m_listTechLayers; wxCheckListBox* m_listCopperLayers; - wxButton* m_buttonSelectAll; - wxButton* m_buttonDeselectAll; - wxCheckBox* m_checkboxNoEdge; - wxCheckBox* m_checkboxMirror; - wxChoice* m_drillMarksChoice; - wxRadioBox* m_boxPagination; - wxCheckBox* m_checkAsItems; - wxCheckBox* m_checkBackground; - wxCheckBox* m_checkUseTheme; - wxChoice* m_colorTheme; + wxButton* m_buttonSelectAll; + wxButton* m_buttonDeselectAll; + wxCheckBox* m_checkboxMirror; + wxChoice* m_drillMarksChoice; + wxCheckBox* m_checkboxPagePerLayer; + wxCheckBox* m_checkboxEdgesOnAllPages; + wxCheckBox* m_checkAsItems; + wxCheckBox* m_checkBackground; + wxCheckBox* m_checkUseTheme; + wxChoice* m_colorTheme; }; @@ -114,7 +115,7 @@ DIALOG_PRINT_PCBNEW::DIALOG_PRINT_PCBNEW( PCB_BASE_EDIT_FRAME* aParent, createExtraOptions(); createLeftPanel(); - m_outputMode->Bind( wxEVT_COMMAND_CHOICE_SELECTED, &DIALOG_PRINT_PCBNEW::onColorModeChanged, + m_outputMode->Bind( wxEVT_COMMAND_CHOICE_SELECTED, &DIALOG_PRINT_PCBNEW::onColorModeClicked, this ); } @@ -147,7 +148,6 @@ bool DIALOG_PRINT_PCBNEW::TransferDataToWindow() } m_checkboxMirror->SetValue( settings()->m_Mirror ); - m_checkboxNoEdge->SetValue( settings()->m_noEdgeLayer ); m_titleBlock->SetValue( settings()->m_titleBlock ); PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings(); @@ -177,13 +177,15 @@ bool DIALOG_PRINT_PCBNEW::TransferDataToWindow() m_colorTheme->SetMinSize( wxSize( minwidth + 50, -1 ) ); wxCommandEvent dummy; - onColorModeChanged( dummy ); + onColorModeClicked( dummy ); // Options to plot pads and vias holes - m_drillMarksChoice->SetSelection( settings()->m_drillMarks ); + m_drillMarksChoice->SetSelection( settings()->m_DrillMarks ); // Print all layers one one page or separately - m_boxPagination->SetSelection( settings()->m_pagination ); + m_checkboxPagePerLayer->SetValue( settings()->m_Pagination + == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE ); + onPagePerLayerClicked( dummy ); // Update the dialog layout when layers are added GetSizer()->Fit( this ); @@ -195,35 +197,36 @@ bool DIALOG_PRINT_PCBNEW::TransferDataToWindow() void DIALOG_PRINT_PCBNEW::createExtraOptions() { wxGridBagSizer* optionsSizer = getOptionsSizer(); - wxStaticBox* box = getOptionsBox(); - int rows = optionsSizer->GetEffectiveRowsCount(); - int cols = optionsSizer->GetEffectiveColsCount(); + wxStaticBox* box = getOptionsBox(); + int rows = optionsSizer->GetEffectiveRowsCount(); + int cols = optionsSizer->GetEffectiveColsCount(); - m_checkAsItems = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, - _( "Print according to objects tab of appearance manager" ), - wxDefaultPosition, wxDefaultSize, 0 ); - optionsSizer->Add( m_checkAsItems, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); + m_checkAsItems = new wxCheckBox( box, wxID_ANY, + _( "Print according to objects tab of appearance manager" ) ); + optionsSizer->Add( m_checkAsItems, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), + wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - m_checkBackground = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, - _( "Print background color" ), wxDefaultPosition, - wxDefaultSize, 0 ); - optionsSizer->Add( m_checkBackground, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); + m_checkBackground = new wxCheckBox( box, wxID_ANY, _( "Print background color" ) ); + optionsSizer->Add( m_checkBackground, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), + wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - m_checkUseTheme = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, - _( "Use a different color theme for printing:" ), - wxDefaultPosition, wxDefaultSize, 0 ); - optionsSizer->Add( m_checkUseTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); + m_checkUseTheme = new wxCheckBox( box, wxID_ANY, + _( "Use a different color theme for printing:" ) ); + optionsSizer->Add( m_checkUseTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), + wxLEFT|wxRIGHT, 5 ); m_checkUseTheme->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, - &DIALOG_PRINT_PCBNEW::onUseThemeChecked, this ); + &DIALOG_PRINT_PCBNEW::onUseThemeClicked, this ); wxArrayString m_colorThemeChoices; - m_colorTheme = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, - wxDefaultSize, m_colorThemeChoices, 0 ); + m_colorTheme = new wxChoice( box, wxID_ANY, wxDefaultPosition, wxDefaultSize, + m_colorThemeChoices, 0 ); m_colorTheme->SetSelection( 0 ); optionsSizer->Add( m_colorTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 2 ), - wxALIGN_CENTER_VERTICAL | wxLEFT, 25 ); + wxLEFT, 28 ); + + rows++; // Drill marks option auto drillMarksLabel = new wxStaticText( box, wxID_ANY, _( "Drill marks:" ) ); @@ -234,28 +237,30 @@ void DIALOG_PRINT_PCBNEW::createExtraOptions() drillMarkChoices.size(), drillMarkChoices.data(), 0 ); m_drillMarksChoice->SetSelection( 0 ); + optionsSizer->Add( drillMarksLabel, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ), + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); + optionsSizer->Add( m_drillMarksChoice, wxGBPosition( rows++, 1 ), wxGBSpan( 1, cols - 1 ), + wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); + // Print mirrored m_checkboxMirror = new wxCheckBox( box, wxID_ANY, _( "Print mirrored" ) ); + optionsSizer->Add( m_checkboxMirror, wxGBPosition( rows++, 0 ), wxGBSpan( 1, cols ), + wxLEFT|wxRIGHT|wxBOTTOM, 5 ); + // Pagination - std::vector pagesOption = { _( "One page per layer" ), - _( "All layers on single page" ) }; - m_boxPagination = new wxRadioBox( box, wxID_ANY, _( "Pagination" ), wxDefaultPosition, - wxDefaultSize, pagesOption.size(), pagesOption.data(), 1, - wxRA_SPECIFY_COLS ); - m_boxPagination->SetSelection( 0 ); + m_checkboxPagePerLayer = new wxCheckBox( box, wxID_ANY, _( "Print one page per layer" ) ); - // Sizer layout - rows++; + m_checkboxPagePerLayer->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, + &DIALOG_PRINT_PCBNEW::onPagePerLayerClicked, this ); - optionsSizer->Add( drillMarksLabel, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ), - wxBOTTOM | wxRIGHT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5 ); - optionsSizer->Add( m_drillMarksChoice, wxGBPosition( rows, 1 ), wxGBSpan( 1, cols - 1 ), - wxBOTTOM | wxRIGHT | wxLEFT, 5 ); - optionsSizer->Add( m_checkboxMirror, wxGBPosition( rows + 1, 0 ), wxGBSpan( 1, cols ), - wxBOTTOM | wxRIGHT | wxLEFT, 5 ); - optionsSizer->Add( m_boxPagination, wxGBPosition( rows + 2, 0 ), wxGBSpan( 1, cols ), - wxALL | wxEXPAND, 5 ); + m_checkboxEdgesOnAllPages = new wxCheckBox( box, wxID_ANY, + _( "Print board edges on all pages" ) ); + + optionsSizer->Add( m_checkboxPagePerLayer, wxGBPosition( rows++, 0 ), wxGBSpan( 1, cols ), + wxLEFT|wxRIGHT, 5 ); + optionsSizer->Add( m_checkboxEdgesOnAllPages, wxGBPosition( rows++, 0 ), wxGBSpan( 1, cols ), + wxLEFT, 28 ); } @@ -304,16 +309,9 @@ void DIALOG_PRINT_PCBNEW::createLeftPanel() buttonSizer->Add( m_buttonSelectAll, 1, wxRIGHT | wxTOP | wxBOTTOM, 5 ); buttonSizer->Add( m_buttonDeselectAll, 1, wxLEFT | wxTOP | wxBOTTOM, 5 ); - - // Exclude Edge.Pcb layer checkbox - m_checkboxNoEdge = new wxCheckBox( sbLayersSizer->GetStaticBox(), wxID_ANY, - _( "Exclude PCB edge layer" ) ); - m_checkboxNoEdge->SetToolTip( _("Exclude contents of Edges_Pcb layer from all other layers") ); - // Static box sizer layout sbLayersSizer->Add( bLayerListsSizer, 1, wxRIGHT | wxEXPAND, 5 ); sbLayersSizer->Add( buttonSizer, 0, wxRIGHT | wxEXPAND, 5 ); - sbLayersSizer->Add( m_checkboxNoEdge, 0, wxTOP | wxRIGHT | wxBOTTOM | wxEXPAND, 5 ); getMainSizer()->Insert( 0, sbLayersSizer, 1, wxEXPAND | wxALL, 5 ); } @@ -333,13 +331,28 @@ void DIALOG_PRINT_PCBNEW::onDeselectAllClick( wxCommandEvent& event ) } -void DIALOG_PRINT_PCBNEW::onUseThemeChecked( wxCommandEvent& event ) +void DIALOG_PRINT_PCBNEW::onUseThemeClicked( wxCommandEvent& event ) { m_colorTheme->Enable( m_checkUseTheme->GetValue() ); } -void DIALOG_PRINT_PCBNEW::onColorModeChanged( wxCommandEvent& event ) +void DIALOG_PRINT_PCBNEW::onPagePerLayerClicked( wxCommandEvent& event ) +{ + if( m_checkboxPagePerLayer->GetValue() ) + { + m_checkboxEdgesOnAllPages->Enable( true ); + m_checkboxEdgesOnAllPages->SetValue( settings()->m_PrintEdgeCutsOnAllPages ); + } + else + { + m_checkboxEdgesOnAllPages->Enable( false ); + m_checkboxEdgesOnAllPages->SetValue( false ); + } +} + + +void DIALOG_PRINT_PCBNEW::onColorModeClicked( wxCommandEvent& event ) { PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings(); @@ -394,10 +407,10 @@ int DIALOG_PRINT_PCBNEW::setLayerSetFromList() } // In Pcbnew force the EDGE layer to be printed or not with the other layers - settings()->m_noEdgeLayer = m_checkboxNoEdge->IsChecked(); + settings()->m_PrintEdgeCutsOnAllPages = m_checkboxEdgesOnAllPages->IsChecked(); // All layers on one page (only if there is at least one layer selected) - if( m_boxPagination->GetSelection() != 0 && pageCount > 0 ) + if( !m_checkboxPagePerLayer->GetValue() && pageCount > 0 ) pageCount = 1; return pageCount; @@ -408,13 +421,20 @@ void DIALOG_PRINT_PCBNEW::saveSettings() { setLayerSetFromList(); - settings()->m_asItemCheckboxes = m_checkAsItems->GetValue(); + settings()->m_AsItemCheckboxes = m_checkAsItems->GetValue(); - settings()->m_drillMarks = + settings()->m_DrillMarks = (PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T) m_drillMarksChoice->GetSelection(); - settings()->m_pagination = m_boxPagination->GetSelection() == 0 - ? PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE : PCBNEW_PRINTOUT_SETTINGS::ALL_LAYERS; + if( m_checkboxPagePerLayer->GetValue() ) + { + settings()->m_Pagination = PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE; + settings()->m_PrintEdgeCutsOnAllPages = m_checkboxEdgesOnAllPages->GetValue(); + } + else + { + settings()->m_Pagination = PCBNEW_PRINTOUT_SETTINGS::ALL_LAYERS; + } settings()->m_Mirror = m_checkboxMirror->GetValue(); diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index b797f87254..635e50d20c 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -277,15 +277,8 @@ public: void SetExcludeEdgeLayer( bool aFlag ) { m_excludeEdgeLayer = aFlag; } bool GetExcludeEdgeLayer() const { return m_excludeEdgeLayer; } - void SetFormat( PLOT_FORMAT aFormat ) - { - m_format = aFormat; - } - - PLOT_FORMAT GetFormat() const - { - return m_format; - } + void SetFormat( PLOT_FORMAT aFormat ) { m_format = aFormat; } + PLOT_FORMAT GetFormat() const { return m_format; } void SetOutputDirectory( wxString aDir ) { m_outputDirectory = aDir; } wxString GetOutputDirectory() const { return m_outputDirectory; } diff --git a/pcbnew/pcbnew_printout.cpp b/pcbnew/pcbnew_printout.cpp index 75af5daed1..ac8b266479 100644 --- a/pcbnew/pcbnew_printout.cpp +++ b/pcbnew/pcbnew_printout.cpp @@ -37,10 +37,10 @@ PCBNEW_PRINTOUT_SETTINGS::PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo ) : BOARD_PRINTOUT_SETTINGS( aPageInfo ) { - m_drillMarks = SMALL_DRILL_SHAPE; - m_pagination = ALL_LAYERS; - m_noEdgeLayer = false; - m_asItemCheckboxes = false; + m_DrillMarks = SMALL_DRILL_SHAPE; + m_Pagination = ALL_LAYERS; + m_PrintEdgeCutsOnAllPages = true; + m_AsItemCheckboxes = false; } @@ -50,8 +50,8 @@ void PCBNEW_PRINTOUT_SETTINGS::Load( APP_SETTINGS_BASE* aConfig ) if( auto cfg = dynamic_cast( aConfig ) ) { - m_drillMarks = static_cast( cfg->m_Plot.pads_drill_mode ); - m_pagination = static_cast( cfg->m_Plot.all_layers_on_one_page ); + m_DrillMarks = static_cast( cfg->m_Plot.pads_drill_mode ); + m_Pagination = static_cast( cfg->m_Plot.all_layers_on_one_page ); m_Mirror = cfg->m_Plot.mirror; } } @@ -63,8 +63,8 @@ void PCBNEW_PRINTOUT_SETTINGS::Save( APP_SETTINGS_BASE* aConfig ) if( auto cfg = dynamic_cast( aConfig ) ) { - cfg->m_Plot.pads_drill_mode = m_drillMarks; - cfg->m_Plot.all_layers_on_one_page = m_pagination; + cfg->m_Plot.pads_drill_mode = m_DrillMarks; + cfg->m_Plot.all_layers_on_one_page = m_Pagination; cfg->m_Plot.mirror = m_Mirror; } } @@ -88,7 +88,7 @@ bool PCBNEW_PRINTOUT::OnPrintPage( int aPage ) PCB_LAYER_ID extractLayer; // compute layer mask from page number if we want one page per layer - if( m_pcbnewSettings.m_pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE ) + if( m_pcbnewSettings.m_Pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE ) { // This sequence is TBD, call a different sequencer if needed, such as Seq(). // Could not find documentation on page order. @@ -110,7 +110,7 @@ bool PCBNEW_PRINTOUT::OnPrintPage( int aPage ) layerName = LSET::Name( extractLayer ); // In Pcbnew we can want the layer EDGE always printed - if( !m_pcbnewSettings.m_noEdgeLayer ) + if( m_pcbnewSettings.m_PrintEdgeCutsOnAllPages ) m_settings.m_LayerSet.set( Edge_Cuts ); DrawPage( layerName, aPage, pageCount ); @@ -144,7 +144,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet RENDER_SETTINGS* renderSettings = aView.GetPainter()->GetSettings(); COLOR4D backgroundColor = renderSettings->GetLayerColor( LAYER_PCB_BACKGROUND ); - if( m_pcbnewSettings.m_asItemCheckboxes ) + if( m_pcbnewSettings.m_AsItemCheckboxes ) { auto setVisibility = [&]( GAL_LAYER_ID aLayer ) @@ -222,7 +222,7 @@ void PCBNEW_PRINTOUT::setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet aView.SetLayerVisible( layer, true ); } - if( m_pcbnewSettings.m_drillMarks != PCBNEW_PRINTOUT_SETTINGS::NO_DRILL_SHAPE ) + if( m_pcbnewSettings.m_DrillMarks != PCBNEW_PRINTOUT_SETTINGS::NO_DRILL_SHAPE ) { // Enable hole layers to draw drill marks for( int layer : { LAYER_PAD_PLATEDHOLES, LAYER_NON_PLATEDHOLES, LAYER_VIA_HOLES } ) @@ -240,7 +240,7 @@ void PCBNEW_PRINTOUT::setupPainter( KIGFX::PAINTER& aPainter ) KIGFX::PCB_PRINT_PAINTER& painter = dynamic_cast( aPainter ); - switch( m_pcbnewSettings.m_drillMarks ) + switch( m_pcbnewSettings.m_DrillMarks ) { case PCBNEW_PRINTOUT_SETTINGS::NO_DRILL_SHAPE: painter.SetDrillMarks( false, 0 ); @@ -264,7 +264,7 @@ void PCBNEW_PRINTOUT::setupPainter( KIGFX::PAINTER& aPainter ) } painter.GetSettings()->SetDrawIndividualViaLayers( - m_pcbnewSettings.m_pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE ); + m_pcbnewSettings.m_Pagination == PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE ); } diff --git a/pcbnew/pcbnew_printout.h b/pcbnew/pcbnew_printout.h index ac614a6af3..04371623c1 100644 --- a/pcbnew/pcbnew_printout.h +++ b/pcbnew/pcbnew_printout.h @@ -34,15 +34,15 @@ struct PCBNEW_PRINTOUT_SETTINGS : BOARD_PRINTOUT_SETTINGS NO_DRILL_SHAPE, SMALL_DRILL_SHAPE, FULL_DRILL_SHAPE - } m_drillMarks; + } m_DrillMarks; enum PAGINATION_T { LAYER_PER_PAGE, ALL_LAYERS - } m_pagination; + } m_Pagination; - bool m_noEdgeLayer; ///< Disable board outline on each page - bool m_asItemCheckboxes; ///< Honor checkboxes in the Items tab of the Layers Manager + bool m_PrintEdgeCutsOnAllPages; ///< Print board outline on each page + bool m_AsItemCheckboxes; ///< Honor checkboxes in the Items tab of the Layers Manager void Load( APP_SETTINGS_BASE* aConfig ) override; void Save( APP_SETTINGS_BASE* aConfig ) override;