]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/radiobox.cpp
Native wxStaticText. Cleaning of wxRadioBox code before native implementation. Events...
[wxWidgets.git] / src / palmos / radiobox.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/radiobox.cpp
3 // Purpose: wxRadioBox implementation
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by: Wlodzimierz ABX Skiba - native wxRadioBox implementation
6 // Created: 10/13/04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne, Wlodzimierz Skiba
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // ===========================================================================
13 // declarations
14 // ===========================================================================
15
16 // ---------------------------------------------------------------------------
17 // headers
18 // ---------------------------------------------------------------------------
19
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "radiobox.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #if wxUSE_RADIOBOX
32
33 #ifndef WX_PRECOMP
34 #include "wx/bitmap.h"
35 #include "wx/brush.h"
36 #include "wx/radiobox.h"
37 #include "wx/settings.h"
38 #include "wx/log.h"
39 #endif
40
41 #include "wx/palmos/private.h"
42
43 #if wxUSE_TOOLTIPS
44 #include "wx/tooltip.h"
45 #endif // wxUSE_TOOLTIPS
46
47 // TODO: wxCONSTRUCTOR
48 #if 0 // wxUSE_EXTENDED_RTTI
49 WX_DEFINE_FLAGS( wxRadioBoxStyle )
50
51 wxBEGIN_FLAGS( wxRadioBoxStyle )
52 // new style border flags, we put them first to
53 // use them for streaming out
54 wxFLAGS_MEMBER(wxBORDER_SIMPLE)
55 wxFLAGS_MEMBER(wxBORDER_SUNKEN)
56 wxFLAGS_MEMBER(wxBORDER_DOUBLE)
57 wxFLAGS_MEMBER(wxBORDER_RAISED)
58 wxFLAGS_MEMBER(wxBORDER_STATIC)
59 wxFLAGS_MEMBER(wxBORDER_NONE)
60
61 // old style border flags
62 wxFLAGS_MEMBER(wxSIMPLE_BORDER)
63 wxFLAGS_MEMBER(wxSUNKEN_BORDER)
64 wxFLAGS_MEMBER(wxDOUBLE_BORDER)
65 wxFLAGS_MEMBER(wxRAISED_BORDER)
66 wxFLAGS_MEMBER(wxSTATIC_BORDER)
67 wxFLAGS_MEMBER(wxBORDER)
68
69 // standard window styles
70 wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
71 wxFLAGS_MEMBER(wxCLIP_CHILDREN)
72 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW)
73 wxFLAGS_MEMBER(wxWANTS_CHARS)
74 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)
75 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )
76 wxFLAGS_MEMBER(wxVSCROLL)
77 wxFLAGS_MEMBER(wxHSCROLL)
78
79 wxFLAGS_MEMBER(wxRA_SPECIFY_COLS)
80 wxFLAGS_MEMBER(wxRA_HORIZONTAL)
81 wxFLAGS_MEMBER(wxRA_SPECIFY_ROWS)
82 wxFLAGS_MEMBER(wxRA_VERTICAL)
83
84 wxEND_FLAGS( wxRadioBoxStyle )
85
86 IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioBox, wxControl,"wx/radiobox.h")
87
88 wxBEGIN_PROPERTIES_TABLE(wxRadioBox)
89 wxEVENT_PROPERTY( Select , wxEVT_COMMAND_RADIOBOX_SELECTED , wxCommandEvent )
90 wxPROPERTY_FLAGS( WindowStyle , wxRadioBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
91 wxEND_PROPERTIES_TABLE()
92
93 #else
94 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
95 #endif
96
97 /*
98 selection
99 content
100 label
101 dimension
102 item
103 */
104
105 #define RADIOBTN_PARENT_IS_RADIOBOX 0
106
107 // ---------------------------------------------------------------------------
108 // private functions
109 // ---------------------------------------------------------------------------
110
111 // ---------------------------------------------------------------------------
112 // global vars
113 // ---------------------------------------------------------------------------
114
115 // the pointer to standard radio button wnd proc
116 static WXFARPROC s_wndprocRadioBtn = (WXFARPROC)NULL;
117
118 // ===========================================================================
119 // implementation
120 // ===========================================================================
121
122 // ---------------------------------------------------------------------------
123 // wxRadioBox
124 // ---------------------------------------------------------------------------
125
126 int wxRadioBox::GetCount() const
127 {
128 return 0;
129 }
130
131 int wxRadioBox::GetColumnCount() const
132 {
133 return 0;
134 }
135
136 int wxRadioBox::GetRowCount() const
137 {
138 return 0;
139 }
140
141 // returns the number of rows
142 int wxRadioBox::GetNumVer() const
143 {
144 return 0;
145 }
146
147 // returns the number of columns
148 int wxRadioBox::GetNumHor() const
149 {
150 return 0;
151 }
152
153 // Radio box item
154 wxRadioBox::wxRadioBox()
155 {
156 }
157
158 bool wxRadioBox::Create(wxWindow *parent,
159 wxWindowID id,
160 const wxString& title,
161 const wxPoint& pos,
162 const wxSize& size,
163 int n,
164 const wxString choices[],
165 int majorDim,
166 long style,
167 const wxValidator& val,
168 const wxString& name)
169 {
170 return false;
171 }
172
173 bool wxRadioBox::Create(wxWindow *parent,
174 wxWindowID id,
175 const wxString& title,
176 const wxPoint& pos,
177 const wxSize& size,
178 const wxArrayString& choices,
179 int majorDim,
180 long style,
181 const wxValidator& val,
182 const wxString& name)
183 {
184 return false;
185 }
186
187 wxRadioBox::~wxRadioBox()
188 {
189 }
190
191 void wxRadioBox::SetString(int item, const wxString& label)
192 {
193 }
194
195 void wxRadioBox::SetSelection(int N)
196 {
197 }
198
199 // Get single selection, for single choice list items
200 int wxRadioBox::GetSelection() const
201 {
202 return 0;
203 }
204
205 // Find string for position
206 wxString wxRadioBox::GetString(int item) const
207 {
208 wxString ret;
209
210 return ret;
211 }
212
213 // ----------------------------------------------------------------------------
214 // size calculations
215 // ----------------------------------------------------------------------------
216
217 wxSize wxRadioBox::GetMaxButtonSize() const
218 {
219 return wxSize(0,0);
220 }
221
222 wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
223 {
224 return wxSize(0,0);
225 }
226
227 wxSize wxRadioBox::DoGetBestSize() const
228 {
229 return wxSize(0,0);
230 }
231
232 // Restored old code.
233 void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
234 {
235 }
236
237 void wxRadioBox::GetSize(int *width, int *height) const
238 {
239 }
240
241 void wxRadioBox::GetPosition(int *x, int *y) const
242 {
243 }
244
245 void wxRadioBox::SetFocus()
246 {
247 }
248
249 bool wxRadioBox::Show(bool show)
250 {
251 return false;
252 }
253
254 // Enable a specific button
255 void wxRadioBox::Enable(int item, bool enable)
256 {
257 }
258
259 // Enable all controls
260 bool wxRadioBox::Enable(bool enable)
261 {
262 return false;
263 }
264
265 // Show a specific button
266 void wxRadioBox::Show(int item, bool show)
267 {
268 }
269
270 bool wxRadioBox::ContainsHWND(WXHWND hWnd) const
271 {
272 return false;
273 }
274
275 void wxRadioBox::Command(wxCommandEvent & event)
276 {
277 }
278
279 void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn)
280 {
281 }
282
283 void wxRadioBox::SendNotificationEvent()
284 {
285 }
286
287 bool wxRadioBox::SetFont(const wxFont& font)
288 {
289 return false;
290 }
291
292 // ----------------------------------------------------------------------------
293 // our window proc
294 // ----------------------------------------------------------------------------
295
296 WXHBRUSH wxRadioBox::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor),
297 WXUINT WXUNUSED(message),
298 WXWPARAM WXUNUSED(wParam),
299 WXLPARAM WXUNUSED(lParam)
300 )
301 {
302 return (WXHBRUSH)0;
303 }
304
305 #endif // wxUSE_RADIOBOX