1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/cocoa/choice.h
3 // Purpose: wxChoice class
4 // Author: David Elliott
7 // Copyright: (c) 2003 David Elliott
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __WX_COCOA_CHOICE_H__
12 #define __WX_COCOA_CHOICE_H__
14 //#include "wx/cocoa/NSPopUpButton.h"
15 #include "wx/cocoa/NSMenu.h"
17 class WXDLLIMPEXP_FWD_BASE wxSortedArrayString
;
19 // ========================================================================
21 // ========================================================================
22 class WXDLLIMPEXP_CORE wxChoice
: public wxChoiceBase
/*, protected wxCocoaNSPopUpButton */, protected wxCocoaNSMenu
24 DECLARE_DYNAMIC_CLASS(wxChoice
)
26 // WX_DECLARE_COCOA_OWNER(NSTableView,NSControl,NSView)
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 wxChoice() { Init(); }
32 wxChoice(wxWindow
*parent
, wxWindowID winid
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 int n
= 0, const wxString choices
[] = NULL
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxChoiceNameStr
)
41 Create(parent
, winid
, pos
, size
, n
, choices
, style
, validator
, name
);
43 wxChoice(wxWindow
*parent
, wxWindowID winid
,
46 const wxArrayString
& choices
,
48 const wxValidator
& validator
= wxDefaultValidator
,
49 const wxString
& name
= wxChoiceNameStr
)
52 Create(parent
, winid
, pos
, size
, choices
, style
, validator
, name
);
55 bool Create(wxWindow
*parent
, wxWindowID winid
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 int n
= 0, const wxString choices
[] = NULL
,
60 const wxValidator
& validator
= wxDefaultValidator
,
61 const wxString
& name
= wxChoiceNameStr
);
62 bool Create(wxWindow
*parent
, wxWindowID winid
,
65 const wxArrayString
& choices
,
67 const wxValidator
& validator
= wxDefaultValidator
,
68 const wxString
& name
= wxChoiceNameStr
);
73 // ------------------------------------------------------------------------
75 // ------------------------------------------------------------------------
77 void CocoaNotification_menuDidSendAction(WX_NSNotification notification
);
78 // ------------------------------------------------------------------------
80 // ------------------------------------------------------------------------
82 virtual void DoClear();
83 virtual unsigned int GetCount() const;
84 virtual wxString
GetString(unsigned int) const;
85 virtual void SetString(unsigned int pos
, const wxString
&);
86 virtual int FindString(const wxString
& s
, bool bCase
= false) const;
87 virtual int GetSelection() const;
88 virtual int DoInsertItems(const wxArrayStringsAdapter
& items
,
90 void **clientData
, wxClientDataType type
);
91 virtual void DoDeleteOneItem(unsigned int pos
);
92 virtual void DoSetItemClientData(unsigned int, void*);
93 virtual void* DoGetItemClientData(unsigned int) const;
94 virtual void SetSelection(int pos
);
96 wxSortedArrayString
*m_sortedStrings
;
97 wxArrayPtrVoid m_itemsClientData
;
100 #endif // __WX_COCOA_CHOICE_H__