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 // include the platform-dependent class implementation
38 #if !defined(__WXUNIVERSAL__) && defined(__WXMAC__) && defined(__WXMAC_OSX__) \
39 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
40 // search control was introduced in Mac OS X 10.3 Panther
41 #define wxUSE_NATIVE_SEARCH_CONTROL 1
43 // no native version, use the generic one
44 #define wxUSE_NATIVE_SEARCH_CONTROL 0
47 #if wxUSE_NATIVE_SEARCH_CONTROL
48 #if defined(__WXMAC__)
49 #include "wx/mac/srchctrl.h"
52 #include "wx/generic/srchctlg.h"
55 // ----------------------------------------------------------------------------
56 // macros for handling search events
57 // ----------------------------------------------------------------------------
59 #define EVT_SEARCHCTRL_CANCEL(id, fn) \
60 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL, id, wxCommandEventHandler(fn))
62 #define EVT_SEARCHCTRL_SEARCH(id, fn) \
63 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH, id, wxCommandEventHandler(fn))
65 #endif // wxUSE_SEARCHCTRL
67 #endif // _WX_SEARCHCTRL_H_BASE_