1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/msw/radiobox.cpp
3 // Purpose: wxRadioBox implementation
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
29 #include "wx/radiobox.h"
32 #include "wx/bitmap.h"
34 #include "wx/settings.h"
38 #include "wx/msw/subwin.h"
41 #include "wx/tooltip.h"
42 #endif // wxUSE_TOOLTIPS
44 // TODO: wxCONSTRUCTOR
45 #if 0 // wxUSE_EXTENDED_RTTI
46 WX_DEFINE_FLAGS( wxRadioBoxStyle
)
48 wxBEGIN_FLAGS( wxRadioBoxStyle
)
49 // new style border flags, we put them first to
50 // use them for streaming out
51 wxFLAGS_MEMBER(wxBORDER_SIMPLE
)
52 wxFLAGS_MEMBER(wxBORDER_SUNKEN
)
53 wxFLAGS_MEMBER(wxBORDER_DOUBLE
)
54 wxFLAGS_MEMBER(wxBORDER_RAISED
)
55 wxFLAGS_MEMBER(wxBORDER_STATIC
)
56 wxFLAGS_MEMBER(wxBORDER_NONE
)
58 // old style border flags
59 wxFLAGS_MEMBER(wxSIMPLE_BORDER
)
60 wxFLAGS_MEMBER(wxSUNKEN_BORDER
)
61 wxFLAGS_MEMBER(wxDOUBLE_BORDER
)
62 wxFLAGS_MEMBER(wxRAISED_BORDER
)
63 wxFLAGS_MEMBER(wxSTATIC_BORDER
)
64 wxFLAGS_MEMBER(wxBORDER
)
66 // standard window styles
67 wxFLAGS_MEMBER(wxTAB_TRAVERSAL
)
68 wxFLAGS_MEMBER(wxCLIP_CHILDREN
)
69 wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW
)
70 wxFLAGS_MEMBER(wxWANTS_CHARS
)
71 wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE
)
72 wxFLAGS_MEMBER(wxALWAYS_SHOW_SB
)
73 wxFLAGS_MEMBER(wxVSCROLL
)
74 wxFLAGS_MEMBER(wxHSCROLL
)
76 wxFLAGS_MEMBER(wxRA_SPECIFY_COLS
)
77 wxFLAGS_MEMBER(wxRA_HORIZONTAL
)
78 wxFLAGS_MEMBER(wxRA_SPECIFY_ROWS
)
79 wxFLAGS_MEMBER(wxRA_VERTICAL
)
81 wxEND_FLAGS( wxRadioBoxStyle
)
83 IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioBox
, wxControl
,"wx/radiobox.h")
85 wxBEGIN_PROPERTIES_TABLE(wxRadioBox
)
86 wxEVENT_PROPERTY( Select
, wxEVT_COMMAND_RADIOBOX_SELECTED
, wxCommandEvent
)
87 wxPROPERTY_FLAGS( WindowStyle
, wxRadioBoxStyle
, long , SetWindowStyleFlag
, GetWindowStyleFlag
, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
88 wxEND_PROPERTIES_TABLE()
91 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox
, wxControl
)
102 // ---------------------------------------------------------------------------
104 // ---------------------------------------------------------------------------
106 // wnd proc for radio buttons
107 LRESULT APIENTRY _EXPORT
wxRadioBtnWndProc(HWND hWnd
,
112 // ---------------------------------------------------------------------------
114 // ---------------------------------------------------------------------------
116 // the pointer to standard radio button wnd proc
117 static WXFARPROC s_wndprocRadioBtn
= (WXFARPROC
)NULL
;
119 // ===========================================================================
121 // ===========================================================================
123 // ---------------------------------------------------------------------------
124 // wxRadioBox creation
125 // ---------------------------------------------------------------------------
128 void wxRadioBox::Init()
130 m_selectedButton
= wxNOT_FOUND
;
131 m_radioButtons
= NULL
;
134 m_radioHeight
= NULL
;
137 bool wxRadioBox::Create(wxWindow
*parent
,
139 const wxString
& title
,
143 const wxString choices
[],
146 const wxValidator
& val
,
147 const wxString
& name
)
149 // common initialization
150 if ( !wxStaticBox::Create(parent
, id
, title
, pos
, size
, style
, name
) )
153 // the code elsewhere in this file supposes that either wxRA_SPECIFY_COLS
154 // or wxRA_SPECIFY_ROWS is set, ensure that this is indeed the case
155 if ( !(style
& (wxRA_SPECIFY_ROWS
| wxRA_SPECIFY_COLS
)) )
156 style
|= wxRA_SPECIFY_COLS
;
162 #endif // wxUSE_VALIDATORS/!wxUSE_VALIDATORS
164 // We need an extra one to keep track of the 'dummy' item we
165 // create to end the radio group, so it will be destroyed and
166 // it's id will be released. But we want it separate from the
167 // other buttons since the wxSubwindows will operate on it as
168 // well and we just want to ignore it until destroying it.
169 // For instance, we don't want the bounding box of the radio
170 // buttons to include the dummy button
171 m_radioButtons
= new wxSubwindows(n
);
173 m_radioWidth
= new int[n
];
174 m_radioHeight
= new int[n
];
176 for ( int i
= 0; i
< n
; i
++ )
179 m_radioHeight
[i
] = wxDefaultCoord
;
180 long styleBtn
= BS_AUTORADIOBUTTON
| WS_TABSTOP
| WS_CHILD
| WS_VISIBLE
;
182 styleBtn
|= WS_GROUP
;
184 wxWindowIDRef subid
= NewControlId();
186 HWND hwndBtn
= ::CreateWindow(_T("BUTTON"),
189 0, 0, 0, 0, // will be set in SetSize()
191 (HMENU
)wxUIntToPtr(subid
.GetValue()),
197 wxLogLastError(wxT("CreateWindow(radio btn)"));
202 // Keep track of the subwindow
203 m_radioButtons
->Set(i
, hwndBtn
, subid
);
205 SubclassRadioButton((WXHWND
)hwndBtn
);
207 // Also, make it a subcontrol of this control
208 m_subControls
.Add(subid
);
211 // Create a dummy radio control to end the group.
212 m_dummyId
= NewControlId();
214 m_dummyHwnd
= (WXHWND
)::CreateWindow(_T("BUTTON"),
216 WS_GROUP
| BS_AUTORADIOBUTTON
| WS_CHILD
,
217 0, 0, 0, 0, GetHwndOf(parent
),
218 (HMENU
)wxUIntToPtr(m_dummyId
.GetValue()),
219 wxGetInstance(), NULL
);
222 m_radioButtons
->SetFont(GetFont());
225 // Set the z-order correctly
226 SetWindowPos(GetHwnd(), HWND_BOTTOM
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
229 SetMajorDim(majorDim
== 0 ? n
: majorDim
, style
);
231 SetSize(pos
.x
, pos
.y
, size
.x
, size
.y
);
233 // Now that we have items determine what is the best size and set it.
234 SetInitialSize(size
);
239 bool wxRadioBox::Create(wxWindow
*parent
,
241 const wxString
& title
,
244 const wxArrayString
& choices
,
247 const wxValidator
& val
,
248 const wxString
& name
)
250 wxCArrayString
chs(choices
);
251 return Create(parent
, id
, title
, pos
, size
, chs
.GetCount(),
252 chs
.GetStrings(), majorDim
, style
, val
, name
);
255 wxRadioBox::~wxRadioBox()
257 m_isBeingDeleted
= true;
259 delete m_radioButtons
;
261 DestroyWindow((HWND
)m_dummyHwnd
);
262 delete[] m_radioWidth
;
263 delete[] m_radioHeight
;
266 // NB: if this code is changed, wxGetWindowForHWND() which relies on having the
267 // radiobox pointer in GWL_USERDATA for radio buttons must be updated too!
268 void wxRadioBox::SubclassRadioButton(WXHWND hWndBtn
)
270 HWND hwndBtn
= (HWND
)hWndBtn
;
272 if ( !s_wndprocRadioBtn
)
273 s_wndprocRadioBtn
= (WXFARPROC
)wxGetWindowProc(hwndBtn
);
275 wxSetWindowProc(hwndBtn
, wxRadioBtnWndProc
);
276 wxSetWindowUserData(hwndBtn
, this);
279 // ----------------------------------------------------------------------------
281 // ----------------------------------------------------------------------------
283 bool wxRadioBox::MSWCommand(WXUINT cmd
, WXWORD id_
)
285 const int id
= (signed short)id_
;
287 if ( cmd
== BN_CLICKED
)
292 int selectedButton
= wxNOT_FOUND
;
294 const unsigned int count
= GetCount();
295 for ( unsigned int i
= 0; i
< count
; i
++ )
297 const HWND hwndBtn
= (*m_radioButtons
)[i
];
298 if ( id
== wxGetWindowId(hwndBtn
) )
300 // we can get BN_CLICKED for a button which just became focused
301 // but it may not be checked, in which case we shouldn't
302 // generate a radiobox selection changed event for it
303 if ( ::SendMessage(hwndBtn
, BM_GETCHECK
, 0, 0) == BST_CHECKED
)
310 if ( selectedButton
== wxNOT_FOUND
)
312 // just ignore it - due to a hack with WM_NCHITTEST handling in our
313 // wnd proc, we can receive dummy click messages when we click near
314 // the radiobox edge (this is ugly but Julian wouldn't let me get
319 if ( selectedButton
!= m_selectedButton
)
321 m_selectedButton
= selectedButton
;
323 SendNotificationEvent();
325 //else: don't generate events when the selection doesn't change
333 void wxRadioBox::Command(wxCommandEvent
& event
)
335 SetSelection (event
.GetInt());
337 ProcessCommand(event
);
340 void wxRadioBox::SendNotificationEvent()
342 wxCommandEvent
event(wxEVT_COMMAND_RADIOBOX_SELECTED
, m_windowId
);
343 event
.SetInt( m_selectedButton
);
344 event
.SetString(GetString(m_selectedButton
));
345 event
.SetEventObject( this );
346 ProcessCommand(event
);
349 // ----------------------------------------------------------------------------
351 // ----------------------------------------------------------------------------
353 unsigned int wxRadioBox::GetCount() const
355 return m_radioButtons
? m_radioButtons
->GetCount() : 0u;
358 void wxRadioBox::SetString(unsigned int item
, const wxString
& label
)
360 wxCHECK_RET( IsValid(item
), wxT("invalid radiobox index") );
363 m_radioHeight
[item
] = wxDefaultCoord
;
365 ::SetWindowText((*m_radioButtons
)[item
], label
.c_str());
367 InvalidateBestSize();
370 void wxRadioBox::SetSelection(int N
)
372 wxCHECK_RET( IsValid(N
), wxT("invalid radiobox index") );
374 // unselect the old button
375 if ( m_selectedButton
!= wxNOT_FOUND
)
376 ::SendMessage((*m_radioButtons
)[m_selectedButton
], BM_SETCHECK
, 0, 0L);
378 // and select the new one
379 ::SendMessage((*m_radioButtons
)[N
], BM_SETCHECK
, 1, 0L);
381 m_selectedButton
= N
;
384 // Find string for position
385 wxString
wxRadioBox::GetString(unsigned int item
) const
387 wxCHECK_MSG( IsValid(item
), wxEmptyString
,
388 wxT("invalid radiobox index") );
390 return wxGetWindowText((*m_radioButtons
)[item
]);
393 void wxRadioBox::SetFocus()
395 if ( GetCount() > 0 )
397 ::SetFocus((*m_radioButtons
)[m_selectedButton
== wxNOT_FOUND
399 : m_selectedButton
]);
403 // Enable a specific button
404 bool wxRadioBox::Enable(unsigned int item
, bool enable
)
406 wxCHECK_MSG( IsValid(item
), false,
407 wxT("invalid item in wxRadioBox::Enable()") );
409 BOOL ret
= ::EnableWindow((*m_radioButtons
)[item
], enable
);
411 return (ret
== 0) != enable
;
414 bool wxRadioBox::IsItemEnabled(unsigned int item
) const
416 wxCHECK_MSG( IsValid(item
), false,
417 wxT("invalid item in wxRadioBox::IsItemEnabled()") );
419 return ::IsWindowEnabled((*m_radioButtons
)[item
]) != 0;
422 // Show a specific button
423 bool wxRadioBox::Show(unsigned int item
, bool show
)
425 wxCHECK_MSG( IsValid(item
), false,
426 wxT("invalid item in wxRadioBox::Show()") );
428 BOOL ret
= ::ShowWindow((*m_radioButtons
)[item
], show
? SW_SHOW
: SW_HIDE
);
430 bool changed
= (ret
!= 0) != show
;
433 InvalidateBestSize();
439 bool wxRadioBox::IsItemShown(unsigned int item
) const
441 wxCHECK_MSG( IsValid(item
), false,
442 wxT("invalid item in wxRadioBox::IsItemShown()") );
444 // don't use IsWindowVisible() here because it would return false if the
445 // radiobox itself is hidden while we want to only return false if this
446 // button specifically is hidden
447 return (::GetWindowLong((*m_radioButtons
)[item
],
448 GWL_STYLE
) & WS_VISIBLE
) != 0;
453 bool wxRadioBox::HasToolTips() const
455 return wxStaticBox::HasToolTips() || wxRadioBoxBase::HasItemToolTips();
458 void wxRadioBox::DoSetItemToolTip(unsigned int item
, wxToolTip
*tooltip
)
460 // we have already checked for the item to be valid in wxRadioBoxBase
461 const HWND hwndRbtn
= (*m_radioButtons
)[item
];
462 if ( tooltip
!= NULL
)
463 tooltip
->Add(hwndRbtn
);
464 else // unset the tooltip
465 wxToolTip::Remove(hwndRbtn
);
468 #endif // wxUSE_TOOLTIPS
470 bool wxRadioBox::Reparent(wxWindowBase
*newParent
)
472 if ( !wxStaticBox::Reparent(newParent
) )
477 HWND hwndParent
= GetHwndOf(GetParent());
478 for ( size_t item
= 0; item
< m_radioButtons
->GetCount(); item
++ )
480 ::SetParent((*m_radioButtons
)[item
], hwndParent
);
483 // put static box under the buttons in the Z-order
484 SetWindowPos(GetHwnd(), HWND_BOTTOM
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
489 WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxRadioBox
, wxStaticBox
, m_radioButtons
)
491 // ----------------------------------------------------------------------------
493 // ----------------------------------------------------------------------------
495 wxSize
wxRadioBox::GetMaxButtonSize() const
497 // calculate the max button size
500 const unsigned int count
= GetCount();
501 for ( unsigned int i
= 0 ; i
< count
; i
++ )
504 if ( m_radioWidth
[i
] < 0 )
506 GetTextExtent(wxGetWindowText((*m_radioButtons
)[i
]), &width
, &height
);
508 // adjust the size to take into account the radio box itself
509 // FIXME this is totally bogus!
516 width
= m_radioWidth
[i
];
517 height
= m_radioHeight
[i
];
520 if ( widthMax
< width
)
522 if ( heightMax
< height
)
526 return wxSize(widthMax
, heightMax
);
529 wxSize
wxRadioBox::GetTotalButtonSize(const wxSize
& sizeBtn
) const
531 // the radiobox should be big enough for its buttons
533 wxGetCharSize(m_hWnd
, &cx1
, &cy1
, GetFont());
535 int extraHeight
= cy1
;
537 int height
= GetRowCount() * sizeBtn
.y
+ cy1
/2 + extraHeight
;
538 int width
= GetColumnCount() * (sizeBtn
.x
+ cx1
) + cx1
;
540 // Add extra space under the label, if it exists.
541 if (!wxControl::GetLabel().empty())
544 // and also wide enough for its label
546 GetTextExtent(GetLabelText(), &widthLabel
, NULL
);
547 widthLabel
+= RADIO_SIZE
; // FIXME this is bogus too
548 if ( widthLabel
> width
)
551 return wxSize(width
, height
);
554 wxSize
wxRadioBox::DoGetBestSize() const
556 if ( !m_radioButtons
)
558 // if we're not fully initialized yet, we can't meaningfully compute
559 // our best size, we'll do it later
563 wxSize best
= GetTotalButtonSize(GetMaxButtonSize());
568 // Restored old code.
569 void wxRadioBox::DoSetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
571 int currentX
, currentY
;
572 GetPosition(¤tX
, ¤tY
);
573 int widthOld
, heightOld
;
574 GetSize(&widthOld
, &heightOld
);
579 if (x
== wxDefaultCoord
&& !(sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
581 if (y
== wxDefaultCoord
&& !(sizeFlags
& wxSIZE_ALLOW_MINUS_ONE
))
588 wxGetCharSize(m_hWnd
, &cx1
, &cy1
, GetFont());
590 // Attempt to have a look coherent with other platforms: We compute the
591 // biggest toggle dim, then we align all items according this value.
592 wxSize maxSize
= GetMaxButtonSize();
593 int maxWidth
= maxSize
.x
,
594 maxHeight
= maxSize
.y
;
596 wxSize totSize
= GetTotalButtonSize(maxSize
);
597 int totWidth
= totSize
.x
,
598 totHeight
= totSize
.y
;
600 // only change our width/height if asked for
601 if ( width
== wxDefaultCoord
)
603 if ( sizeFlags
& wxSIZE_AUTO_WIDTH
)
609 if ( height
== wxDefaultCoord
)
611 if ( sizeFlags
& wxSIZE_AUTO_HEIGHT
)
617 DoMoveWindow(xx
, yy
, width
, height
);
619 // Now position all the buttons: the current button will be put at
620 // wxPoint(x_offset, y_offset) and the new row/column will start at
621 // startX/startY. The size of all buttons will be the same wxSize(maxWidth,
622 // maxHeight) except for the buttons in the last column which should extend
623 // to the right border of radiobox and thus can be wider than this.
625 // Also, remember that wxRA_SPECIFY_COLS means that we arrange buttons in
626 // left to right order and GetMajorDim() is the number of columns while
627 // wxRA_SPECIFY_ROWS means that the buttons are arranged top to bottom and
628 // GetMajorDim() is the number of rows.
633 // Add extra space under the label, if it exists.
634 if (!wxControl::GetLabel().empty())
637 int startX
= x_offset
;
638 int startY
= y_offset
;
640 const unsigned int count
= GetCount();
641 for (unsigned int i
= 0; i
< count
; i
++)
643 // the last button in the row may be wider than the other ones as the
644 // radiobox may be wider than the sum of the button widths (as it
645 // happens, for example, when the radiobox label is very long)
647 if ( m_windowStyle
& wxRA_SPECIFY_COLS
)
649 // item is the last in its row if it is a multiple of the number of
650 // columns or if it is just the last item
651 unsigned int n
= i
+ 1;
652 isLastInTheRow
= ((n
% GetMajorDim()) == 0) || (n
== count
);
654 else // wxRA_SPECIFY_ROWS
656 // item is the last in the row if it is in the last columns
657 isLastInTheRow
= i
>= (count
/GetMajorDim())*GetMajorDim();
660 // is this the start of new row/column?
661 if ( i
&& (i
% GetMajorDim() == 0) )
663 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
665 // start of new column
667 x_offset
+= maxWidth
+ cx1
;
669 else // start of new row
672 y_offset
+= maxHeight
;
673 if (m_radioWidth
[0]>0)
679 if ( isLastInTheRow
)
681 // make the button go to the end of radio box
682 widthBtn
= startX
+ width
- x_offset
- 2*cx1
;
683 if ( widthBtn
< maxWidth
)
688 // normal button, always of the same size
692 // make all buttons of the same, maximal size - like this they cover
693 // the radiobox entirely and the radiobox tooltips are always shown
694 // (otherwise they are not when the mouse pointer is in the radiobox
695 // part not belonging to any radiobutton)
696 DoMoveSibling((*m_radioButtons
)[i
], x_offset
, y_offset
, widthBtn
, maxHeight
);
698 // where do we put the next button?
699 if ( m_windowStyle
& wxRA_SPECIFY_ROWS
)
702 y_offset
+= maxHeight
;
703 if (m_radioWidth
[0]>0)
708 // to the right of this one
709 x_offset
+= widthBtn
+ cx1
;
714 int wxRadioBox::GetItemFromPoint(const wxPoint
& pt
) const
716 const unsigned int count
= GetCount();
717 for ( unsigned int i
= 0; i
< count
; i
++ )
719 RECT rect
= wxGetWindowRect((*m_radioButtons
)[i
]);
721 if ( rect
.left
<= pt
.x
&& pt
.x
< rect
.right
&&
722 rect
.top
<= pt
.y
&& pt
.y
< rect
.bottom
)
731 // ----------------------------------------------------------------------------
733 // ----------------------------------------------------------------------------
737 WXHRGN
wxRadioBox::MSWGetRegionWithoutChildren()
740 ::GetWindowRect(GetHwnd(), &rc
);
741 HRGN hrgn
= ::CreateRectRgn(rc
.left
, rc
.top
, rc
.right
+ 1, rc
.bottom
+ 1);
743 const unsigned int count
= GetCount();
744 for ( unsigned int i
= 0; i
< count
; ++i
)
746 // don't clip out hidden children
747 if ( !IsItemShown(i
) )
750 ::GetWindowRect((*m_radioButtons
)[i
], &rc
);
751 AutoHRGN
hrgnchild(::CreateRectRgnIndirect(&rc
));
752 ::CombineRgn(hrgn
, hrgn
, hrgnchild
, RGN_DIFF
);
758 #endif // __WXWINCE__
760 // ---------------------------------------------------------------------------
761 // window proc for radio buttons
762 // ---------------------------------------------------------------------------
764 LRESULT APIENTRY _EXPORT
wxRadioBtnWndProc(HWND hwnd
,
772 // we must tell IsDialogMessage()/our kbd processing code that we
773 // want to process arrows ourselves because neither of them is
774 // smart enough to handle arrows properly for us
776 long lDlgCode
= ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn
, hwnd
,
777 message
, wParam
, lParam
);
779 return lDlgCode
| DLGC_WANTARROWS
;
784 wxRadioBox
*radiobox
= (wxRadioBox
*)wxGetWindowUserData(hwnd
);
786 wxCHECK_MSG( radiobox
, 0, wxT("radio button without radio box?") );
788 bool processed
= true;
812 // just to suppress the compiler warning
818 int selOld
= radiobox
->GetSelection();
819 int selNew
= radiobox
->GetNextItem
823 radiobox
->GetWindowStyle()
826 if ( selNew
!= selOld
)
828 radiobox
->SetSelection(selNew
);
829 radiobox
->SetFocus();
831 // emulate the button click
832 radiobox
->SendNotificationEvent();
843 wxRadioBox
*radiobox
= (wxRadioBox
*)wxGetWindowUserData(hwnd
);
845 wxCHECK_MSG( radiobox
, 0, wxT("radio button without radio box?") );
847 // if we don't do this, no focus events are generated for the
848 // radiobox and, besides, we need to notify the parent about
849 // the focus change, otherwise the focus handling logic in
850 // wxControlContainer doesn't work
851 if ( message
== WM_SETFOCUS
)
852 radiobox
->HandleSetFocus((WXHWND
)wParam
);
854 radiobox
->HandleKillFocus((WXHWND
)wParam
);
861 wxRadioBox
*radiobox
= (wxRadioBox
*)wxGetWindowUserData(hwnd
);
863 wxCHECK_MSG( radiobox
, 0, wxT("radio button without radio box?") );
865 bool processed
= false;
867 wxEvtHandler
* const handler
= radiobox
->GetEventHandler();
869 HELPINFO
* info
= (HELPINFO
*) lParam
;
870 if ( info
->iContextType
== HELPINFO_WINDOW
)
872 for ( wxWindow
* subjectOfHelp
= radiobox
;
874 subjectOfHelp
= subjectOfHelp
->GetParent() )
876 wxHelpEvent
helpEvent(wxEVT_HELP
,
877 subjectOfHelp
->GetId(),
878 wxPoint(info
->MousePos
.x
,
880 helpEvent
.SetEventObject(radiobox
);
881 if ( handler
->ProcessEvent(helpEvent
) )
888 else if (info
->iContextType
== HELPINFO_MENUITEM
)
890 wxHelpEvent
helpEvent(wxEVT_HELP
, info
->iCtrlId
);
891 helpEvent
.SetEventObject(radiobox
);
892 processed
= handler
->ProcessEvent(helpEvent
);
899 #endif // !__WXWINCE__
902 return ::CallWindowProc(CASTWNDPROC s_wndprocRadioBtn
, hwnd
, message
, wParam
, lParam
);
905 #endif // wxUSE_RADIOBOX