1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/listbox.mm
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
13 #include "wx/listbox.h"
16 #import <AppKit/NSView.h>
18 IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
19 BEGIN_EVENT_TABLE(wxListBox, wxListBoxBase)
21 // WX_IMPLEMENT_COCOA_OWNER(wxListBox,NSButton,NSControl,NSView)
23 bool wxListBox::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([[NSView alloc] initWithFrame: NSMakeRect(10,10,20,20)]);
35 [m_cocoaNSView release];
38 m_parent->CocoaAddChild(this);
42 wxListBox::~wxListBox()
44 CocoaRemoveFromParent();
48 // pure virtuals from wxListBoxBase
49 bool wxListBox::IsSelected(int n) const
54 void wxListBox::SetSelection(int n, bool select)
58 int wxListBox::GetSelections(wxArrayInt& aSelections) const
63 void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
67 void wxListBox::DoSetItems(const wxArrayString& items, void **clientData)
71 void wxListBox::DoSetFirstItem(int n)
76 // pure virtuals from wxItemContainer
78 void wxListBox::Clear()
82 void wxListBox::Delete(int n)
87 int wxListBox::GetCount() const
92 wxString wxListBox::GetString(int n) const
97 void wxListBox::SetString(int n, const wxString& s)
101 int wxListBox::FindString(const wxString& s) const
107 void wxListBox::Select(int n)
111 int wxListBox::GetSelection() const
116 int wxListBox::DoAppend(const wxString& item)
121 void wxListBox::DoSetItemClientData(int n, void* clientData)
125 void* wxListBox::DoGetItemClientData(int n) const
130 void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
134 wxClientData* wxListBox::DoGetItemClientObject(int n) const