+void wxRadioButton::Command ( wxCommandEvent& rEvent )
+{
+ SetValue ((rEvent.GetInt() != 0) );
+ ProcessCommand (rEvent);
+} // end of wxRadioButton::Command
+
+bool wxRadioButton::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& rsLabel,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxValidator& rValidator,
+ const wxString& rsName )
+{
+ if ( !CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+ ,rValidator
+ ,rsName))
+ return false;
+
+ long lSstyle = WS_TABSTOP;
+
+ if (HasFlag(wxRB_GROUP))
+ lSstyle |= WS_GROUP;
+
+ //
+ // wxRB_SINGLE is a temporary workaround for the following problem: if you
+ // have 2 radiobuttons in the same group but which are not consecutive in
+ // the dialog, Windows can enter an infinite loop! The simplest way to
+ // reproduce it is to create radio button, then a panel and then another
+ // radio button: then checking the last button hangs the app.
+ //
+ // Ideally, we'd detect (and avoid) such situation automatically but for
+ // now, as I don't know how to do it, just allow the user to create
+ // BS_RADIOBUTTON buttons for such situations.
+ //
+ lSstyle |= HasFlag(wxRB_SINGLE) ? BS_RADIOBUTTON : BS_AUTORADIOBUTTON;
+
+ if (HasFlag(wxCLIP_SIBLINGS))
+ lSstyle |= WS_CLIPSIBLINGS;
+
+ if (!OS2CreateControl( _T("BUTTON")
+ ,lSstyle
+ ,rPos
+ ,rSize
+ ,rsLabel
+ ,0
+ ))
+ return false;
+
+ wxAssociateWinWithHandle(m_hWnd, this);
+ if (HasFlag(wxRB_GROUP))
+ SetValue(true);
+
+ SetFont(*wxSMALL_FONT);
+ SetSize( rPos.x, rPos.y, rSize.x, rSize.y );
+ return true;
+} // end of wxRadioButton::Create
+
+wxSize wxRadioButton::DoGetBestSize() const
+{
+ // We should probably compute snRadioSize but it seems to be a constant
+ // independent of its label's font size and not made available by OS/2.
+ static int snRadioSize = RADIO_SIZE;