use wx prefix for wxUSE_NATIVE_SEARCH_CONTROL macro name
[wxWidgets.git] / include / wx / srchctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: srchctrl.h
3 // Purpose: wxSearchCtrlBase class
4 // Author: Vince Harron
5 // Modified by:
6 // Created: 2006-02-18
7 // RCS-ID:
8 // Copyright: (c) Vince Harron
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_SEARCHCTRL_H_BASE_
13 #define _WX_SEARCHCTRL_H_BASE_
14
15 #include "wx/defs.h"
16
17 #if wxUSE_SEARCHCTRL
18
19 #include "wx/textctrl.h"
20
21 // ----------------------------------------------------------------------------
22 // constants
23 // ----------------------------------------------------------------------------
24
25 extern WXDLLEXPORT_DATA(const wxChar) wxSearchCtrlNameStr[];
26
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()
31
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 // ----------------------------------------------------------------------------
36
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
42 #else
43 // no native version, use the generic one
44 #define wxUSE_NATIVE_SEARCH_CONTROL 0
45 #endif
46
47 #if wxUSE_NATIVE_SEARCH_CONTROL
48 #if defined(__WXMAC__)
49 #include "wx/mac/srchctrl.h"
50 #endif
51 #else
52 #include "wx/generic/srchctlg.h"
53 #endif
54
55 // ----------------------------------------------------------------------------
56 // macros for handling search events
57 // ----------------------------------------------------------------------------
58
59 #define EVT_SEARCHCTRL_CANCEL(id, fn) \
60 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL, id, wxCommandEventHandler(fn))
61
62 #define EVT_SEARCHCTRL_SEARCH(id, fn) \
63 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH, id, wxCommandEventHandler(fn))
64
65 #endif // wxUSE_SEARCHCTRL
66
67 #endif // _WX_SEARCHCTRL_H_BASE_