]> git.saurik.com Git - wxWidgets.git/blame - include/wx/srchctrl.h
Beginning of wxDataViewTreeStore API
[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
0ec1179b
VZ
30 class WXDLLIMPEXP_CORE wxSearchCtrlBaseBaseClass : public wxControl,
31 public wxTextCtrlIface
32 {
33 };
ec184e32
VZ
34#endif
35
3f7f284d
RD
36// ----------------------------------------------------------------------------
37// constants
38// ----------------------------------------------------------------------------
39
40extern WXDLLEXPORT_DATA(const wxChar) wxSearchCtrlNameStr[];
41
42BEGIN_DECLARE_EVENT_TYPES()
c60122bf
KO
43 DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, 1119)
44 DECLARE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, 1120)
3f7f284d
RD
45END_DECLARE_EVENT_TYPES()
46
47// ----------------------------------------------------------------------------
48// a search ctrl is a text control with a search button and a cancel button
49// it is based on the MacOSX 10.3 control HISearchFieldCreate
50// ----------------------------------------------------------------------------
51
ec184e32
VZ
52class WXDLLEXPORT wxSearchCtrlBase : public wxSearchCtrlBaseBaseClass
53{
54public:
55 wxSearchCtrlBase() { }
56 virtual ~wxSearchCtrlBase() { }
57
cfddeb10
VZ
58 // search control
59#if wxUSE_MENUS
ec184e32
VZ
60 virtual void SetMenu(wxMenu *menu) = 0;
61 virtual wxMenu *GetMenu() = 0;
cfddeb10 62#endif // wxUSE_MENUS
ec184e32
VZ
63
64 // get/set options
65 virtual void ShowSearchButton( bool show ) = 0;
66 virtual bool IsSearchButtonVisible() const = 0;
3f7f284d 67
ec184e32
VZ
68 virtual void ShowCancelButton( bool show ) = 0;
69 virtual bool IsCancelButtonVisible() const = 0;
70};
71
72
73// include the platform-dependent class implementation
7a71ffc1 74#if wxUSE_NATIVE_SEARCH_CONTROL
3f7f284d
RD
75 #if defined(__WXMAC__)
76 #include "wx/mac/srchctrl.h"
77 #endif
78#else
79 #include "wx/generic/srchctlg.h"
80#endif
81
7a71ffc1 82// ----------------------------------------------------------------------------
3f7f284d 83// macros for handling search events
7a71ffc1
VZ
84// ----------------------------------------------------------------------------
85
c60122bf
KO
86#define EVT_SEARCHCTRL_CANCEL_BTN(id, fn) \
87 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, id, wxCommandEventHandler(fn))
3f7f284d 88
c60122bf
KO
89#define EVT_SEARCHCTRL_SEARCH_BTN(id, fn) \
90 wx__DECLARE_EVT1(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, id, wxCommandEventHandler(fn))
3f7f284d
RD
91
92#endif // wxUSE_SEARCHCTRL
93
94#endif // _WX_SEARCHCTRL_H_BASE_