From 90a53b9aa2d52a0bbbf72ddac0ac15ca3d0ff9d4 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Thu, 6 Aug 2015 11:29:06 -0400 Subject: [PATCH] Pcbnew: set default button in footprint editor options dialog. --- pcbnew/dialogs/dialog_modedit_options.cpp | 7 +++++-- pcbnew/dialogs/dialog_modedit_options_base.cpp | 17 +++++++++-------- pcbnew/dialogs/dialog_modedit_options_base.fbp | 16 ++++++++-------- pcbnew/dialogs/dialog_modedit_options_base.h | 4 ++-- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pcbnew/dialogs/dialog_modedit_options.cpp b/pcbnew/dialogs/dialog_modedit_options.cpp index 4ed4c284b4..aaeea3a5bd 100644 --- a/pcbnew/dialogs/dialog_modedit_options.cpp +++ b/pcbnew/dialogs/dialog_modedit_options.cpp @@ -31,9 +31,10 @@ #include #include -//#include #include + + class DIALOG_MODEDIT_OPTIONS : public DIALOG_MODEDIT_OPTIONS_BASE { BOARD_DESIGN_SETTINGS m_brdSettings; @@ -55,8 +56,9 @@ DIALOG_MODEDIT_OPTIONS::DIALOG_MODEDIT_OPTIONS( FOOTPRINT_EDIT_FRAME* aParent ) { m_parent = aParent; m_brdSettings = m_parent->GetDesignSettings(); - initValues( ); + initValues(); + m_sdbSizer1OK->SetDefault(); GetSizer()->SetSizeHints( this ); Centre(); @@ -108,6 +110,7 @@ void DIALOG_MODEDIT_OPTIONS::initValues() m_spinMaxUndoItems->SetValue( m_parent->GetScreen()->GetMaxUndoItems() ); } + void DIALOG_MODEDIT_OPTIONS::OnOkClick( wxCommandEvent& event ) { m_brdSettings.m_ModuleSegmentWidth = ValueFromTextCtrl( *m_OptModuleGrLineWidth ); diff --git a/pcbnew/dialogs/dialog_modedit_options_base.cpp b/pcbnew/dialogs/dialog_modedit_options_base.cpp index ba5a6244b6..a6b937e112 100644 --- a/pcbnew/dialogs/dialog_modedit_options_base.cpp +++ b/pcbnew/dialogs/dialog_modedit_options_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 13 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -43,7 +43,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi m_staticTextGrLineUnit->Wrap( -1 ); fgSizer1->Add( m_staticTextGrLineUnit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_TextModWidthTitle = new wxStaticText( this, wxID_ANY, _("Text width"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextModWidthTitle = new wxStaticText( this, wxID_ANY, _("Text line width"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextModWidthTitle->Wrap( -1 ); fgSizer1->Add( m_TextModWidthTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -55,7 +55,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi m_staticTextTextWidthUnit->Wrap( -1 ); fgSizer1->Add( m_staticTextTextWidthUnit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_TextModSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text size V"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextModSizeVTitle = new wxStaticText( this, wxID_ANY, _("Text height"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextModSizeVTitle->Wrap( -1 ); fgSizer1->Add( m_TextModSizeVTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -67,7 +67,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi m_staticTextTextVSizeUnit->Wrap( -1 ); fgSizer1->Add( m_staticTextTextVSizeUnit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_TextModSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text size H"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextModSizeHTitle = new wxStaticText( this, wxID_ANY, _("Text width"), wxDefaultPosition, wxDefaultSize, 0 ); m_TextModSizeHTitle->Wrap( -1 ); fgSizer1->Add( m_TextModSizeHTitle, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); @@ -91,7 +91,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi bSizerUpper->Add( m_staticText28, 0, wxALL, 5 ); - m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Leave ref or value blank to use the footprint name as default text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Leave reference or value blank to use the footprint name as default text"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo->Wrap( -1 ); bSizerUpper->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); @@ -103,7 +103,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi fgSizer2->SetFlexibleDirection( wxBOTH ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextRef = new wxStaticText( this, wxID_ANY, _("Ref"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextRef = new wxStaticText( this, wxID_ANY, _("Reference"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRef->Wrap( -1 ); fgSizer2->Add( m_staticTextRef, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); @@ -194,7 +194,7 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi bSizerUpper->Add( fgGeneral, 0, wxEXPAND|wxLEFT, 20 ); - bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 ); + bSizerMain->Add( bSizerUpper, 1, wxALL|wxEXPAND, 5 ); m_sdbSizer1 = new wxStdDialogButtonSizer(); m_sdbSizer1OK = new wxButton( this, wxID_OK ); @@ -203,11 +203,12 @@ DIALOG_MODEDIT_OPTIONS_BASE::DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWi m_sdbSizer1->AddButton( m_sdbSizer1Cancel ); m_sdbSizer1->Realize(); - bSizerMain->Add( m_sdbSizer1, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizerMain->Add( m_sdbSizer1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); this->SetSizer( bSizerMain ); this->Layout(); + bSizerMain->Fit( this ); // Connect Events m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODEDIT_OPTIONS_BASE::OnCancelClick ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_modedit_options_base.fbp b/pcbnew/dialogs/dialog_modedit_options_base.fbp index 74f34c6188..fa34df9c54 100644 --- a/pcbnew/dialogs/dialog_modedit_options_base.fbp +++ b/pcbnew/dialogs/dialog_modedit_options_base.fbp @@ -44,7 +44,7 @@ DIALOG_MODEDIT_OPTIONS_BASE - 504,507 + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Footprint Editor Options @@ -95,7 +95,7 @@ none 5 - wxEXPAND + wxALL|wxEXPAND 1 @@ -490,7 +490,7 @@ 0 0 wxID_ANY - Text width + Text line width 0 @@ -747,7 +747,7 @@ 0 0 wxID_ANY - Text size V + Text height 0 @@ -1004,7 +1004,7 @@ 0 0 wxID_ANY - Text size H + Text width 0 @@ -1427,7 +1427,7 @@ 0 0 wxID_ANY - Leave ref or value blank to use the footprint name as default text + Leave reference or value blank to use the footprint name as default text 0 @@ -1526,7 +1526,7 @@ 0 0 wxID_ANY - Ref + Reference 0 @@ -2968,7 +2968,7 @@ 5 - wxEXPAND|wxTOP|wxBOTTOM + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT|wxTOP 0 0 diff --git a/pcbnew/dialogs/dialog_modedit_options_base.h b/pcbnew/dialogs/dialog_modedit_options_base.h index 4f4e86d25f..9535da13ff 100644 --- a/pcbnew/dialogs/dialog_modedit_options_base.h +++ b/pcbnew/dialogs/dialog_modedit_options_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Mar 13 2015) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -83,7 +83,7 @@ class DIALOG_MODEDIT_OPTIONS_BASE : public DIALOG_SHIM public: - DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 504,507 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_MODEDIT_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Footprint Editor Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_MODEDIT_OPTIONS_BASE(); };