X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07d304d2aad643454a6c087a9215e2fc4d8f07f4..29604c85d6ff8f4cd1eaa19adf41862372ea4c54:/samples/widgets/searchctrl.cpp diff --git a/samples/widgets/searchctrl.cpp b/samples/widgets/searchctrl.cpp index 7ba5df5a93..4c8e900c40 100644 --- a/samples/widgets/searchctrl.cpp +++ b/samples/widgets/searchctrl.cpp @@ -85,6 +85,7 @@ protected: void OnToggleSearchMenu(wxCommandEvent&); void OnSearch(wxCommandEvent& event); + void OnSearchCancel(wxCommandEvent& event); wxMenu* CreateTestMenu(); @@ -112,6 +113,7 @@ BEGIN_EVENT_TABLE(SearchCtrlWidgetsPage, WidgetsPage) 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() // ============================================================================ @@ -231,4 +233,11 @@ void SearchCtrlWidgetsPage::OnSearch(wxCommandEvent& event) wxLogMessage("Search button: search for \"%s\".", event.GetString()); } +void SearchCtrlWidgetsPage::OnSearchCancel(wxCommandEvent& event) +{ + wxLogMessage("Cancel button pressed."); + + event.Skip(); +} + #endif // wxUSE_SEARCHCTRL