From b4a47486723b1b6c539d56ac4ffbfb56a80d96f4 Mon Sep 17 00:00:00 2001 From: John Beard Date: Sun, 19 Mar 2017 09:39:38 +0800 Subject: [PATCH] Move sketch mode area in pcbnew display options This gives a bit more space to the GAL options in the left panel Also tidy up some code style and unnecessary default arguments in the GAL display planel widget. --- common/widgets/gal_options_panel.cpp | 35 +- .../dialogs/dialog_display_options_base.cpp | 24 +- .../dialogs/dialog_display_options_base.fbp | 384 +++++++++--------- pcbnew/dialogs/dialog_display_options_base.h | 12 +- 4 files changed, 226 insertions(+), 229 deletions(-) diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 20f8bd96ed..8f9e8f4c73 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -77,14 +77,14 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI { wxStaticBoxSizer* sOpenGLRenderingSizer; sOpenGLRenderingSizer = new wxStaticBoxSizer( new wxStaticBox( this, - wxID_ANY, _("OpenGL Rendering:") ), wxVERTICAL ); + wxID_ANY, _( "OpenGL Rendering:" ) ), wxVERTICAL ); wxString m_choiceAntialiasingChoices[] = { - _("No Antialiasing"), - _("Subpixel Antialiasing (High Quality)"), - _("Subpixel Antialiasing (Ultra Quality)"), - _("Supersampling (2x)"), - _("Supersampling (4x)") + _( "No Antialiasing" ), + _( "Subpixel Antialiasing (High Quality)" ), + _( "Subpixel Antialiasing (Ultra Quality)" ), + _( "Supersampling (2x)" ), + _( "Supersampling (4x)" ) }; int m_choiceAntialiasingNChoices = sizeof( m_choiceAntialiasingChoices ) / sizeof( wxString ); m_choiceAntialiasing = new wxChoice( sOpenGLRenderingSizer->GetStaticBox(), @@ -104,9 +104,9 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI wxID_ANY, _("Grid Display (OpenGL && Cairo)") ), wxVERTICAL ); wxString m_gridStyleChoices[] = { - _("Dots"), - _("Lines"), - _("Small crosses") + _( "Dots" ), + _( "Lines" ), + _( "Small crosses" ) }; int m_gridStyleNChoices = sizeof( m_gridStyleChoices ) / sizeof( wxString ); m_gridStyle = new wxRadioBox( sGridSettings->GetStaticBox(), @@ -122,12 +122,11 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sGridSettingsGrid->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); l_gridLineWidth = new wxStaticText( sGridSettings->GetStaticBox(), - wxID_ANY, _("Grid thickness:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxID_ANY, _( "Grid thickness:" ) ); l_gridLineWidth->Wrap( -1 ); sGridSettingsGrid->Add( l_gridLineWidth, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_gridLineWidth = new wxTextCtrl( sGridSettings->GetStaticBox(), - wxID_ANY, _("0.5"), wxDefaultPosition, wxDefaultSize, 0 ); + m_gridLineWidth = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY ); sGridSettingsGrid->Add( m_gridLineWidth, 0, wxEXPAND, 5 ); m_gridLineWidthSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(), @@ -135,17 +134,16 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sGridSettingsGrid->Add( m_gridLineWidthSpinBtn, 0, wxEXPAND | wxALL, 0 ); l_gridLineWidthUnits = new wxStaticText( sGridSettings->GetStaticBox(), - wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 ); + wxID_ANY, _( "px" ) ); l_gridLineWidthUnits->Wrap( -1 ); sGridSettingsGrid->Add( l_gridLineWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); l_gridMinSpacing = new wxStaticText( sGridSettings->GetStaticBox(), - wxID_ANY, _("Min grid spacing:"), wxDefaultPosition, wxDefaultSize, 0 ); + wxID_ANY, _( "Min grid spacing:" ) ); l_gridMinSpacing->Wrap( -1 ); sGridSettingsGrid->Add( l_gridMinSpacing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - m_gridMinSpacing = new wxTextCtrl( sGridSettings->GetStaticBox(), - wxID_ANY, _("10"), wxDefaultPosition, wxDefaultSize, 0 ); + m_gridMinSpacing = new wxTextCtrl( sGridSettings->GetStaticBox(), wxID_ANY); sGridSettingsGrid->Add( m_gridMinSpacing, 0, wxEXPAND, 5 ); m_gridMinSpacingSpinBtn = new wxSpinButton( sGridSettings->GetStaticBox(), @@ -153,7 +151,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sGridSettingsGrid->Add( m_gridMinSpacingSpinBtn, 0, wxEXPAND | wxALL, 0 ); l_gridMinSpacingUnits = new wxStaticText( sGridSettings->GetStaticBox(), - wxID_ANY, _("px"), wxDefaultPosition, wxDefaultSize, 0 ); + wxID_ANY, _( "px" ) ); l_gridMinSpacingUnits->Wrap( -1 ); sGridSettingsGrid->Add( l_gridMinSpacingUnits, 0, wxALL, 5 ); @@ -179,7 +177,7 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI { auto sCursorSettings = new wxStaticBoxSizer( new wxStaticBox( this, - wxID_ANY, _("Cursor Display (OpenGL && Cairo)") ), wxVERTICAL ); + wxID_ANY, _( "Cursor Display (OpenGL && Cairo)" ) ), wxVERTICAL ); sLeftSizer->Add( sCursorSettings, 1, wxALL | wxEXPAND, 5 ); @@ -187,7 +185,6 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI sCursorSettings->Add( m_forceCursorDisplay, 0, wxALL | wxEXPAND, 5 ); } - } diff --git a/pcbnew/dialogs/dialog_display_options_base.cpp b/pcbnew/dialogs/dialog_display_options_base.cpp index 3dfea20031..ddf6e45d26 100644 --- a/pcbnew/dialogs/dialog_display_options_base.cpp +++ b/pcbnew/dialogs/dialog_display_options_base.cpp @@ -21,18 +21,6 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi sLeftSizer = new wxBoxSizer( wxVERTICAL ); - wxStaticBoxSizer* sSketchModeSizer; - sSketchModeSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tracks and Vias:") ), wxVERTICAL ); - - m_OptDisplayTracks = new wxCheckBox( sSketchModeSizer->GetStaticBox(), wxID_ANY, _("Show tracks in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); - sSketchModeSizer->Add( m_OptDisplayTracks, 0, wxALL, 5 ); - - m_OptDisplayVias = new wxCheckBox( sSketchModeSizer->GetStaticBox(), wxID_ANY, _("Show vias in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); - sSketchModeSizer->Add( m_OptDisplayVias, 0, wxALL, 5 ); - - - sLeftSizer->Add( sSketchModeSizer, 0, wxALL|wxEXPAND, 5 ); - bupperSizer->Add( sLeftSizer, 1, wxEXPAND, 5 ); @@ -61,6 +49,18 @@ DIALOG_DISPLAY_OPTIONS_BASE::DIALOG_DISPLAY_OPTIONS_BASE( wxWindow* parent, wxWi wxBoxSizer* sRightSizer; sRightSizer = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sSketchModeSizer; + sSketchModeSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tracks and Vias:") ), wxVERTICAL ); + + m_OptDisplayTracks = new wxCheckBox( sSketchModeSizer->GetStaticBox(), wxID_ANY, _("Show tracks in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + sSketchModeSizer->Add( m_OptDisplayTracks, 0, wxALL, 5 ); + + m_OptDisplayVias = new wxCheckBox( sSketchModeSizer->GetStaticBox(), wxID_ANY, _("Show vias in sketch mode"), wxDefaultPosition, wxDefaultSize, 0 ); + sSketchModeSizer->Add( m_OptDisplayVias, 0, wxALL, 5 ); + + + sRightSizer->Add( sSketchModeSizer, 0, wxALL|wxEXPAND, 5 ); + wxStaticBoxSizer* sfootprintSizer; sfootprintSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Footprints:") ), wxVERTICAL ); diff --git a/pcbnew/dialogs/dialog_display_options_base.fbp b/pcbnew/dialogs/dialog_display_options_base.fbp index 4e5dcf3049..90ace21801 100644 --- a/pcbnew/dialogs/dialog_display_options_base.fbp +++ b/pcbnew/dialogs/dialog_display_options_base.fbp @@ -111,197 +111,6 @@ sLeftSizer wxVERTICAL protected - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Tracks and Vias: - - sSketchModeSizer - wxVERTICAL - 1 - none - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show tracks in sketch mode - - 0 - - - 0 - - 1 - m_OptDisplayTracks - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Show vias in sketch mode - - 0 - - - 0 - - 1 - m_OptDisplayVias - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -503,11 +312,202 @@ 5 wxEXPAND 0 - + sRightSizer wxVERTICAL none + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Tracks and Vias: + + sSketchModeSizer + wxVERTICAL + 1 + none + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show tracks in sketch mode + + 0 + + + 0 + + 1 + m_OptDisplayTracks + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Show vias in sketch mode + + 0 + + + 0 + + 1 + m_OptDisplayVias + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxEXPAND|wxALL diff --git a/pcbnew/dialogs/dialog_display_options_base.h b/pcbnew/dialogs/dialog_display_options_base.h index 7bc54919f7..641246e7f6 100644 --- a/pcbnew/dialogs/dialog_display_options_base.h +++ b/pcbnew/dialogs/dialog_display_options_base.h @@ -14,15 +14,15 @@ class DIALOG_SHIM; #include "dialog_shim.h" -#include -#include +#include #include +#include +#include #include #include #include -#include #include -#include +#include #include #include @@ -42,10 +42,10 @@ class DIALOG_DISPLAY_OPTIONS_BASE : public DIALOG_SHIM }; wxBoxSizer* sLeftSizer; - wxCheckBox* m_OptDisplayTracks; - wxCheckBox* m_OptDisplayVias; wxRadioBox* m_ShowNetNamesOption; wxRadioBox* m_OptDisplayTracksClearance; + wxCheckBox* m_OptDisplayTracks; + wxCheckBox* m_OptDisplayVias; wxCheckBox* m_OptDisplayModOutlines; wxCheckBox* m_OptDisplayModTexts ;