Modified form of Patch #1611222, adds wxSearchCtrl (generic & native carbon HISearchF...
[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 // ----------------------------------------------------------------------------
38 // include the platform-dependent class implementation
39 // ----------------------------------------------------------------------------
40
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
44 #else
45 //not supported on these platforms, leave 0
46 #define USE_NATIVE_SEARCH_CONTROL 0
47 #endif
48
49 #if USE_NATIVE_SEARCH_CONTROL
50 #if defined(__WXMAC__)
51 #include "wx/mac/srchctrl.h"
52 #endif
53 #else
54 #include "wx/generic/srchctlg.h"
55 #endif
56
57 // macros for handling search events
58 #define EVT_SEARCHCTRL_CANCEL(id, fn) \
59 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL, id, wxCommandEventHandler(fn))
60
61 #define EVT_SEARCHCTRL_SEARCH(id, fn) \
62 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH, id, wxCommandEventHandler(fn))
63
64 #endif // wxUSE_SEARCHCTRL
65
66 #endif // _WX_SEARCHCTRL_H_BASE_