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_FWD_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 // ------------------------------------------------------------------------
83 virtual void DoClear();
84 virtual unsigned int GetCount() const;
85 virtual wxString
GetString(unsigned int) const;
86 virtual void SetString(unsigned int pos
, const wxString
&);
87 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
88 virtual int GetSelection() const;
89 virtual int DoInsertItems(const wxArrayStringsAdapter
& items
,
91 void **clientData
, wxClientDataType type
);
92 virtual void DoDeleteOneItem(unsigned int pos
);
93 virtual void DoSetItemClientData(unsigned int, void*);
94 virtual void* DoGetItemClientData(unsigned int) const;
95 virtual void SetSelection(int pos
);
97 wxSortedArrayString
*m_sortedStrings
;
98 wxArrayPtrVoid m_itemsClientData
;
101 #endif // __WX_COCOA_CHOICE_H__