From 99dea2e2e06d6ccab88f7766cbf9d4dd89523458 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Jan 2018 18:45:45 +0100 Subject: [PATCH] Remove unnecessary wxSearchCtrl::OnSetFocus() This was useless as wxCompositeWindow, from which the generic wxSearchCtrl derives, already sets focus to its first child and, since the last commit, even harmful as it now resulted in calls to SetFocus() from inside wxEVT_SET_FOCUS handler which is forbidden at least under MSW. See #15569. --- include/wx/generic/srchctlg.h | 1 - src/generic/srchctlg.cpp | 9 --------- 2 files changed, 10 deletions(-) diff --git a/include/wx/generic/srchctlg.h b/include/wx/generic/srchctlg.h index ebcae90e78..67d0c99ca2 100644 --- a/include/wx/generic/srchctlg.h +++ b/include/wx/generic/srchctlg.h @@ -223,7 +223,6 @@ protected: void OnCancelButton( wxCommandEvent& event ); - void OnSetFocus( wxFocusEvent& event ); void OnSize( wxSizeEvent& event ); bool HasMenu() const diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 5ad5654fe4..01acd68ea9 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -241,7 +241,6 @@ wxEND_EVENT_TABLE() wxBEGIN_EVENT_TABLE(wxSearchCtrl, wxSearchCtrlBase) EVT_SEARCHCTRL_CANCEL_BTN(wxID_ANY, wxSearchCtrl::OnCancelButton) - EVT_SET_FOCUS(wxSearchCtrl::OnSetFocus) EVT_SIZE(wxSearchCtrl::OnSize) wxEND_EVENT_TABLE() @@ -1235,14 +1234,6 @@ void wxSearchCtrl::OnCancelButton( wxCommandEvent& event ) event.Skip(); } -void wxSearchCtrl::OnSetFocus( wxFocusEvent& /*event*/ ) -{ - if ( m_text ) - { - m_text->SetFocus(); - } -} - void wxSearchCtrl::OnSize( wxSizeEvent& WXUNUSED(event) ) { LayoutControls();