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/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_print_generic_base.h"
@ -26,6 +26,7 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
gbOptionsSizer = new wxGridBagSizer( 2, 0 );
gbOptionsSizer->SetFlexibleDirection( wxBOTH );
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->Wrap( -1 );
@ -55,21 +56,24 @@ DIALOG_PRINT_GENERIC_BASE::DIALOG_PRINT_GENERIC_BASE( wxWindow* parent, wxWindow
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, 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 );
bScaleSizer->Add( m_scaleFit, 0, wxALL|wxTOP, 5 );
bScaleSizer->Add( m_scaleFit, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxHORIZONTAL );
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->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 );

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/
//
// PLEASE DO "NOT" EDIT THIS FILE!
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_PRINT_GENERIC_BASE_H__
#define __DIALOG_PRINT_GENERIC_BASE_H__
#pragma once
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
@ -28,6 +25,9 @@ class DIALOG_SHIM;
#include <wx/radiobut.h>
#include <wx/textctrl.h>
#include <wx/statline.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/button.h>
#include <wx/dialog.h>
@ -80,4 +80,3 @@ class DIALOG_PRINT_GENERIC_BASE : public DIALOG_SHIM
};
#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,
_( "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(
wxEVT_COMMAND_CHECKBOX_CLICKED, &DIALOG_PRINT_PCBNEW::onUseThemeChecked, this );
m_lblTheme = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _( "Color theme:" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_lblTheme = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _( "Theme:" ),
wxDefaultPosition, wxDefaultSize, 0 );
m_lblTheme->Wrap( -1 );
optionsSizer->Add( m_lblTheme, wxGBPosition( rows, 0 ), wxGBSpan( 1, 1 ),
wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxALIGN_CENTER_VERTICAL | wxLEFT, 25 );
wxArrayString m_colorThemeChoices;
m_colorTheme = new wxChoice( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition,
wxDefaultSize, m_colorThemeChoices, 0 );
wxDefaultSize, m_colorThemeChoices, 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
auto drillMarksLabel = new wxStaticText( box, wxID_ANY, _( "Drill marks:" ) );
std::vector<wxString> drillMarkChoices =
{ _( "No drill mark" ), _( "Small mark" ), _( "Real drill" ) };
m_drillMarksChoice = new wxChoice( box, wxID_ANY, wxDefaultPosition,
wxDefaultSize, drillMarkChoices.size(), drillMarkChoices.data(), 0 );
std::vector<wxString> drillMarkChoices = { _( "No drill mark" ),
_( "Small mark" ),
_( "Real drill" ) };
m_drillMarksChoice = new wxChoice( box, wxID_ANY, wxDefaultPosition, wxDefaultSize,
drillMarkChoices.size(), drillMarkChoices.data(), 0 );
m_drillMarksChoice->SetSelection( 0 );
// Print mirrored
m_checkboxMirror = new wxCheckBox( box, wxID_ANY, _( "Print mirrored" ) );
// 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,
wxDefaultSize, pagesOption.size(), pagesOption.data(), 1, wxRA_SPECIFY_COLS );
wxDefaultSize, pagesOption.size(), pagesOption.data(), 1,
wxRA_SPECIFY_COLS );
m_boxPagination->SetSelection( 0 );
// Sizer layout
rows++;
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 ),
wxBOTTOM | wxRIGHT | wxLEFT, 5 );
wxBOTTOM | wxRIGHT | wxLEFT, 5 );
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 ),
wxALL | wxEXPAND, 5 );
wxALL | wxEXPAND, 5 );
}
void DIALOG_PRINT_PCBNEW::createLeftPanel()
{
wxStaticBoxSizer* sbLayersSizer = new wxStaticBoxSizer( new wxStaticBox( this,
wxID_ANY, _( "Included Layers" ) ), wxVERTICAL );
wxStaticBox* box = new wxStaticBox( this, wxID_ANY, _( "Included Layers" ) );
wxStaticBoxSizer* sbLayersSizer = new wxStaticBoxSizer( box, wxVERTICAL );
// 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 );
wxBoxSizer* sizerLeft = new wxBoxSizer( wxVERTICAL );
sizerLeft->Add( copperLabel, 0, wxRIGHT | wxLEFT, 5 );
sizerLeft->Add( m_listCopperLayers, 1, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 );
sizerLeft->Add( copperLabel, 0, wxRIGHT, 5 );
sizerLeft->Add( m_listCopperLayers, 1, wxEXPAND | wxBOTTOM | wxRIGHT, 5 );
// 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 );
wxBoxSizer* sizerRight = new wxBoxSizer( wxVERTICAL );
sizerRight->Add( technicalLabel, 0, wxRIGHT | wxLEFT, 5 );
sizerRight->Add( m_listTechLayers, 1, wxEXPAND | wxBOTTOM | wxRIGHT | wxLEFT, 5 );
sizerRight->Add( technicalLabel, 0, wxLEFT, 5 );
sizerRight->Add( m_listTechLayers, 1, wxEXPAND | wxBOTTOM | wxLEFT, 5 );
// Layer list layout
@ -287,8 +296,8 @@ void DIALOG_PRINT_PCBNEW::createLeftPanel()
wxCommandEventHandler( DIALOG_PRINT_PCBNEW::onDeselectAllClick ), NULL, this );
wxBoxSizer* buttonSizer = new wxBoxSizer( wxHORIZONTAL );
buttonSizer->Add( m_buttonSelectAll, 1, wxALL, 5 );
buttonSizer->Add( m_buttonDeselectAll, 1, wxALL, 5 );
buttonSizer->Add( m_buttonSelectAll, 1, wxRIGHT | wxTOP | wxBOTTOM, 5 );
buttonSizer->Add( m_buttonDeselectAll, 1, wxLEFT | wxTOP | wxBOTTOM, 5 );
// 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") );
// Static box sizer layout
sbLayersSizer->Add( bLayerListsSizer, 1, wxALL | wxEXPAND, 5 );
sbLayersSizer->Add( buttonSizer, 0, wxALL | wxEXPAND, 5 );
sbLayersSizer->Add( m_checkboxNoEdge, 0, wxALL | wxEXPAND, 5 );
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 );
getMainSizer()->Insert( 0, sbLayersSizer, 1, wxEXPAND | wxALL, 5 );
}