1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/srchctrl.h
3 // Purpose: mac carbon wxSearchCtrl class
4 // Author: Vince Harron
8 // Copyright: Vince Harron
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SEARCHCTRL_H_
13 #define _WX_SEARCHCTRL_H_
17 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
18 #pragma interface "srchctrl.h"
21 class WXDLLEXPORT wxSearchCtrlBase
: public wxTextCtrl
25 virtual ~wxSearchCtrlBase() {}
28 virtual void SetMenu( wxMenu
* menu
) = 0;
29 virtual wxMenu
* GetMenu() = 0;
33 virtual void SetSearchButtonVisible( bool show
) = 0;
34 virtual bool GetSearchButtonVisible() const = 0;
36 virtual void SetCancelButtonVisible( bool show
) = 0;
37 virtual bool GetCancelButtonVisible() const = 0;
41 class wxMacSearchFieldControl
;
43 class WXDLLEXPORT wxSearchCtrl
: public wxSearchCtrlBase
50 wxSearchCtrl(wxWindow
*parent
, wxWindowID id
,
51 const wxString
& value
= wxEmptyString
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
55 const wxValidator
& validator
= wxDefaultValidator
,
56 const wxString
& name
= wxSearchCtrlNameStr
);
60 bool Create(wxWindow
*parent
, wxWindowID id
,
61 const wxString
& value
= wxEmptyString
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& size
= wxDefaultSize
,
65 const wxValidator
& validator
= wxDefaultValidator
,
66 const wxString
& name
= wxSearchCtrlNameStr
);
68 // get/set search button menu
69 // --------------------------
70 virtual void SetMenu( wxMenu
* menu
);
71 virtual wxMenu
* GetMenu();
73 // get/set search options
74 // ----------------------
75 virtual void SetSearchButtonVisible( bool show
);
76 virtual bool GetSearchButtonVisible() const;
78 virtual void SetCancelButtonVisible( bool show
);
79 virtual bool GetCancelButtonVisible() const;
81 virtual wxInt32
MacSearchFieldSearchHit( WXEVENTHANDLERREF handler
, WXEVENTREF event
) ;
82 virtual wxInt32
MacSearchFieldCancelHit( WXEVENTHANDLERREF handler
, WXEVENTREF event
) ;
84 wxMacSearchFieldControl
* GetPeer() const
85 { return (wxMacSearchFieldControl
*) m_peer
; }
87 virtual void SetFocus();
91 wxSize
DoGetBestSize() const;
95 virtual void CreatePeer(
98 const wxSize
& size
, long style
);
103 DECLARE_DYNAMIC_CLASS(wxSearchCtrl
)
105 DECLARE_EVENT_TABLE()
108 #endif // wxUSE_SEARCHCTRL
110 #endif // _WX_SEARCHCTRL_H_