]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/searchctrl.cpp
Remove hard TABs from 3rd party files in src directory.
[wxWidgets.git] / samples / widgets / searchctrl.cpp
index e87c599f08f6331165a35927db8f92d8d92c5820..4031dbd51ff4e8655f879645ed24d2e393f5e871 100644 (file)
@@ -84,6 +84,8 @@ protected:
     void OnToggleCancelButton(wxCommandEvent&);
     void OnToggleSearchMenu(wxCommandEvent&);
 
+    void OnSearch(wxCommandEvent& event);
+
     wxMenu* CreateTestMenu();
     
     // (re)create the control
@@ -111,6 +113,8 @@ BEGIN_EVENT_TABLE(SearchCtrlWidgetsPage, WidgetsPage)
     EVT_CHECKBOX(ID_SEARCH_CB, SearchCtrlWidgetsPage::OnToggleSearchButton)
     EVT_CHECKBOX(ID_CANCEL_CB, SearchCtrlWidgetsPage::OnToggleCancelButton)
     EVT_CHECKBOX(ID_MENU_CB, SearchCtrlWidgetsPage::OnToggleSearchMenu)
+
+    EVT_SEARCHCTRL_SEARCH_BTN(wxID_ANY, SearchCtrlWidgetsPage::OnSearch)
 END_EVENT_TABLE()
 
 // ============================================================================
@@ -123,7 +127,7 @@ END_EVENT_TABLE()
     #define FAMILY_CTRLS GENERIC_CTRLS
 #endif
 
-IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, _T("SearchCtrl"),
+IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, wxT("SearchCtrl"),
                        FAMILY_CTRLS | EDITABLE_CTRLS | ALL_CTRLS);
 
 SearchCtrlWidgetsPage::SearchCtrlWidgetsPage(WidgetsBookCtrl *book,
@@ -181,7 +185,7 @@ wxMenu* SearchCtrlWidgetsPage::CreateTestMenu()
 {
     wxMenu* menu = new wxMenu;
     const int SEARCH_MENU_SIZE = 5;
-    wxMenuItem* menuItem = menu->Append(wxID_ANY, _T("Recent Searches"), wxT(""), wxITEM_NORMAL);
+    wxMenuItem* menuItem = menu->Append(wxID_ANY, wxT("Recent Searches"), wxT(""), wxITEM_NORMAL);
     menuItem->Enable(false);
     for ( int i = 0; i < SEARCH_MENU_SIZE; i++ )
     {
@@ -222,5 +226,9 @@ void SearchCtrlWidgetsPage::OnToggleSearchMenu(wxCommandEvent&)
         m_srchCtrl->SetMenu(NULL);
 }
 
+void SearchCtrlWidgetsPage::OnSearch(wxCommandEvent& event)
+{
+    wxLogMessage("Search button: search for \"%s\".", event.GetString());
+}
 
 #endif  //  wxUSE_SEARCHCTRL