1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSearchCtrlBase class
4 // Author: Vince Harron
8 // Copyright: (c) Vince Harron
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SEARCHCTRL_H_BASE_
13 #define _WX_SEARCHCTRL_H_BASE_
19 #include "wx/textctrl.h"
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 extern WXDLLEXPORT_DATA(const wxChar
) wxSearchCtrlNameStr
[];
27 BEGIN_DECLARE_EVENT_TYPES()
28 DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_CANCEL
, 1119)
29 DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_SEARCH
, 1120)
30 END_DECLARE_EVENT_TYPES()
32 // ----------------------------------------------------------------------------
33 // a search ctrl is a text control with a search button and a cancel button
34 // it is based on the MacOSX 10.3 control HISearchFieldCreate
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
38 // include the platform-dependent class implementation
39 // ----------------------------------------------------------------------------
41 #if !defined(__WXUNIVERSAL__) && defined( __WXMAC__ ) && defined( __WXMAC_OSX__ ) && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 )
42 // search control was introduced in Mac OS X 10.3 Panther
43 #define USE_NATIVE_SEARCH_CONTROL 1
45 //not supported on these platforms, leave 0
46 #define USE_NATIVE_SEARCH_CONTROL 0
49 #if USE_NATIVE_SEARCH_CONTROL
50 #if defined(__WXMAC__)
51 #include "wx/mac/srchctrl.h"
54 #include "wx/generic/srchctlg.h"
57 // macros for handling search events
58 #define EVT_SEARCHCTRL_CANCEL(id, fn) \
59 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL, id, wxCommandEventHandler(fn))
61 #define EVT_SEARCHCTRL_SEARCH(id, fn) \
62 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH, id, wxCommandEventHandler(fn))
64 #endif // wxUSE_SEARCHCTRL
66 #endif // _WX_SEARCHCTRL_H_BASE_