diff --git a/include/wx/generic/srchctlg.h b/include/wx/generic/srchctlg.h index 0d1fc5b539..7ccc89881e 100644 --- a/include/wx/generic/srchctlg.h +++ b/include/wx/generic/srchctlg.h @@ -219,7 +219,7 @@ protected: virtual wxBitmap RenderSearchBitmap( int x, int y, bool renderDrop ); virtual wxBitmap RenderCancelBitmap( int x, int y ); - virtual void OnSearchButton( wxCommandEvent& event ); + void OnCancelButton( wxCommandEvent& event ); void OnSetFocus( wxFocusEvent& event ); void OnSize( wxSizeEvent& event ); diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index 2317d2bfb5..8e472f4888 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -231,7 +231,7 @@ BEGIN_EVENT_TABLE(wxSearchButton, wxControl) END_EVENT_TABLE() BEGIN_EVENT_TABLE(wxSearchCtrl, wxSearchCtrlBase) - EVT_SEARCHCTRL_SEARCH_BTN(wxID_ANY, wxSearchCtrl::OnSearchButton) + EVT_SEARCHCTRL_CANCEL_BTN(wxID_ANY, wxSearchCtrl::OnCancelButton) EVT_SET_FOCUS(wxSearchCtrl::OnSetFocus) EVT_SIZE(wxSearchCtrl::OnSize) END_EVENT_TABLE() @@ -1172,9 +1172,9 @@ void wxSearchCtrl::RecalcBitmaps() } } -void wxSearchCtrl::OnSearchButton( wxCommandEvent& event ) +void wxSearchCtrl::OnCancelButton( wxCommandEvent& WXUNUSED(event) ) { - event.Skip(); + m_text->Clear(); } void wxSearchCtrl::OnSetFocus( wxFocusEvent& /*event*/ )