From 705f6c1c8bd01d81af4bfcaaf82e332dada699db Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 13 May 2014 19:55:12 +0000 Subject: [PATCH] allowing compile under ios, where menus are not available git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/osx/srchctrl.h | 4 ++++ src/osx/srchctrl_osx.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/include/wx/osx/srchctrl.h b/include/wx/osx/srchctrl.h index ee926cf5f4..1cad161db1 100644 --- a/include/wx/osx/srchctrl.h +++ b/include/wx/osx/srchctrl.h @@ -39,10 +39,12 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSearchCtrlNameStr); +#if wxUSE_MENUS // get/set search button menu // -------------------------- virtual void SetMenu( wxMenu* menu ); virtual wxMenu* GetMenu(); +#endif // wxUSE_MENUS // get/set search options // ---------------------- @@ -67,7 +69,9 @@ protected: void Init(); +#if wxUSE_MENUS wxMenu *m_menu; +#endif // wxUSE_MENUS wxString m_descriptiveText; diff --git a/src/osx/srchctrl_osx.cpp b/src/osx/srchctrl_osx.cpp index 00d96f1585..a08341993d 100644 --- a/src/osx/srchctrl_osx.cpp +++ b/src/osx/srchctrl_osx.cpp @@ -62,7 +62,9 @@ wxSearchCtrl::wxSearchCtrl(wxWindow *parent, wxWindowID id, void wxSearchCtrl::Init() { +#if wxUSE_MENUS m_menu = 0; +#endif } wxSearchWidgetImpl* wxSearchCtrl::GetSearchPeer() const @@ -72,7 +74,9 @@ wxSearchWidgetImpl* wxSearchCtrl::GetSearchPeer() const wxSearchCtrl::~wxSearchCtrl() { +#if wxUSE_MENUS delete m_menu; +#endif } wxSize wxSearchCtrl::DoGetBestSize() const @@ -85,6 +89,7 @@ wxSize wxSearchCtrl::DoGetBestSize() const return size; } +#if wxUSE_MENUS // search control specific interfaces // wxSearchCtrl owns menu after this call @@ -117,6 +122,8 @@ wxMenu* wxSearchCtrl::GetMenu() return m_menu; } +#endif // wxUSE_MENUS + void wxSearchCtrl::ShowSearchButton( bool show ) { if ( IsSearchButtonVisible() == show )