From 1831b2329a97d8ede41b710c6cc773a995983480 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Mon, 21 Sep 2015 11:36:13 -0400 Subject: [PATCH] Pcbnew: minor keep out zone properties dialog fixes. * UI capitalization policy fixes. * Set OK button as the default. * Use default dialog size to allow sizers to do their job. * Minor grammar and abbreviation string fixes. --- .../dialog_keepout_area_properties.cpp | 26 ++++++++++++------- .../dialog_keepout_area_properties_base.cpp | 17 ++++++------ .../dialog_keepout_area_properties_base.fbp | 16 ++++++------ .../dialog_keepout_area_properties_base.h | 4 +-- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/pcbnew/dialogs/dialog_keepout_area_properties.cpp b/pcbnew/dialogs/dialog_keepout_area_properties.cpp index 76da0e5802..583d4a9c37 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties.cpp +++ b/pcbnew/dialogs/dialog_keepout_area_properties.cpp @@ -7,7 +7,7 @@ * * Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,7 +29,6 @@ #include #include -//#include #include #include #include @@ -57,7 +56,7 @@ public: private: PCB_BASE_FRAME* m_parent; - wxConfigBase* m_config; ///< Current config + wxConfigBase* m_config; ///< Current config ZONE_SETTINGS m_zonesettings; ZONE_SETTINGS* m_ptr; @@ -102,7 +101,8 @@ ZONE_EDIT_T InvokeKeepoutAreaEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSe } -DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) : +DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME* aParent, + ZONE_SETTINGS* aSettings ) : DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( aParent ) { m_parent = aParent; @@ -111,10 +111,11 @@ DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME* m_ptr = aSettings; m_zonesettings = *aSettings; - SetReturnCode( ZONE_ABORT ); // Will be changed on button OK ckick + SetReturnCode( ZONE_ABORT ); // Will be changed on button OK click initDialog(); + m_sdbSizerButtonsOK->SetDefault(); GetSizer()->SetSizeHints( this ); Center(); } @@ -183,11 +184,13 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog() m_cbCopperPourCtrl->SetValue( m_zonesettings.GetDoNotAllowCopperPour() ); } + void DIALOG_KEEPOUT_AREA_PROPERTIES::OnCancelClick( wxCommandEvent& event ) { EndModal( ZONE_ABORT ); } + void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event ) { if( AcceptOptionsForKeepOut() ) @@ -197,6 +200,7 @@ void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event ) } } + bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut() { // Init keepout parameters: @@ -209,11 +213,11 @@ bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut() if( ! m_zonesettings.GetDoNotAllowTracks() && ! m_zonesettings.GetDoNotAllowVias() && ! m_zonesettings.GetDoNotAllowCopperPour() ) - { - DisplayError( NULL, - _("Tracks, vias and pads are allowed. The keepout is useless" ) ); - return false; - } + { + DisplayError( NULL, + _("Tracks, vias, and pads are allowed. The keepout is useless" ) ); + return false; + } // Get the layer selection for this zone int ii = m_LayerSelectionCtrl->GetFirstSelected(); @@ -225,6 +229,7 @@ bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut() } m_zonesettings.m_CurrentZone_Layer = ToLAYER_ID( m_layerId[ii] ); + switch( m_OutlineAppearanceCtrl->GetSelection() ) { case 0: @@ -256,6 +261,7 @@ bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut() return true; } + wxBitmap DIALOG_KEEPOUT_AREA_PROPERTIES::makeLayerBitmap( EDA_COLOR_T aColor ) { wxBitmap bitmap( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp b/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp index 6cb5f83d8b..0665261b29 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -44,28 +44,28 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWind m_staticTextprops->Wrap( -1 ); bSizerRight->Add( m_staticTextprops, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") }; + wxString m_OrientEdgesOptChoices[] = { _("Any"), _("180, 90, and 45 degrees") }; int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString ); - m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); - m_OrientEdgesOpt->SetSelection( 0 ); + m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edge Orientation:"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); + m_OrientEdgesOpt->SetSelection( 1 ); bSizerRight->Add( m_OrientEdgesOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") }; int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString ); - m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outline Appearence:"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_OutlineAppearanceCtrl->SetSelection( 1 ); bSizerRight->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizerCutoutOpts; sbSizerCutoutOpts = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Keepout Options:") ), wxVERTICAL ); - m_cbTracksCtrl = new wxCheckBox( this, wxID_ANY, _("No Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTracksCtrl = new wxCheckBox( this, wxID_ANY, _("No tracks"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerCutoutOpts->Add( m_cbTracksCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No Vias"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No vias"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - m_cbCopperPourCtrl = new wxCheckBox( this, wxID_ANY, _("No Copper Pour"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbCopperPourCtrl = new wxCheckBox( this, wxID_ANY, _("No copper pour"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizerCutoutOpts->Add( m_cbCopperPourCtrl, 0, wxALL|wxEXPAND, 5 ); @@ -92,6 +92,7 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWind this->SetSizer( m_MainSizer ); this->Layout(); + m_MainSizer->Fit( this ); this->Centre( wxBOTH ); } diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp b/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp index f9f1d7243d..926ae8b818 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp @@ -44,7 +44,7 @@ DIALOG_KEEPOUT_AREA_PROPERTIES_BASE - 358,338 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Keepout Area Properties @@ -411,7 +411,7 @@ 1 0 - "Any" "H, V and 45 deg" + "Any" "180, 90, and 45 degrees" 1 1 @@ -426,7 +426,7 @@ 0 0 wxID_ANY - Zone Edges Orient + Zone Edge Orientation: 1 0 @@ -443,7 +443,7 @@ 1 Resizable - 0 + 1 1 wxRA_SPECIFY_COLS @@ -516,7 +516,7 @@ 0 0 wxID_ANY - Outlines Appearence + Outline Appearence: 1 0 @@ -618,7 +618,7 @@ 0 0 wxID_ANY - No Tracks + No tracks 0 @@ -706,7 +706,7 @@ 0 0 wxID_ANY - No Vias + No vias 0 @@ -794,7 +794,7 @@ 0 0 wxID_ANY - No Copper Pour + No copper pour 0 diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.h b/pcbnew/dialogs/dialog_keepout_area_properties_base.h index c9973f58b3..3f38de5315 100644 --- a/pcbnew/dialogs/dialog_keepout_area_properties_base.h +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 9 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -67,7 +67,7 @@ class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM public: - DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Keepout Area Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 358,338 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); + DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Keepout Area Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); ~DIALOG_KEEPOUT_AREA_PROPERTIES_BASE(); };