From 53f33d39418e475cd3a9dcdbba6185986a5d66b3 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 20 Nov 2013 11:03:09 -0500 Subject: [PATCH] Pcbnew: minor target properties dialog improvements. * Make spacing between controls and dialog frame consistent. * Use default size to allow wxWigdets to determine optimal dialog size. * Set OK button as default so return key works properly. --- pcbnew/dialogs/dialog_target_properties_base.cpp | 5 +++-- pcbnew/dialogs/dialog_target_properties_base.fbp | 6 ++---- pcbnew/dialogs/dialog_target_properties_base.h | 4 ++-- pcbnew/target_edit.cpp | 3 +++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pcbnew/dialogs/dialog_target_properties_base.cpp b/pcbnew/dialogs/dialog_target_properties_base.cpp index 24e12b6ffb..c71a48fcc9 100644 --- a/pcbnew/dialogs/dialog_target_properties_base.cpp +++ b/pcbnew/dialogs/dialog_target_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -76,11 +76,12 @@ TARGET_PROPERTIES_DIALOG_EDITOR_BASE::TARGET_PROPERTIES_DIALOG_EDITOR_BASE( wxWi m_sdbSizerButts->AddButton( m_sdbSizerButtsCancel ); m_sdbSizerButts->Realize(); - bSizerMain->Add( m_sdbSizerButts, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); + bSizerMain->Add( m_sdbSizerButts, 0, wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); this->Centre( wxBOTH ); diff --git a/pcbnew/dialogs/dialog_target_properties_base.fbp b/pcbnew/dialogs/dialog_target_properties_base.fbp index a60d8751bc..fd436604d9 100644 --- a/pcbnew/dialogs/dialog_target_properties_base.fbp +++ b/pcbnew/dialogs/dialog_target_properties_base.fbp @@ -20,10 +20,8 @@ . 1 - 1 1 1 - UI 0 0 @@ -44,7 +42,7 @@ TARGET_PROPERTIES_DIALOG_EDITOR_BASE - 285,170 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Target Properties @@ -900,7 +898,7 @@ 5 - wxALIGN_RIGHT|wxEXPAND + wxALIGN_RIGHT|wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 0 diff --git a/pcbnew/dialogs/dialog_target_properties_base.h b/pcbnew/dialogs/dialog_target_properties_base.h index d4a6d05391..293ffcf675 100644 --- a/pcbnew/dialogs/dialog_target_properties_base.h +++ b/pcbnew/dialogs/dialog_target_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 6 2013) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -57,7 +57,7 @@ class TARGET_PROPERTIES_DIALOG_EDITOR_BASE : public DIALOG_SHIM public: - TARGET_PROPERTIES_DIALOG_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Target Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 285,170 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + TARGET_PROPERTIES_DIALOG_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Target Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~TARGET_PROPERTIES_DIALOG_EDITOR_BASE(); }; diff --git a/pcbnew/target_edit.cpp b/pcbnew/target_edit.cpp index 0e752bc7ab..e5e8d8e10e 100644 --- a/pcbnew/target_edit.cpp +++ b/pcbnew/target_edit.cpp @@ -109,6 +109,9 @@ TARGET_PROPERTIES_DIALOG_EDITOR::TARGET_PROPERTIES_DIALOG_EDITOR( PCB_EDIT_FRAME // Shape m_TargetShape->SetSelection( m_Target->GetShape() ? 1 : 0 ); + // OK button on return key. + SetDefaultItem( m_sdbSizerButtsOK ); + GetSizer()->Fit( this ); GetSizer()->SetSizeHints( this ); Centre();