]> git.saurik.com Git - wxWidgets.git/blame - include/wx/srchctrl.h
remove wxWINT_T_IS_TYPEDEF as it seems wint_t is always a typedef (although it can...
[wxWidgets.git] / include / wx / srchctrl.h
CommitLineData
3f7f284d
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: srchctrl.h
3// Purpose: wxSearchCtrlBase class
4// Author: Vince Harron
3f7f284d 5// Created: 2006-02-18
8bc333d7 6// RCS-ID: $Id$
3f7f284d
RD
7// Copyright: (c) Vince Harron
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_SEARCHCTRL_H_BASE_
12#define _WX_SEARCHCTRL_H_BASE_
13
14#include "wx/defs.h"
15
16#if wxUSE_SEARCHCTRL
17
18#include "wx/textctrl.h"
19
ec184e32
VZ
20#if !defined(__WXUNIVERSAL__) && defined(__WXMAC__) && defined(__WXMAC_OSX__) \
21 && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
22 // search control was introduced in Mac OS X 10.3 Panther
23 #define wxUSE_NATIVE_SEARCH_CONTROL 1
24
25 #define wxSearchCtrlBaseBaseClass wxTextCtrl
26#else
27 // no native version, use the generic one
28 #define wxUSE_NATIVE_SEARCH_CONTROL 0
29
30 #define wxSearchCtrlBaseBaseClass wxTextCtrlBase
31#endif
32
3f7f284d
RD
33// ----------------------------------------------------------------------------
34// constants
35// ----------------------------------------------------------------------------
36
37extern WXDLLEXPORT_DATA(const wxChar) wxSearchCtrlNameStr[];
38
39BEGIN_DECLARE_EVENT_TYPES()
c60122bf
KO
40 DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, 1119)
41 DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, 1120)
3f7f284d
RD
42END_DECLARE_EVENT_TYPES()
43
44// ----------------------------------------------------------------------------
45// a search ctrl is a text control with a search button and a cancel button
46// it is based on the MacOSX 10.3 control HISearchFieldCreate
47// ----------------------------------------------------------------------------
48
ec184e32
VZ
49class WXDLLEXPORT wxSearchCtrlBase : public wxSearchCtrlBaseBaseClass
50{
51public:
52 wxSearchCtrlBase() { }
53 virtual ~wxSearchCtrlBase() { }
54
55 // search control
56 virtual void SetMenu(wxMenu *menu) = 0;
57 virtual wxMenu *GetMenu() = 0;
58
59 // get/set options
60 virtual void ShowSearchButton( bool show ) = 0;
61 virtual bool IsSearchButtonVisible() const = 0;
3f7f284d 62
ec184e32
VZ
63 virtual void ShowCancelButton( bool show ) = 0;
64 virtual bool IsCancelButtonVisible() const = 0;
65};
66
67
68// include the platform-dependent class implementation
7a71ffc1 69#if wxUSE_NATIVE_SEARCH_CONTROL
3f7f284d
RD
70 #if defined(__WXMAC__)
71 #include "wx/mac/srchctrl.h"
72 #endif
73#else
74 #include "wx/generic/srchctlg.h"
75#endif
76
7a71ffc1 77// ----------------------------------------------------------------------------
3f7f284d 78// macros for handling search events
7a71ffc1
VZ
79// ----------------------------------------------------------------------------
80
c60122bf
KO
81#define EVT_SEARCHCTRL_CANCEL_BTN(id, fn) \
82 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, id, wxCommandEventHandler(fn))
3f7f284d 83
c60122bf
KO
84#define EVT_SEARCHCTRL_SEARCH_BTN(id, fn) \
85 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, id, wxCommandEventHandler(fn))
3f7f284d
RD
86
87#endif // wxUSE_SEARCHCTRL
88
89#endif // _WX_SEARCHCTRL_H_BASE_