diff --git a/pcbnew/dialogs/dialog_find.cpp b/pcbnew/dialogs/dialog_find.cpp index e3acac25e0..c053a6f591 100644 --- a/pcbnew/dialogs/dialog_find.cpp +++ b/pcbnew/dialogs/dialog_find.cpp @@ -51,8 +51,6 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent GetSizer()->SetSizeHints( this ); m_SearchTextCtrl->AppendText( prevSearchString ); - m_SearchTextCtrl->SetFocus(); - m_SearchTextCtrl->SetSelection( -1, -1 ); m_NoMouseWarpCheckBox->SetValue( !warpMouse ); itemCount = markerCount = 0; @@ -60,6 +58,12 @@ DIALOG_FIND::DIALOG_FIND( PCB_BASE_FRAME* aParent ) : DIALOG_FIND_BASE( aParent Center(); } +void DIALOG_FIND::OnInitDialog( wxInitDialogEvent& event ) +{ + m_SearchTextCtrl->SetFocus(); + m_SearchTextCtrl->SetSelection( -1, -1 ); +} + void DIALOG_FIND::EnableWarp( bool aEnabled ) { m_NoMouseWarpCheckBox->SetValue( !aEnabled ); diff --git a/pcbnew/dialogs/dialog_find.h b/pcbnew/dialogs/dialog_find.h index 31194fc913..763aaa783b 100644 --- a/pcbnew/dialogs/dialog_find.h +++ b/pcbnew/dialogs/dialog_find.h @@ -33,6 +33,7 @@ class DIALOG_FIND : public DIALOG_FIND_BASE { public: DIALOG_FIND( PCB_BASE_FRAME* aParent ); + void OnInitDialog( wxInitDialogEvent& event ) override; inline BOARD_ITEM* GetItem() const { return foundItem; } void EnableWarp( bool aEnabled ); void SetCallback( boost::function aCallback ) { callback = aCallback; } diff --git a/pcbnew/dialogs/dialog_find_base.cpp b/pcbnew/dialogs/dialog_find_base.cpp index 3c40e61726..a3c2a2b963 100644 --- a/pcbnew/dialogs/dialog_find_base.cpp +++ b/pcbnew/dialogs/dialog_find_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jan 15 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -16,37 +16,38 @@ DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxStr wxBoxSizer* bSizerMain; bSizerMain = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer3; - bSizer3 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizerLeft; + bSizerLeft = new wxBoxSizer( wxVERTICAL ); m_staticText1 = new wxStaticText( this, wxID_ANY, _("Search for:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( -1 ); - bSizer3->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizerLeft->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_SearchTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), 0 ); - bSizer3->Add( m_SearchTextCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_SearchTextCtrl->SetMaxLength( 0 ); + bSizerLeft->Add( m_SearchTextCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_NoMouseWarpCheckBox = new wxCheckBox( this, wxID_ANY, _("Do not warp mouse pointer"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer3->Add( m_NoMouseWarpCheckBox, 1, wxALL|wxEXPAND, 5 ); + bSizerLeft->Add( m_NoMouseWarpCheckBox, 1, wxALL|wxEXPAND, 5 ); - bSizerMain->Add( bSizer3, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizerMain->Add( bSizerLeft, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - wxBoxSizer* bSizer4; - bSizer4 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); m_button1 = new wxButton( this, wxID_ANY, _("Find Item"), wxDefaultPosition, wxDefaultSize, 0 ); m_button1->SetDefault(); - bSizer4->Add( m_button1, 1, wxALL|wxEXPAND, 5 ); + bSizerRight->Add( m_button1, 1, wxALL|wxEXPAND, 5 ); m_button2 = new wxButton( this, wxID_ANY, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_button2, 1, wxALL|wxEXPAND, 5 ); + bSizerRight->Add( m_button2, 1, wxALL|wxEXPAND, 5 ); m_button3 = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_button3, 1, wxALL|wxEXPAND, 5 ); + bSizerRight->Add( m_button3, 1, wxALL|wxEXPAND, 5 ); - bSizerMain->Add( bSizer4, 0, wxALL, 5 ); + bSizerMain->Add( bSizerRight, 0, wxALL, 5 ); this->SetSizer( bSizerMain ); @@ -57,6 +58,7 @@ DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxStr // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) ); + this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_FIND_BASE::OnInitDialog ) ); m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this ); m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this ); m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this ); @@ -66,6 +68,7 @@ DIALOG_FIND_BASE::~DIALOG_FIND_BASE() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) ); + this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_FIND_BASE::OnInitDialog ) ); m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this ); m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this ); m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_find_base.fbp b/pcbnew/dialogs/dialog_find_base.fbp index 7ce64bc569..51add4fabb 100644 --- a/pcbnew/dialogs/dialog_find_base.fbp +++ b/pcbnew/dialogs/dialog_find_base.fbp @@ -2,7 +2,7 @@ - + C++ 1 source_name @@ -16,78 +16,80 @@ none 1 dialog_find - + . - + 1 + 1 1 1 + UI 0 0 0 wxAUI_MGR_DEFAULT - + wxBOTH - + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_FIND_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Find - - - - - - - - - - - - - + + + + + + + + + + + + + onClose - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + OnInitDialog + + + + + + + + + + + + + + + + + + + + - + bSizerMain wxHORIZONTAL none @@ -96,7 +98,7 @@ wxEXPAND|wxTOP|wxBOTTOM 1 - + bSizerLeft wxVERTICAL none @@ -109,78 +111,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Search for: - + 0 - - + + 0 - + 1 m_staticText1 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -192,86 +194,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - + 0 - + 0 - + 1 m_SearchTextCtrl 1 - - + + protected 1 - + Resizable 1 200,-1 - - + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -283,83 +285,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Do not warp mouse pointer - + 0 - - + + 0 - + 1 m_NoMouseWarpCheckBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -369,7 +371,7 @@ wxALL 0 - + bSizerRight wxVERTICAL none @@ -382,17 +384,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 1 0 @@ -400,65 +402,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Find Item - + 0 - - + + 0 - + 1 m_button1 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + onButtonFindItemClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -470,17 +472,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -488,65 +490,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_ANY Find Marker - + 0 - - + + 0 - + 1 m_button2 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + onButtonFindMarkerClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -558,17 +560,17 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 0 @@ -576,65 +578,65 @@ 0 Left 1 - + 1 - + 0 0 wxID_CANCEL Close - + 0 - - + + 0 - + 1 m_button3 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + onButtonCloseClick - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_find_base.h b/pcbnew/dialogs/dialog_find_base.h index dad8e7a43b..a8c04640c1 100644 --- a/pcbnew/dialogs/dialog_find_base.h +++ b/pcbnew/dialogs/dialog_find_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jan 15 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -44,6 +46,7 @@ class DIALOG_FIND_BASE : public DIALOG_SHIM // Virtual event handlers, overide them in your derived class virtual void onClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } virtual void onButtonFindItemClick( wxCommandEvent& event ) { event.Skip(); } virtual void onButtonFindMarkerClick( wxCommandEvent& event ) { event.Skip(); } virtual void onButtonCloseClick( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index cfa50d3e6e..0189652d0b 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -150,7 +150,6 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP TransferDataToWindow(); m_sdbSizerOK->SetDefault(); - m_PadNumCtrl->SetFocus(); m_canUpdate = true; FixOSXCancelButtonIssue(); @@ -159,6 +158,11 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP FinishDialogSettings(); } +void DIALOG_PAD_PROPERTIES::OnInitDialog( wxInitDialogEvent& event ) +{ + m_PadNumCtrl->SetFocus(); + m_PadNumCtrl->SetSelection( -1, -1 ); +} void DIALOG_PAD_PROPERTIES::OnPaintShowPanel( wxPaintEvent& event ) { diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index 574fc8e163..59d341e016 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -56,6 +56,7 @@ class DIALOG_PAD_PROPERTIES : public DIALOG_PAD_PROPERTIES_BASE { public: DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aPad ); + void OnInitDialog( wxInitDialogEvent& event ) override; ~DIALOG_PAD_PROPERTIES() { delete m_dummyPad; diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index 8e21f09ad7..bb64b55c8e 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 17 2016) +// C++ code generated with wxFormBuilder (version Jan 15 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -615,6 +615,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind this->Centre( wxBOTH ); // Connect Events + this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnInitDialog ) ); m_PadNumCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_PadNetNameCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_PadType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); @@ -650,6 +651,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() { // Disconnect Events + this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnInitDialog ) ); m_PadNumCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_PadNetNameCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_PadType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::PadTypeSelected ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 9a1dc0d2e7..93859d9914 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -67,7 +67,7 @@ - + OnInitDialog diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index 7586fac329..c7d8a5f3cd 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 17 2016) +// C++ code generated with wxFormBuilder (version Jan 15 2017) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -163,6 +163,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class + virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnValuesChanged( wxCommandEvent& event ) { event.Skip(); } virtual void PadTypeSelected( wxCommandEvent& event ) { event.Skip(); } virtual void OnPadShapeSelection( wxCommandEvent& event ) { event.Skip(); }