Improve clarity in the Print dialog around edge cuts layer.

Fixes https://gitlab.com/kicad/code/kicad/issues/8200
This commit is contained in:
Jeff Young 2021-04-16 13:12:55 +01:00
parent c52bc7eaf9
commit 3a6a919097
16 changed files with 330 additions and 258 deletions

View File

@ -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 );

View File

@ -14,7 +14,6 @@
<property name="file">dialog_print_generic_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">DIALOG_PRINT_GENERIC</property>
@ -26,7 +25,6 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -67,7 +65,7 @@
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bUpperSizer</property>
<property name="name">m_bUpperSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
@ -76,7 +74,7 @@
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bOptionsSizer</property>
<property name="name">bRightCol</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
@ -87,13 +85,13 @@
<property name="id">wxID_ANY</property>
<property name="label">Options</property>
<property name="minimum_size"></property>
<property name="name">sbOptionsSizer</property>
<property name="name">m_sbOptionsSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxGridBagSizer" expanded="1">
<property name="empty_cell_size">-1,10</property>
@ -102,15 +100,15 @@
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">gbOptionsSizer</property>
<property name="name">m_gbOptionsSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">protected</property>
<property name="vgap">2</property>
<property name="vgap">3</property>
<object class="gbsizeritem" expanded="0">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
@ -174,7 +172,7 @@
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxChoice" expanded="0">
@ -241,7 +239,7 @@
<property name="border">5</property>
<property name="colspan">3</property>
<property name="column">0</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="0">
@ -322,7 +320,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -389,14 +387,14 @@
<property name="flag"></property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">2</property>
<property name="height">5</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -461,6 +459,16 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">3</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
@ -469,7 +477,7 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioButton" expanded="0">
<property name="BottomDockable">1</property>
@ -533,7 +541,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="flag">wxEXPAND|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>

View File

@ -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;

View File

@ -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();
}
/**

View File

@ -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 );
}

View File

@ -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 );
}

View File

@ -14,7 +14,6 @@
<property name="file">dialog_export_svg_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="name">dialog_export_svg</property>
@ -26,7 +25,6 @@
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
@ -207,7 +205,6 @@
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="bitmap"></property>
@ -711,70 +708,6 @@
<property name="border">5</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Print board edges</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_PrintBoardEdgesCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Print (or not) the edges layer on others layers</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
@ -835,11 +768,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="0">
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -853,7 +786,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;One file per layer&quot; &quot;All layers in a single file&quot;</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -868,8 +801,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Pagination</property>
<property name="majorDimension">1</property>
<property name="label">Print one page per layer</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -877,7 +809,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_rbFileOpt</property>
<property name="name">m_checkboxPagePerLayer</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -885,11 +817,10 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
@ -899,6 +830,91 @@
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnCheckBox">onPagePerLayerClicked</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">3</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">28</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Print board edges on all pages</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkboxEdgesOnAllPages</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="permission">protected</property>
<property name="width">0</property>
</object>
</object>
</object>

View File

@ -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(); }

View File

@ -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() );

View File

@ -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") );

View File

@ -832,7 +832,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Exclude PCB edge layer from other layers</property>
<property name="label">Plot Edge.Cuts on all layers</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -840,7 +840,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_excludeEdgeLayerOpt</property>
<property name="name">m_includeEdgeLayerOpt</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>

View File

@ -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;

View File

@ -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 );
@ -93,10 +94,10 @@ private:
wxCheckListBox* m_listCopperLayers;
wxButton* m_buttonSelectAll;
wxButton* m_buttonDeselectAll;
wxCheckBox* m_checkboxNoEdge;
wxCheckBox* m_checkboxMirror;
wxChoice* m_drillMarksChoice;
wxRadioBox* m_boxPagination;
wxCheckBox* m_checkboxPagePerLayer;
wxCheckBox* m_checkboxEdgesOnAllPages;
wxCheckBox* m_checkAsItems;
wxCheckBox* m_checkBackground;
wxCheckBox* m_checkUseTheme;
@ -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 );
@ -199,31 +201,32 @@ void DIALOG_PRINT_PCBNEW::createExtraOptions()
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<wxString> 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();

View File

@ -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; }

View File

@ -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<PCBNEW_SETTINGS*>( aConfig ) )
{
m_drillMarks = static_cast<DRILL_MARK_SHAPE_T>( cfg->m_Plot.pads_drill_mode );
m_pagination = static_cast<PAGINATION_T>( cfg->m_Plot.all_layers_on_one_page );
m_DrillMarks = static_cast<DRILL_MARK_SHAPE_T>( cfg->m_Plot.pads_drill_mode );
m_Pagination = static_cast<PAGINATION_T>( 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<PCBNEW_SETTINGS*>( 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<KIGFX::PCB_PRINT_PAINTER&>( 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 );
}

View File

@ -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;