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