void OnToggleSearchMenu(wxCommandEvent&);
void OnSearch(wxCommandEvent& event);
+ void OnSearchCancel(wxCommandEvent& event);
wxMenu* CreateTestMenu();
EVT_CHECKBOX(ID_MENU_CB, SearchCtrlWidgetsPage::OnToggleSearchMenu)
EVT_SEARCHCTRL_SEARCH_BTN(wxID_ANY, SearchCtrlWidgetsPage::OnSearch)
+ EVT_SEARCHCTRL_CANCEL_BTN(wxID_ANY, SearchCtrlWidgetsPage::OnSearchCancel)
END_EVENT_TABLE()
// ============================================================================
wxLogMessage("Search button: search for \"%s\".", event.GetString());
}
+void SearchCtrlWidgetsPage::OnSearchCancel(wxCommandEvent& event)
+{
+ wxLogMessage("Cancel button pressed.");
+
+ event.Skip();
+}
+
#endif // wxUSE_SEARCHCTRL
}
}
-void wxSearchCtrl::OnCancelButton( wxCommandEvent& WXUNUSED(event) )
+void wxSearchCtrl::OnCancelButton( wxCommandEvent& event )
{
m_text->Clear();
+ event.Skip();
}
void wxSearchCtrl::OnSetFocus( wxFocusEvent& /*event*/ )