1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/choice.mm
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/choice.h"
16 #import <AppKit/NSPopUpButton.h>
18 IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
19 BEGIN_EVENT_TABLE(wxChoice, wxChoiceBase)
21 // WX_IMPLEMENT_COCOA_OWNER(wxChoice,NSButton,NSControl,NSView)
23 bool wxChoice::Create(wxWindow *parent, wxWindowID winid,
26 int n, const wxString choices[],
28 const wxValidator& validator,
31 if(!CreateControl(parent,winid,pos,size,style,validator,name))
34 SetNSView([[NSPopUpButton alloc] initWithFrame:MakeDefaultNSRect(size)
37 [m_cocoaNSView sizeToFit];
39 m_parent->CocoaAddChild(this);
40 SetInitialFrameRect(pos,size);
47 CocoaRemoveFromParent();
50 void wxChoice::Clear()
54 void wxChoice::Delete(int)
58 int wxChoice::GetCount() const
63 wxString wxChoice::GetString(int) const
68 void wxChoice::SetString(int, const wxString&)
72 int wxChoice::FindString(const wxString&) const
77 int wxChoice::GetSelection() const
82 int wxChoice::DoAppend(const wxString&)
87 int wxChoice::DoInsert(const wxString&, int)
92 void wxChoice::DoSetItemClientData(int, void*)
96 void* wxChoice::DoGetItemClientData(int) const
101 void wxChoice::DoSetItemClientObject(int, wxClientData*)
105 wxClientData* wxChoice::DoGetItemClientObject(int) const
110 void wxChoice::SetSelection(int)