Beautify the PCBNew print dialog.

Mostly fix some uneven spacing, but also indent the color theme
selection under the checkbox which controls it.
This commit is contained in:
Jeff Young 2020-08-11 19:52:18 +01:00
parent ee428876ec
commit 7f65b31cb6
4 changed files with 380 additions and 605 deletions

View File

@ -1,8 +1,8 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 17 2016) // C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_print_generic_base.h" #include "dialog_print_generic_base.h"
@ -12,88 +12,92 @@
DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL );
bUpperSizer = new wxBoxSizer( wxHORIZONTAL ); bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bOptionsSizer; wxBoxSizer* bOptionsSizer;
bOptionsSizer = new wxBoxSizer( wxVERTICAL ); bOptionsSizer = new wxBoxSizer( wxVERTICAL );
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL ); sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options") ), wxVERTICAL );
gbOptionsSizer = new wxGridBagSizer( 2, 0 ); gbOptionsSizer = new wxGridBagSizer( 2, 0 );
gbOptionsSizer->SetFlexibleDirection( wxBOTH ); gbOptionsSizer->SetFlexibleDirection( wxBOTH );
gbOptionsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); gbOptionsSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gbOptionsSizer->SetEmptyCellSize( wxSize( -1,10 ) );
m_outputModeLabel = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Output mode:"), wxDefaultPosition, wxDefaultSize, 0 ); m_outputModeLabel = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Output mode:"), wxDefaultPosition, wxDefaultSize, 0 );
m_outputModeLabel->Wrap( -1 ); m_outputModeLabel->Wrap( -1 );
gbOptionsSizer->Add( m_outputModeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); gbOptionsSizer->Add( m_outputModeLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxString m_outputModeChoices[] = { _("Color"), _("Black and white") }; wxString m_outputModeChoices[] = { _("Color"), _("Black and white") };
int m_outputModeNChoices = sizeof( m_outputModeChoices ) / sizeof( wxString ); 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( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_outputModeNChoices, m_outputModeChoices, 0 );
m_outputMode->SetSelection( 0 ); m_outputMode->SetSelection( 0 );
gbOptionsSizer->Add( m_outputMode, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 ); gbOptionsSizer->Add( m_outputMode, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALL|wxEXPAND, 5 );
m_titleBlock = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_FRAME_SEL, _("Print border and title block"), wxDefaultPosition, wxDefaultSize, 0 ); m_titleBlock = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_FRAME_SEL, _("Print border and title block"), wxDefaultPosition, wxDefaultSize, 0 );
m_titleBlock->SetValue(true); m_titleBlock->SetValue(true);
m_titleBlock->SetToolTip( _("Print Frame references.") ); m_titleBlock->SetToolTip( _("Print Frame references.") );
gbOptionsSizer->Add( m_titleBlock, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxALL|wxEXPAND, 5 ); gbOptionsSizer->Add( m_titleBlock, wxGBPosition( 1, 0 ), wxGBSpan( 1, 3 ), wxALL|wxEXPAND, 5 );
gbOptionsSizer->AddGrowableCol( 1 ); gbOptionsSizer->AddGrowableCol( 1 );
sbOptionsSizer->Add( gbOptionsSizer, 1, wxEXPAND, 5 ); sbOptionsSizer->Add( gbOptionsSizer, 1, wxEXPAND, 5 );
bOptionsSizer->Add( sbOptionsSizer, 1, wxEXPAND|wxALL, 5 ); bOptionsSizer->Add( sbOptionsSizer, 1, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* bScaleSizer; wxStaticBoxSizer* bScaleSizer;
bScaleSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Scale") ), wxVERTICAL ); bScaleSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Scale") ), wxVERTICAL );
m_scale1 = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("1:1"), wxDefaultPosition, wxDefaultSize, 0 ); m_scale1 = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("1:1"), wxDefaultPosition, wxDefaultSize, 0 );
bScaleSizer->Add( m_scale1, 0, wxALL, 5 ); bScaleSizer->Add( m_scale1, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bScaleSizer->Add( 0, 2, 0, 0, 5 );
m_scaleFit = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("Fit to page"), wxDefaultPosition, wxDefaultSize, 0 ); m_scaleFit = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("Fit to page"), wxDefaultPosition, wxDefaultSize, 0 );
bScaleSizer->Add( m_scaleFit, 0, wxALL|wxTOP, 5 ); bScaleSizer->Add( m_scaleFit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer10; wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxHORIZONTAL ); bSizer10 = new wxBoxSizer( wxHORIZONTAL );
m_scaleCustom = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("Custom:"), wxDefaultPosition, wxDefaultSize, 0 ); m_scaleCustom = new wxRadioButton( bScaleSizer->GetStaticBox(), wxID_ANY, _("Custom:"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer10->Add( m_scaleCustom, 0, wxALL|wxTOP, 5 ); bSizer10->Add( m_scaleCustom, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_scaleCustomText = new wxTextCtrl( bScaleSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_scaleCustomText = new wxTextCtrl( bScaleSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_scaleCustomText->SetToolTip( _("Set X scale adjust for exact scale plotting") ); m_scaleCustomText->SetToolTip( _("Set X scale adjust for exact scale plotting") );
bSizer10->Add( m_scaleCustomText, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bSizer10->Add( m_scaleCustomText, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
bScaleSizer->Add( bSizer10, 1, wxEXPAND, 5 ); bScaleSizer->Add( bSizer10, 1, wxEXPAND, 5 );
bOptionsSizer->Add( bScaleSizer, 0, wxALL|wxEXPAND, 5 ); bOptionsSizer->Add( bScaleSizer, 0, wxALL|wxEXPAND, 5 );
bUpperSizer->Add( bOptionsSizer, 1, wxEXPAND, 5 ); bUpperSizer->Add( bOptionsSizer, 1, wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 ); bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 ); bMainSizer->Add( m_staticline1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 10 );
wxBoxSizer* bButtonsSizer; wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Setup..."), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOption = new wxButton( this, wxID_PRINT_OPTIONS, _("Page Setup..."), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOption->SetMinSize( wxSize( 120,-1 ) ); m_buttonOption->SetMinSize( wxSize( 120,-1 ) );
bButtonsSizer->Add( m_buttonOption, 0, wxALL|wxEXPAND, 5 ); bButtonsSizer->Add( m_buttonOption, 0, wxALL|wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK ); m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK ); m_sdbSizer1->AddButton( m_sdbSizer1OK );
@ -102,18 +106,18 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize(); m_sdbSizer1->Realize();
bButtonsSizer->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 ); bButtonsSizer->Add( m_sdbSizer1, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bButtonsSizer, 0, wxEXPAND|wxLEFT, 10 ); bMainSizer->Add( bButtonsSizer, 0, wxEXPAND|wxLEFT, 10 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
this->Layout(); this->Layout();
this->Centre( wxBOTH ); this->Centre( wxBOTH );
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_GENERIC_BASE::onClose ) ); this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PRINT_GENERIC_BASE::onClose ) );
m_scaleCustomText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onSetCustomScale ), NULL, this ); m_scaleCustomText->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onSetCustomScale ), NULL, this );
@ -132,5 +136,5 @@ DIALOG_PRINT_GENERIC_BASE::~DIALOG_PRINT_GENERIC_BASE()
m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintPreview ), NULL, this ); m_sdbSizer1Apply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintPreview ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onCloseButton ), NULL, this ); m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onCloseButton ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintButtonClick ), NULL, this ); m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PRINT_GENERIC_BASE::onPrintButtonClick ), NULL, this );
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,15 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jul 17 2016) // C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_PRINT_GENERIC_BASE_H__ #pragma once
#define __DIALOG_PRINT_GENERIC_BASE_H__
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
@ -28,6 +25,9 @@ class DIALOG_SHIM;
#include <wx/radiobut.h> #include <wx/radiobut.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
@ -39,14 +39,14 @@ class DIALOG_SHIM;
class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
enum enum
{ {
wxID_FRAME_SEL = 1000, wxID_FRAME_SEL = 1000,
wxID_PRINT_OPTIONS wxID_PRINT_OPTIONS
}; };
wxBoxSizer* bUpperSizer; wxBoxSizer* bUpperSizer;
wxStaticBoxSizer* sbOptionsSizer; wxStaticBoxSizer* sbOptionsSizer;
wxGridBagSizer* gbOptionsSizer; wxGridBagSizer* gbOptionsSizer;
@ -63,7 +63,7 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
wxButton* m_sdbSizer1OK; wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Apply; wxButton* m_sdbSizer1Apply;
wxButton* m_sdbSizer1Cancel; wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void onClose( wxCloseEvent& event ) { event.Skip(); } virtual void onClose( wxCloseEvent& event ) { event.Skip(); }
virtual void onSetCustomScale( wxCommandEvent& event ) { event.Skip(); } virtual void onSetCustomScale( wxCommandEvent& event ) { event.Skip(); }
@ -71,13 +71,12 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
virtual void onPrintPreview( wxCommandEvent& event ) { event.Skip(); } virtual void onPrintPreview( wxCommandEvent& event ) { event.Skip(); }
virtual void onCloseButton( wxCommandEvent& event ) { event.Skip(); } virtual void onCloseButton( wxCommandEvent& event ) { event.Skip(); }
virtual void onPrintButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void onPrintButtonClick( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 410,476 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Print"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 410,476 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PRINT_GENERIC_BASE(); ~DIALOG_PRINT_GENERIC_BASE();
}; };
#endif //__DIALOG_PRINT_GENERIC_BASE_H__

View File

@ -202,73 +202,82 @@ void DIALOG_PRINT_PCBNEW::createExtraOptions()
m_checkUseTheme = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, m_checkUseTheme = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY,
_( "Use a different color theme for printing" ), wxDefaultPosition, wxDefaultSize, 0 ); _( "Use a different color theme for printing" ), wxDefaultPosition, wxDefaultSize, 0 );
optionsSizer->Add( m_checkUseTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ), wxALL, 5 ); optionsSizer->Add( m_checkUseTheme, wxGBPosition( rows++, 0 ), wxGBSpan( 1, 3 ),
wxLEFT | wxRIGHT | wxTOP, 5 );
m_checkUseTheme->Bind( m_checkUseTheme->Bind(
wxEVT_COMMAND_CHECKBOX_CLICKED, &DIALOG_PRINT_PCBNEW::onUseThemeChecked, this ); wxEVT_COMMAND_CHECKBOX_CLICKED, &DIALOG_PRINT_PCBNEW::onUseThemeChecked, this );
m_lblTheme = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _( "Color theme:" ), m_lblTheme = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _( "Theme:" ),
wxDefaultPosition, wxDefaultSize, 0 ); wxDefaultPosition, wxDefaultSize, 0 );
m_lblTheme->Wrap( -1 ); m_lblTheme->Wrap( -1 );
optionsSizer->Add( m_lblTheme, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ), optionsSizer->Add( m_lblTheme, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ),
wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxALIGN_CENTER_VERTICAL | wxLEFT, 25 );
wxArrayString m_colorThemeChoices; wxArrayString m_colorThemeChoices;
m_colorTheme = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, m_colorTheme = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition,
wxDefaultSize, m_colorThemeChoices, 0 ); wxDefaultSize, m_colorThemeChoices, 0 );
m_colorTheme->SetSelection( 0 ); m_colorTheme->SetSelection( 0 );
optionsSizer->Add( m_colorTheme, wxGBPosition( rows++, 1 ), wxGBSpan( 1, 2 ), wxALL, 5 ); optionsSizer->Add( m_colorTheme, wxGBPosition( rows++, 1 ), wxGBSpan( 1, 2 ),
wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5 );
// Drill marks option // Drill marks option
auto drillMarksLabel = new wxStaticText( box, wxID_ANY, _( "Drill marks:" ) ); auto drillMarksLabel = new wxStaticText( box, wxID_ANY, _( "Drill marks:" ) );
std::vector<wxString> drillMarkChoices = std::vector<wxString> drillMarkChoices = { _( "No drill mark" ),
{ _( "No drill mark" ), _( "Small mark" ), _( "Real drill" ) }; _( "Small mark" ),
m_drillMarksChoice = new wxChoice( box, wxID_ANY, wxDefaultPosition, _( "Real drill" ) };
wxDefaultSize, drillMarkChoices.size(), drillMarkChoices.data(), 0 ); m_drillMarksChoice = new wxChoice( box, wxID_ANY, wxDefaultPosition, wxDefaultSize,
drillMarkChoices.size(), drillMarkChoices.data(), 0 );
m_drillMarksChoice->SetSelection( 0 ); m_drillMarksChoice->SetSelection( 0 );
// Print mirrored // Print mirrored
m_checkboxMirror = new wxCheckBox( box, wxID_ANY, _( "Print mirrored" ) ); m_checkboxMirror = new wxCheckBox( box, wxID_ANY, _( "Print mirrored" ) );
// Pagination // Pagination
std::vector<wxString> pagesOption = { _( "One page per layer" ), _( "All layers on single page" ) }; std::vector<wxString> pagesOption = { _( "One page per layer" ),
_( "All layers on single page" ) };
m_boxPagination = new wxRadioBox( box, wxID_ANY, _( "Pagination" ), wxDefaultPosition, m_boxPagination = new wxRadioBox( box, wxID_ANY, _( "Pagination" ), wxDefaultPosition,
wxDefaultSize, pagesOption.size(), pagesOption.data(), 1, wxRA_SPECIFY_COLS ); wxDefaultSize, pagesOption.size(), pagesOption.data(), 1,
wxRA_SPECIFY_COLS );
m_boxPagination->SetSelection( 0 ); m_boxPagination->SetSelection( 0 );
// Sizer layout // Sizer layout
rows++;
optionsSizer->Add( drillMarksLabel, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ), optionsSizer->Add( drillMarksLabel, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ),
wxBOTTOM | wxRIGHT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5 ); wxBOTTOM | wxRIGHT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5 );
optionsSizer->Add( m_drillMarksChoice, wxGBPosition( rows, 1 ), wxGBSpan( 1, cols - 1 ), optionsSizer->Add( m_drillMarksChoice, wxGBPosition( rows, 1 ), wxGBSpan( 1, cols - 1 ),
wxBOTTOM | wxRIGHT | wxLEFT, 5 ); wxBOTTOM | wxRIGHT | wxLEFT, 5 );
optionsSizer->Add( m_checkboxMirror, wxGBPosition( rows + 1, 0 ), wxGBSpan( 1, cols ), optionsSizer->Add( m_checkboxMirror, wxGBPosition( rows + 1, 0 ), wxGBSpan( 1, cols ),
wxBOTTOM | wxRIGHT | wxLEFT, 5 ); wxBOTTOM | wxRIGHT | wxLEFT, 5 );
optionsSizer->Add( m_boxPagination, wxGBPosition( rows + 2, 0 ), wxGBSpan( 1, cols ), optionsSizer->Add( m_boxPagination, wxGBPosition( rows + 2, 0 ), wxGBSpan( 1, cols ),
wxALL | wxEXPAND, 5 ); wxALL | wxEXPAND, 5 );
} }
void DIALOG_PRINT_PCBNEW::createLeftPanel() void DIALOG_PRINT_PCBNEW::createLeftPanel()
{ {
wxStaticBoxSizer* sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxStaticBox* box = new wxStaticBox( this, wxID_ANY, _( "Included Layers" ) );
wxID_ANY, _( "Included Layers" ) ), wxVERTICAL ); wxStaticBoxSizer* sbLayersSizer = new wxStaticBoxSizer( box, wxVERTICAL );
// Copper layer list // Copper layer list
auto copperLabel = new wxStaticText( sbLayersSizer->GetStaticBox(), wxID_ANY, _( "Copper layers:" ) ); auto copperLabel = new wxStaticText( sbLayersSizer->GetStaticBox(), wxID_ANY,
_( "Copper layers:" ) );
m_listCopperLayers = new wxCheckListBox( sbLayersSizer->GetStaticBox(), wxID_ANY ); m_listCopperLayers = new wxCheckListBox( sbLayersSizer->GetStaticBox(), wxID_ANY );
wxBoxSizer* sizerLeft = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* sizerLeft = new wxBoxSizer( wxVERTICAL );
sizerLeft->Add( copperLabel, 0, wxRIGHT | wxLEFT, 5 ); sizerLeft->Add( copperLabel, 0, wxRIGHT, 5 );
sizerLeft->Add( m_listCopperLayers, 1, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 ); sizerLeft->Add( m_listCopperLayers, 1, wxEXPAND | wxBOTTOM | wxRIGHT, 5 );
// Technical layer list // Technical layer list
auto technicalLabel = new wxStaticText( sbLayersSizer->GetStaticBox(), wxID_ANY, _( "Technical layers:" ) ); auto technicalLabel = new wxStaticText( sbLayersSizer->GetStaticBox(), wxID_ANY,
_( "Technical layers:" ) );
m_listTechLayers = new wxCheckListBox( sbLayersSizer->GetStaticBox(), wxID_ANY ); m_listTechLayers = new wxCheckListBox( sbLayersSizer->GetStaticBox(), wxID_ANY );
wxBoxSizer* sizerRight = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* sizerRight = new wxBoxSizer( wxVERTICAL );
sizerRight->Add( technicalLabel, 0, wxRIGHT | wxLEFT, 5 ); sizerRight->Add( technicalLabel, 0, wxLEFT, 5 );
sizerRight->Add( m_listTechLayers, 1, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 ); sizerRight->Add( m_listTechLayers, 1, wxEXPAND | wxBOTTOM | wxLEFT, 5 );
// Layer list layout // Layer list layout
@ -287,8 +296,8 @@ void DIALOG_PRINT_PCBNEW::createLeftPanel()
wxCommandEventHandler( DIALOG_PRINT_PCBNEW::onDeselectAllClick ), NULL, this ); wxCommandEventHandler( DIALOG_PRINT_PCBNEW::onDeselectAllClick ), NULL, this );
wxBoxSizer* buttonSizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* buttonSizer = new wxBoxSizer( wxHORIZONTAL );
buttonSizer->Add( m_buttonSelectAll, 1, wxALL, 5 ); buttonSizer->Add( m_buttonSelectAll, 1, wxRIGHT | wxTOP | wxBOTTOM, 5 );
buttonSizer->Add( m_buttonDeselectAll, 1, wxALL, 5 ); buttonSizer->Add( m_buttonDeselectAll, 1, wxLEFT | wxTOP | wxBOTTOM, 5 );
// Exclude Edge.Pcb layer checkbox // Exclude Edge.Pcb layer checkbox
@ -296,11 +305,11 @@ void DIALOG_PRINT_PCBNEW::createLeftPanel()
m_checkboxNoEdge->SetToolTip( _("Exclude contents of Edges_Pcb layer from all other layers") ); m_checkboxNoEdge->SetToolTip( _("Exclude contents of Edges_Pcb layer from all other layers") );
// Static box sizer layout // Static box sizer layout
sbLayersSizer->Add( bLayerListsSizer, 1, wxALL | wxEXPAND, 5 ); sbLayersSizer->Add( bLayerListsSizer, 1, wxRIGHT | wxEXPAND, 5 );
sbLayersSizer->Add( buttonSizer, 0, wxALL | wxEXPAND, 5 ); sbLayersSizer->Add( buttonSizer, 0, wxRIGHT | wxEXPAND, 5 );
sbLayersSizer->Add( m_checkboxNoEdge, 0, wxALL | wxEXPAND, 5 ); sbLayersSizer->Add( m_checkboxNoEdge, 0, wxTOP | wxRIGHT | wxBOTTOM | wxEXPAND, 5 );
getMainSizer()->Insert( 0, sbLayersSizer, 1, wxEXPAND ); getMainSizer()->Insert( 0, sbLayersSizer, 1, wxEXPAND | wxALL, 5 );
} }