]> git.saurik.com Git - wxWidgets.git/blob - src/mac/radiobox.cpp
fixed menu accelerators
[wxWidgets.git] / src / mac / radiobox.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: radiobox.cpp
3 // Purpose: wxRadioBox
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "radiobox.h"
14 #endif
15
16 #include "wx/radiobox.h"
17
18 #if !USE_SHARED_LIBRARY
19 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
20 #endif
21
22 // Radio box item
23 wxRadioBox::wxRadioBox()
24 {
25 m_selectedButton = -1;
26 m_noItems = 0;
27 m_noRowsOrCols = 0;
28 m_majorDim = 0 ;
29 }
30
31 bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
32 const wxPoint& pos, const wxSize& size,
33 int n, const wxString choices[],
34 int majorDim, long style,
35 const wxValidator& val, const wxString& name)
36 {
37 m_selectedButton = -1;
38 m_noItems = n;
39
40 SetName(name);
41 SetValidator(val);
42
43 parent->AddChild(this);
44
45 m_windowStyle = (long&)style;
46
47 if (id == -1)
48 m_windowId = NewControlId();
49 else
50 m_windowId = id;
51
52 m_noRowsOrCols = majorDim;
53
54 if (majorDim==0)
55 m_majorDim = n ;
56 else
57 m_majorDim = majorDim ;
58
59
60 // TODO create radiobox
61 return FALSE;
62 }
63
64
65 wxRadioBox::~wxRadioBox()
66 {
67 // TODO
68 }
69
70 wxString wxRadioBox::GetLabel(int item) const
71 {
72 // TODO
73 return wxString("");
74 }
75
76 void wxRadioBox::SetLabel(int item, const wxString& label)
77 {
78 // TODO
79 }
80
81 int wxRadioBox::FindString(const wxString& s) const
82 {
83 // TODO
84 return -1;
85 }
86
87 void wxRadioBox::SetSelection(int n)
88 {
89 if ((n < 0) || (n >= m_noItems))
90 return;
91 // TODO
92
93 m_selectedButton = n;
94 }
95
96 // Get single selection, for single choice list items
97 int wxRadioBox::GetSelection() const
98 {
99 return m_selectedButton;
100 }
101
102 // Find string for position
103 wxString wxRadioBox::GetString(int n) const
104 {
105 // TODO
106 return wxString("");
107 }
108
109 void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
110 {
111 wxControl::SetSize( x , y , width , height , sizeFlags ) ;
112 }
113
114 void wxRadioBox::GetSize(int *width, int *height) const
115 {
116 // TODO
117 }
118
119 void wxRadioBox::GetPosition(int *x, int *y) const
120 {
121 // TODO
122 }
123
124 wxString wxRadioBox::GetLabel() const
125 {
126 // TODO
127 return wxString("");
128 }
129
130 void wxRadioBox::SetLabel(const wxString& label)
131 {
132 // TODO
133 }
134
135 void wxRadioBox::SetFocus()
136 {
137 // TODO
138 }
139
140 bool wxRadioBox::Show(bool show)
141 {
142 // TODO
143 return wxWindow::Show( show ) ;
144 }
145
146 // Enable a specific button
147 void wxRadioBox::Enable(int item, bool enable)
148 {
149 wxControl::Enable(enable);
150 // TODO
151 }
152
153 // Enable all controls
154 void wxRadioBox::Enable(bool enable)
155 {
156 wxControl::Enable(enable);
157
158 // TODO
159 }
160
161 // Show a specific button
162 void wxRadioBox::Show(int item, bool show)
163 {
164 // TODO
165 }
166
167 // For single selection items only
168 wxString wxRadioBox::GetStringSelection () const
169 {
170 int sel = GetSelection ();
171 if (sel > -1)
172 return this->GetString (sel);
173 else
174 return wxString("");
175 }
176
177 bool wxRadioBox::SetStringSelection (const wxString& s)
178 {
179 int sel = FindString (s);
180 if (sel > -1)
181 {
182 SetSelection (sel);
183 return TRUE;
184 }
185 else
186 return FALSE;
187 }
188
189 void wxRadioBox::Command (wxCommandEvent & event)
190 {
191 SetSelection (event.m_commandInt);
192 ProcessCommand (event);
193 }
194
195