]> git.saurik.com Git - wxWidgets.git/blob - src/msw/radiobox.cpp
Various documentation changes, makefile fixes
[wxWidgets.git] / src / msw / radiobox.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: radiobox.cpp
3 // Purpose: wxRadioBox
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 04/01/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "radiobox.h"
14 #endif
15
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
18
19 #ifdef __BORLANDC__
20 #pragma hdrstop
21 #endif
22
23 #ifndef WX_PRECOMP
24 #include <stdio.h>
25 #include "wx/setup.h"
26 #include "wx/radiobox.h"
27 #endif
28
29 #include "wx/msw/private.h"
30
31 #if !USE_SHARED_LIBRARY
32 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
33 #endif
34
35 bool wxRadioBox::MSWCommand(const WXUINT param, const WXWORD id)
36 {
37 if (param == BN_CLICKED)
38 {
39 #ifdef __WIN32__
40 int i;
41 for (i = 0; i < m_noItems; i++)
42 if (id == GetWindowLong((HWND) m_radioButtons[i], GWL_ID))
43 m_selectedButton = i;
44 #else
45 int i;
46 for (i = 0; i < m_noItems; i++)
47 if (id == GetWindowWord((HWND) m_radioButtons[i], GWW_ID))
48 m_selectedButton = i;
49 #endif
50
51 wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
52 event.SetInt( m_selectedButton );
53 event.SetEventObject( this );
54 ProcessCommand(event);
55 return TRUE;
56 }
57 else return FALSE;
58 }
59
60 #if WXWIN_COMPATIBILITY
61 wxRadioBox::wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
62 int x, int y, int width, int height,
63 int n, char **choices,
64 int majorDim, long style, const char *name)
65 {
66 wxString *choices2 = new wxString[n];
67 for ( int i = 0; i < n; i ++) choices2[i] = choices[i];
68 Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, choices2, majorDim, style,
69 wxDefaultValidator, name);
70 Callback(func);
71 delete choices2;
72 }
73
74 #endif
75
76 // Radio box item
77 wxRadioBox::wxRadioBox(void)
78 {
79 m_selectedButton = -1;
80 m_noItems = 0;
81 m_noRowsOrCols = 0;
82 m_radioButtons = NULL;
83 m_majorDim = 0 ;
84 m_radioWidth = NULL ;
85 m_radioHeight = NULL ;
86 }
87
88 bool wxRadioBox::Create(wxWindow *parent, const wxWindowID id, const wxString& title,
89 const wxPoint& pos, const wxSize& size,
90 const int n, const wxString choices[],
91 const int majorDim, const long style,
92 const wxValidator& val, const wxString& name)
93 {
94 m_selectedButton = -1;
95 m_noItems = n;
96
97 SetName(name);
98 SetValidator(val);
99
100 parent->AddChild(this);
101 m_backgroundColour = parent->GetDefaultBackgroundColour() ;
102 m_foregroundColour = parent->GetDefaultForegroundColour() ;
103
104 m_windowStyle = (long&)style;
105
106 int x = pos.x;
107 int y = pos.y;
108 int width = size.x;
109 int height = size.y;
110
111 if (id == -1)
112 m_windowId = NewControlId();
113 else
114 m_windowId = id;
115
116 m_noRowsOrCols = majorDim;
117 if (majorDim==0)
118 m_majorDim = n ;
119 m_majorDim = majorDim ;
120
121 long msStyle = GROUP_FLAGS;
122
123 bool want3D;
124 WXDWORD exStyle = Determine3DEffects(0, &want3D) ;
125 // Even with extended styles, need to combine with WS_BORDER
126 // for them to look right.
127 if (want3D && ((m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) ||
128 (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER)))
129 msStyle |= WS_BORDER;
130
131
132 m_hWnd = (WXHWND) CreateWindowEx((DWORD) exStyle, GROUP_CLASS, (title == "" ? NULL : (const char *)title),
133 msStyle,
134 0,0,0,0,
135 (HWND) parent->GetHWND(), (HMENU) m_windowId, wxGetInstance(), NULL) ;
136
137 HWND the_handle = (HWND) parent->GetHWND() ;
138
139 #if CTL3D
140 if (want3D)
141 {
142 Ctl3dSubclassCtl((HWND) m_hWnd);
143 m_useCtl3D = TRUE;
144 }
145 #endif
146
147 SetFont(* parent->GetFont());
148
149 // Subclass again for purposes of dialog editing mode
150 SubclassWin((WXHWND)m_hWnd);
151
152 /* Label will be the same as button font now.
153 if (labelFont)
154 {
155 labelFont->RealizeResource();
156 if (labelFont->GetResourceHandle())
157 SendMessage(ms_handle,WM_SETFONT,
158 (WPARAM)labelFont->GetResourceHandle(),0L);
159 }
160 */
161
162 // Some radio boxes test consecutive id.
163 (void)NewControlId() ;
164 m_radioButtons = new WXHWND[n];
165 m_radioWidth = new int[n] ;
166 m_radioHeight = new int[n] ;
167 int i;
168 for (i = 0; i < n; i++)
169 {
170 m_radioWidth[i] = m_radioHeight[i] = -1 ;
171 long groupStyle = 0;
172 if (i == 0 && style==0)
173 groupStyle = WS_GROUP;
174 long newId = NewControlId();
175 long msStyle = groupStyle | RADIO_FLAGS;
176
177 m_radioButtons[i] = (WXHWND) CreateWindowEx(exStyle, RADIO_CLASS, choices[i],
178 msStyle,0,0,0,0,
179 the_handle, (HMENU)newId, wxGetInstance(), NULL);
180 #if CTL3D
181 if (want3D)
182 {
183 Ctl3dSubclassCtl((HWND) m_hWnd);
184 m_useCtl3D = TRUE;
185 }
186 #endif
187 if (GetFont())
188 {
189 SendMessage((HWND)m_radioButtons[i],WM_SETFONT,
190 (WPARAM)GetFont()->GetResourceHandle(),0L);
191 }
192 m_subControls.Append((wxObject *)newId);
193 }
194
195 // Create a dummy radio control to end the group.
196 (void)CreateWindowEx(0, RADIO_CLASS, "", WS_GROUP|RADIO_FLAGS, 0,0,0,0, the_handle, (HMENU)NewControlId(), wxGetInstance(), NULL);
197
198 SetSelection(0);
199
200 SetSize(x, y, width, height);
201
202 return TRUE;
203 }
204
205 #if 0
206 bool wxRadioBox::Create(wxWindow *parent, const wxWindowID id, const wxString& title,
207 const wxPoint& pos, const wxSize& size,
208 const int n, const wxBitmap *choices[],
209 const int majorDim, const long style,
210 const wxValidator& val, const wxString& name)
211 {
212 m_selectedButton = -1;
213 m_noRowsOrCols = 0;
214 m_noItems = n;
215
216 SetName(name);
217 SetValidator(val);
218
219 parent->AddChild(this);
220 m_backgroundColour = parent->GetDefaultBackgroundColour() ;
221 m_foregroundColour = parent->GetDefaultForegroundColour() ;
222
223 m_windowStyle = (long&)style;
224
225 int x = pos.x;
226 int y = pos.y;
227 int width = size.x;
228 int height = size.y;
229
230 if (id == -1)
231 m_windowId = NewControlId();
232 else
233 m_windowId = id;
234
235
236 m_noRowsOrCols = majorDim;
237 if (majorDim==0)
238 m_majorDim = n ;
239 m_majorDim = majorDim ;
240 HWND the_handle ;
241
242 long msStyle = GROUP_FLAGS;
243
244 bool want3D;
245 WXDWORD exStyle = Determine3DEffects(0, &want3D) ;
246 // Even with extended styles, need to combine with WS_BORDER
247 // for them to look right.
248 if (want3D && ((m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) ||
249 (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER)))
250 msStyle |= WS_BORDER;
251
252 m_hWnd = (WXHWND) CreateWindowEx((DWORD) exStyle, GROUP_CLASS, (title == "" ? NULL : (const char *)title),
253 msStyle,
254 0,0,0,0,
255 (HWND) parent->GetHWND(), (HMENU) m_windowId, wxGetInstance(), NULL) ;
256
257 /*
258 if (labelFont)
259 {
260 labelFont->RealizeResource();
261 if (labelFont->GetResourceHandle())
262 SendMessage(ms_handle,WM_SETFONT,
263 (WPARAM)labelFont->GetResourceHandle(),0L);
264 }
265 */
266 the_handle = (HWND) parent->GetHWND();
267
268 #if CTL3D
269 if (want3D)
270 {
271 Ctl3dSubclassCtl((HWND) m_hWnd);
272 m_useCtl3D = TRUE;
273 }
274 #endif
275
276 SetFont(* parent->GetFont());
277
278 // Subclass again for purposes of dialog editing mode
279 SubclassWin((WXHWND)m_hWnd);
280
281 (void)NewControlId() ;
282 m_radioButtons = new WXHWND[n];
283 m_radioWidth = new int[n] ;
284 m_radioHeight = new int[n] ;
285
286 int i;
287 for (i = 0; i < n; i++)
288 {
289 long groupStyle = 0;
290 if (i == 0 && style==0)
291 groupStyle = WS_GROUP;
292 long newId = NewControlId();
293 m_radioWidth[i] = ((wxBitmap *)choices[i])->GetWidth();
294 m_radioHeight[i] = ((wxBitmap *)choices[i])->GetHeight();
295 char tmp[32] ;
296 sprintf(tmp,"Toggle%d",i) ;
297 long msStyle = groupStyle | RADIO_FLAGS;
298 m_radioButtons[i] = (WXHWND) CreateWindowEx(exStyle, RADIO_CLASS, tmp,
299 msStyle,0,0,0,0,
300 the_handle, (HMENU)newId, wxhInstance, NULL);
301 #if CTL3D
302 if (want3D)
303 {
304 Ctl3dSubclassCtl((HWND) m_hWnd);
305 m_useCtl3D = TRUE;
306 }
307 #endif
308 m_subControls.Append((wxObject *)newId);
309 }
310 // Create a dummy radio control to end the group.
311 (void)CreateWindowEx(0, RADIO_CLASS, "", WS_GROUP|RADIO_FLAGS, 0,0,0,0, the_handle, (HMENU)NewControlId(), wxGetInstance(), NULL);
312
313 SetSelection(0);
314
315 SetSize(x, y, width, height);
316
317 return TRUE;
318 }
319 #endif
320
321 wxRadioBox::~wxRadioBox(void)
322 {
323 m_isBeingDeleted = TRUE;
324
325 if (m_radioButtons)
326 {
327 int i;
328 for (i = 0; i < m_noItems; i++)
329 DestroyWindow((HWND) m_radioButtons[i]);
330 delete[] m_radioButtons;
331 }
332 if (m_radioWidth)
333 delete[] m_radioWidth ;
334 if (m_radioHeight)
335 delete[] m_radioHeight ;
336 if (m_hWnd)
337 ::DestroyWindow((HWND) m_hWnd) ;
338 m_hWnd = 0 ;
339
340 }
341
342 wxString wxRadioBox::GetLabel(const int item) const
343 {
344 GetWindowText((HWND)m_radioButtons[item], wxBuffer, 300);
345 return wxString(wxBuffer);
346 }
347
348 void wxRadioBox::SetLabel(const int item, const wxString& label)
349 {
350 m_radioWidth[item] = m_radioHeight[item] = -1 ;
351 SetWindowText((HWND)m_radioButtons[item], (const char *)label);
352 }
353
354 void wxRadioBox::SetLabel(const int item, wxBitmap *bitmap)
355 {
356 /*
357 m_radioWidth[item] = bitmap->GetWidth() + FB_MARGIN ;
358 m_radioHeight[item] = bitmap->GetHeight() + FB_MARGIN ;
359 */
360 }
361
362 int wxRadioBox::FindString(const wxString& s) const
363 {
364 int i;
365 for (i = 0; i < m_noItems; i++)
366 {
367 GetWindowText((HWND) m_radioButtons[i], wxBuffer, 1000);
368 if (s == wxBuffer)
369 return i;
370 }
371 return -1;
372 }
373
374 void wxRadioBox::SetSelection(const int N)
375 {
376 if ((N < 0) || (N >= m_noItems))
377 return;
378
379 // Following necessary for Win32s, because Win32s translate BM_SETCHECK
380 if (m_selectedButton >= 0 && m_selectedButton < m_noItems)
381 SendMessage((HWND) m_radioButtons[m_selectedButton], BM_SETCHECK, 0, 0L);
382
383 SendMessage((HWND) m_radioButtons[N], BM_SETCHECK, 1, 0L);
384 m_selectedButton = N;
385 }
386
387 // Get single selection, for single choice list items
388 int wxRadioBox::GetSelection(void) const
389 {
390 return m_selectedButton;
391 }
392
393 // Find string for position
394 wxString wxRadioBox::GetString(const int N) const
395 {
396 GetWindowText((HWND) m_radioButtons[N], wxBuffer, 1000);
397 return wxString(wxBuffer);
398 }
399
400 void wxRadioBox::SetSize(const int x, const int y, const int width, const int height, const int sizeFlags)
401 {
402 int currentX, currentY;
403 GetPosition(&currentX, &currentY);
404 int xx = x;
405 int yy = y;
406
407 if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
408 xx = currentX;
409 if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
410 yy = currentY;
411
412 char buf[400];
413
414 int y_offset = yy;
415 int x_offset = xx;
416 float current_width;
417
418 float cyf;
419
420 int cx1,cy1 ;
421 wxGetCharSize(m_hWnd, &cx1, &cy1, GetFont());
422 // Attempt to have a look coherent with other platforms:
423 // We compute the biggest toggle dim, then we align all
424 // items according this value.
425 int maxWidth = -1;
426 int maxHeight = -1 ;
427
428 int i;
429 for (i = 0 ; i < m_noItems; i++)
430 {
431 int eachWidth;
432 int eachHeight ;
433 if (m_radioWidth[i]<0)
434 {
435 // It's a labelled toggle
436 GetWindowText((HWND) m_radioButtons[i], buf, 300);
437 GetTextExtent(buf, &current_width, &cyf,NULL,NULL, GetFont());
438 eachWidth = (int)(current_width + RADIO_SIZE);
439 eachHeight = (int)((3*cyf)/2);
440 }
441 else
442 {
443 eachWidth = m_radioWidth[i] ;
444 eachHeight = m_radioHeight[i] ;
445 }
446 if (maxWidth<eachWidth) maxWidth = eachWidth ;
447 if (maxHeight<eachHeight) maxHeight = eachHeight ;
448 }
449
450 if (m_hWnd)
451 {
452 int totWidth ;
453 int totHeight;
454
455 int nbHor,nbVer;
456
457 if (m_windowStyle & wxRA_VERTICAL)
458 {
459 nbVer = m_majorDim ;
460 nbHor = (m_noItems+m_majorDim-1)/m_majorDim ;
461 }
462 else
463 {
464 nbHor = m_majorDim ;
465 nbVer = (m_noItems+m_majorDim-1)/m_majorDim ;
466 }
467
468 // this formula works, but I don't know why.
469 // Please, be sure what you do if you modify it!!
470 if (m_radioWidth[0]<0)
471 totHeight = (nbVer * maxHeight) + cy1/2 ;
472 else
473 totHeight = nbVer * (maxHeight+cy1/2) ;
474 totWidth = nbHor * (maxWidth+cx1) ;
475
476 #if (!CTL3D)
477 // Requires a bigger group box in plain Windows
478 MoveWindow((HWND) m_hWnd,x_offset,y_offset,totWidth+cx1,totHeight+(3*cy1)/2,TRUE) ;
479 #else
480 MoveWindow((HWND) m_hWnd,x_offset,y_offset,totWidth+cx1,totHeight+cy1,TRUE) ;
481 #endif
482 x_offset += cx1;
483 y_offset += cy1;
484 }
485
486 #if (!CTL3D)
487 y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label
488 // JACS 2/12/93. CTL3D draws group label quite high.
489 #endif
490 int startX = x_offset ;
491 int startY = y_offset ;
492
493 for ( i = 0 ; i < m_noItems; i++)
494 {
495 // Bidimensional radio adjustment
496 if (i&&((i%m_majorDim)==0)) // Why is this omitted for i = 0?
497 {
498 if (m_windowStyle & wxRA_VERTICAL)
499 {
500 y_offset = startY;
501 x_offset += maxWidth + cx1 ;
502 }
503 else
504 {
505 x_offset = startX ;
506 y_offset += maxHeight ;
507 if (m_radioWidth[0]>0)
508 y_offset += cy1/2 ;
509 }
510 }
511 int eachWidth ;
512 int eachHeight ;
513 if (m_radioWidth[i]<0)
514 {
515 // It's a labeled item
516 GetWindowText((HWND) m_radioButtons[i], buf, 300);
517 GetTextExtent(buf, &current_width, &cyf,NULL,NULL,GetFont());
518
519 // How do we find out radio button bitmap size!!
520 // By adjusting them carefully, manually :-)
521 eachWidth = (int)(current_width + RADIO_SIZE);
522 eachHeight = (int)((3*cyf)/2);
523 }
524 else
525 {
526 eachWidth = m_radioWidth[i] ;
527 eachHeight = m_radioHeight[i] ;
528 }
529
530 MoveWindow((HWND) m_radioButtons[i],x_offset,y_offset,eachWidth,eachHeight,TRUE);
531 if (m_windowStyle & wxRA_VERTICAL)
532 {
533 y_offset += maxHeight;
534 if (m_radioWidth[0]>0)
535 y_offset += cy1/2 ;
536 }
537 else
538 x_offset += maxWidth + cx1;
539 }
540 }
541
542 void wxRadioBox::GetSize(int *width, int *height) const
543 {
544 RECT rect;
545 rect.left = -1; rect.right = -1; rect.top = -1; rect.bottom = -1;
546
547 if (m_hWnd)
548 wxFindMaxSize(m_hWnd, &rect);
549
550 int i;
551 for (i = 0; i < m_noItems; i++)
552 wxFindMaxSize(m_radioButtons[i], &rect);
553
554 *width = rect.right - rect.left;
555 *height = rect.bottom - rect.top;
556 }
557
558 void wxRadioBox::GetPosition(int *x, int *y) const
559 {
560 wxWindow *parent = GetParent();
561 RECT rect;
562 rect.left = -1; rect.right = -1; rect.top = -1; rect.bottom = -1;
563
564 int i;
565 for (i = 0; i < m_noItems; i++)
566 wxFindMaxSize(m_radioButtons[i], &rect);
567
568 if (m_hWnd)
569 wxFindMaxSize(m_hWnd, &rect);
570
571 // Since we now have the absolute screen coords,
572 // if there's a parent we must subtract its top left corner
573 POINT point;
574 point.x = rect.left;
575 point.y = rect.top;
576 if (parent)
577 {
578 ::ScreenToClient((HWND) parent->GetHWND(), &point);
579 }
580
581 *x = point.x;
582 *y = point.y;
583 }
584
585 wxString wxRadioBox::GetLabel(void) const
586 {
587 if (m_hWnd)
588 {
589 GetWindowText((HWND) m_hWnd, wxBuffer, 300);
590 return wxString(wxBuffer);
591 }
592 else return wxString("");
593 }
594
595 void wxRadioBox::SetLabel(const wxString& label)
596 {
597 if (m_hWnd && label)
598 SetWindowText((HWND) m_hWnd, label);
599 }
600
601 void wxRadioBox::SetFocus(void)
602 {
603 /*
604 if (m_noItems > 0)
605 ::SetFocus((HWND) m_radioButtons[0]);
606 */
607 /* Begin Alberts Patch 26. 5. 1997*/
608 if (m_noItems > 0)
609 {
610 if (m_selectedButton == -1)
611 ::SetFocus((HWND) m_radioButtons[0]);
612 else
613 ::SetFocus((HWND) m_radioButtons[m_selectedButton]);
614 }
615 /* Ende Alberts Patch*/
616
617 }
618
619 bool wxRadioBox::Show(const bool show)
620 {
621 int cshow;
622 if (show)
623 cshow = SW_SHOW;
624 else
625 cshow = SW_HIDE;
626 if (m_hWnd)
627 ShowWindow((HWND) m_hWnd, cshow);
628 int i;
629 for (i = 0; i < m_noItems; i++)
630 ShowWindow((HWND) m_radioButtons[i], cshow);
631 return TRUE;
632 }
633
634 // Enable a specific button
635 void wxRadioBox::Enable(const int item, const bool enable)
636 {
637 if (item<0)
638 wxWindow::Enable(enable) ;
639 else if (item < m_noItems)
640 ::EnableWindow((HWND) m_radioButtons[item], enable);
641 }
642
643 // Enable all controls
644 void wxRadioBox::Enable(const bool enable)
645 {
646 wxControl::Enable(enable);
647
648 int i;
649 for (i = 0; i < m_noItems; i++)
650 ::EnableWindow((HWND) m_radioButtons[i], enable);
651 }
652
653 // Show a specific button
654 void wxRadioBox::Show(const int item, const bool show)
655 {
656 if (item<0)
657 wxRadioBox::Show(show) ;
658 else if (item < m_noItems)
659 {
660 int cshow;
661 if (show)
662 cshow = SW_SHOW;
663 else
664 cshow = SW_HIDE;
665 ShowWindow((HWND) m_radioButtons[item], cshow);
666 }
667 }
668
669 WXHBRUSH wxRadioBox::OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
670 WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
671 {
672 #if CTL3D
673 if ( m_useCtl3D )
674 {
675 HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
676 return (WXHBRUSH) hbrush;
677 }
678 #endif
679
680 if (GetParent()->GetTransparentBackground())
681 SetBkMode((HDC) pDC, TRANSPARENT);
682 else
683 SetBkMode((HDC) pDC, OPAQUE);
684
685 ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
686 ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
687
688 wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
689
690 // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush
691 // has a zero usage count.
692 // backgroundBrush->RealizeResource();
693 return (WXHBRUSH) backgroundBrush->GetResourceHandle();
694 }
695
696 // For single selection items only
697 wxString wxRadioBox::GetStringSelection (void) const
698 {
699 int sel = GetSelection ();
700 if (sel > -1)
701 return this->GetString (sel);
702 else
703 return wxString("");
704 }
705
706 bool wxRadioBox::SetStringSelection (const wxString& s)
707 {
708 int sel = FindString (s);
709 if (sel > -1)
710 {
711 SetSelection (sel);
712 return TRUE;
713 }
714 else
715 return FALSE;
716 }
717
718 /*
719 void wxRadioBox::SetLabelFont(wxFont *font)
720 {
721 // Decrement the usage count of the old label font
722 // (we may be able to free it up)
723 if (labelFont)
724 labelFont->ReleaseResource();
725
726 labelFont = font;
727
728 // Increment usage count
729 if (font)
730 font->UseResource();
731
732 HWND hWnd = GetHWND();
733 if (hWnd != 0)
734 {
735 if (font)
736 {
737 font->RealizeResource();
738
739 if (font->GetResourceHandle())
740 SendMessage(hWnd, WM_SETFONT,
741 (WPARAM)font->GetResourceHandle(),TRUE);
742 }
743 }
744 }
745
746 */
747
748 bool wxRadioBox::ContainsHWND(WXHWND hWnd) const
749 {
750 int i;
751 for (i = 0; i < Number(); i++)
752 if (GetRadioButtons()[i] == hWnd)
753 return TRUE;
754 return FALSE;
755 }
756
757 void wxRadioBox::Command (wxCommandEvent & event)
758 {
759 SetSelection (event.m_commandInt);
760 ProcessCommand (event);
761 }
762
763