]> git.saurik.com Git - wxWidgets.git/blob - src/cocoa/radiobox.mm
Wrappers for *ToText
[wxWidgets.git] / src / cocoa / radiobox.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cocoa/radiobox.mm
3 // Purpose: wxRadioBox
4 // Author: David Elliott
5 // Modified by:
6 // Created: 2003/02/15
7 // RCS-ID: $Id:
8 // Copyright: (c) 2003 David Elliott
9 // Licence: wxWidgets licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13 #ifndef WX_PRECOMP
14 #include "wx/app.h"
15 #include "wx/radiobox.h"
16 #include "wx/arrstr.h"
17 #endif //WX_PRECOMP
18
19 #import <AppKit/NSView.h>
20
21 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
22 BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
23 END_EVENT_TABLE()
24 // WX_IMPLEMENT_COCOA_OWNER(wxRadioBox,NSTextField,NSControl,NSView)
25
26 bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
27 const wxString& title,
28 const wxPoint& pos,
29 const wxSize& size,
30 const wxArrayString& choices,
31 int majorDim,
32 long style, const wxValidator& validator,
33 const wxString& name)
34 {
35 wxCArrayString chs(choices);
36
37 return Create(parent, winid, title, pos, size, chs.GetCount(),
38 chs.GetStrings(), majorDim, style, validator, name);
39 }
40
41 bool wxRadioBox::Create(wxWindow *parent, wxWindowID winid,
42 const wxString& title,
43 const wxPoint& pos,
44 const wxSize& size,
45 int n, const wxString choices[],
46 int majorDim,
47 long style, const wxValidator& validator,
48 const wxString& name)
49 {
50 if(!CreateControl(parent,winid,pos,size,style,validator,name))
51 return false;
52 SetNSView([[NSView alloc] initWithFrame: MakeDefaultNSRect(size)]);
53 [m_cocoaNSView release];
54 if(m_parent)
55 m_parent->CocoaAddChild(this);
56 SetInitialFrameRect(pos,size);
57
58 return true;
59 }
60
61 wxRadioBox::~wxRadioBox()
62 {
63 }
64
65 // selection
66 void wxRadioBox::SetSelection(int n)
67 {
68 }
69
70 int wxRadioBox::GetSelection() const
71 {
72 return 0;
73 }
74
75 // string access
76 int wxRadioBox::GetCount() const
77 {
78 return 0;
79 }
80
81 wxString wxRadioBox::GetString(int n) const
82 {
83 return wxEmptyString;
84 }
85
86 void wxRadioBox::SetString(int n, const wxString& label)
87 {
88 }
89
90 // change the individual radio button state
91 void wxRadioBox::Enable(int n, bool enable)
92 {
93 }
94
95 void wxRadioBox::Show(int n, bool show)
96 {
97 }
98
99 // layout parameters
100 int wxRadioBox::GetColumnCount() const
101 {
102 return 0;
103 }
104
105 int wxRadioBox::GetRowCount() const
106 {
107 return 0;
108 }
109
110 wxSize wxRadioBox::DoGetBestSize() const
111 {
112 return wxSize(50,50);
113 }
114