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