1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/choice.h
3 // Purpose: wxChoice class
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __WX_COCOA_CHOICE_H__
13 #define __WX_COCOA_CHOICE_H__
15 //#include "wx/cocoa/NSPopUpButton.h"
16 #include "wx/cocoa/NSMenu.h"
18 class WXDLLIMPEXP_BASE wxSortedArrayString
;
20 // ========================================================================
22 // ========================================================================
23 class WXDLLEXPORT wxChoice
: public wxChoiceBase
/*, protected wxCocoaNSPopUpButton */, protected wxCocoaNSMenu
25 DECLARE_DYNAMIC_CLASS(wxChoice
)
27 // WX_DECLARE_COCOA_OWNER(NSTableView,NSControl,NSView)
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
32 wxChoice() { Init(); }
33 wxChoice(wxWindow
*parent
, wxWindowID winid
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
36 int n
= 0, const wxString choices
[] = NULL
,
38 const wxValidator
& validator
= wxDefaultValidator
,
39 const wxString
& name
= wxChoiceNameStr
)
42 Create(parent
, winid
, pos
, size
, n
, choices
, style
, validator
, name
);
44 wxChoice(wxWindow
*parent
, wxWindowID winid
,
47 const wxArrayString
& choices
,
49 const wxValidator
& validator
= wxDefaultValidator
,
50 const wxString
& name
= wxChoiceNameStr
)
53 Create(parent
, winid
, pos
, size
, choices
, style
, validator
, name
);
56 bool Create(wxWindow
*parent
, wxWindowID winid
,
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
,
59 int n
= 0, const wxString choices
[] = NULL
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxChoiceNameStr
);
63 bool Create(wxWindow
*parent
, wxWindowID winid
,
66 const wxArrayString
& choices
,
68 const wxValidator
& validator
= wxDefaultValidator
,
69 const wxString
& name
= wxChoiceNameStr
);
74 // ------------------------------------------------------------------------
76 // ------------------------------------------------------------------------
78 void CocoaNotification_menuDidSendAction(WX_NSNotification notification
);
79 // ------------------------------------------------------------------------
81 // ------------------------------------------------------------------------
84 virtual void Delete(int);
85 virtual int GetCount() const;
86 virtual wxString
GetString(int) const;
87 virtual void SetString(int, const wxString
&);
88 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
89 virtual int GetSelection() const;
90 virtual int DoAppend(const wxString
&);
91 virtual int DoInsert(const wxString
&, int);
92 virtual void DoSetItemClientData(int, void*);
93 virtual void* DoGetItemClientData(int) const;
94 virtual void DoSetItemClientObject(int, wxClientData
*);
95 virtual wxClientData
* DoGetItemClientObject(int) const;
96 virtual void SetSelection(int);
98 wxSortedArrayString
*m_sortedStrings
;
99 wxArrayPtrVoid m_itemsClientData
;
102 #endif // __WX_COCOA_CHOICE_H__