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