1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/radiobox.mm
4 // Author: David Elliott
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
15 #include "wx/radiobox.h"
16 #include "wx/arrstr.h"
19 #import <AppKit/NSView.h>
21 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
22 BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
24 // WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
26 bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
27 const wxString& title,
30 const wxArrayString& choices,
32 long style, const wxValidator& validator,
35 wxCArrayString chs(choices);
37 return Create(parent, winid, title, pos, size, chs.GetCount(),
38 chs.GetStrings(), majorDim, style, validator, name);
41 bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
42 const wxString& title,
45 int n, const wxString choices[],
47 long style, const wxValidator& validator,
50 if(!CreateControl(parent,winid,pos,size,style,validator,name))
52 SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
53 [m_cocoaNSView release];
55 m_parent->CocoaAddChild(this);
56 SetInitialFrameRect(pos,size);
61 wxRadioBox::~wxRadioBox()
66 void wxRadioBox::SetSelection(int n)
70 int wxRadioBox::GetSelection() const
76 int wxRadioBox::GetCount() const
81 wxString wxRadioBox::GetString(int n) const
86 void wxRadioBox::SetString(int n, const wxString& label)
90 // change the individual radio button state
91 void wxRadioBox::Enable(int n, bool enable)
95 void wxRadioBox::Show(int n, bool show)
100 int wxRadioBox::GetColumnCount() const
105 int wxRadioBox::GetRowCount() const
110 wxSize wxRadioBox::DoGetBestSize() const
112 return wxSize(50,50);