+ vColour.Set(wxString("BLACK"));
+ lColor = (LONG)vColour.GetPixel();
+ m_nSelectedButton = -1;
+ m_nNoItems = nNum;
+
+ m_nMajorDim = nMajorDim == 0 ? nNum : nMajorDim;
+ m_nNoRowsOrCols = nMajorDim;
+
+ //
+ // Common initialization
+ //
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+#if wxUSE_VALIDATORS
+ ,rVal
+#endif
+ ,rsName
+ ))
+
+
+
+
+ if (!OS2CreateControl( "STATIC"
+#if RADIOBTN_PARENT_IS_RADIOBOX
+ ,SS_GROUPBOX | WS_GROUP | WS_CLIPCHILDREN
+#else
+ ,SS_GROUPBOX | WS_GROUP | WS_CLIPSIBLINGS
+#endif
+ ,rPos
+ ,rSize
+ ,rsTitle
+ ))
+
+#if RADIOBTN_PARENT_IS_RADIOBOX
+ HWND hWndParent = GetHwnd();
+#else
+ HWND hWndParent = GetHwndOf(pParent);
+#endif
+ HFONT hFont;
+
+ //
+ // Some radio boxes test consecutive id.
+ //
+ (void)NewControlId();
+ m_ahRadioButtons = new WXHWND[nNum];
+ m_pnRadioWidth = new int[nNum];
+ m_pnRadioHeight = new int[nNum];
+
+ if (pTextFont->Ok())
+ {
+ hFont = pTextFont->GetResourceHandle();
+ }
+
+ for (int i = 0; i < nNum; i++)
+ {
+ m_pnRadioWidth[i] = m_pnRadioHeight[i] = -1;
+
+ long lStyleBtn = BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE;
+ int nNewId = NewControlId();
+
+ if (i == 0 && lStyle == 0)
+ lStyleBtn |= WS_GROUP;
+
+ HWND hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
+ ,WC_BUTTON
+ ,asChoices[i]
+ ,lStyleBtn
+ ,0, 0, 0, 0
+ ,GetWinHwnd(pParent)
+ ,HWND_TOP
+ ,(HMENU)nNewId
+ ,NULL
+ ,NULL
+ );
+ lColor = (LONG)vColour.GetPixel();
+ ::WinSetPresParam( hWndBtn
+ ,PP_FOREGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+ lColor = (LONG)m_backgroundColour.GetPixel();
+
+ ::WinSetPresParam( hWndBtn
+ ,PP_BACKGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+ if (!hWndBtn)
+ {
+ return FALSE;
+ }
+ m_ahRadioButtons[i] = (WXHWND)hWndBtn;
+ SubclassRadioButton((WXHWND)hWndBtn);
+ wxOS2SetFont( hWndBtn
+ ,*pTextFont
+ );
+ ::WinSetWindowULong(hWndBtn, QWL_USER, (ULONG)this);
+ m_aSubControls.Add(nNewId);
+ }
+
+ //
+ // Create a dummy radio control to end the group.
+ //
+ (void)::WinCreateWindow ( GetHwndOf(pParent)
+ ,WC_BUTTON
+ ,""
+ ,WS_GROUP | BS_AUTORADIOBUTTON
+ ,0, 0, 0, 0
+ ,GetWinHwnd(pParent)
+ ,HWND_TOP
+ ,(HMENU)NewControlId()
+ ,NULL
+ ,NULL
+ );
+ SetFont(*pTextFont);
+ lColor = (LONG)vColour.GetPixel();
+ ::WinSetPresParam( m_hWnd
+ ,PP_FOREGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+ lColor = (LONG)m_backgroundColour.GetPixel();
+
+ ::WinSetPresParam( m_hWnd
+ ,PP_BACKGROUNDCOLOR
+ ,sizeof(LONG)
+ ,(PVOID)&lColor
+ );
+ SetSelection(0);
+ SetSize( rPos.x
+ ,rPos.y
+ ,rSize.x
+ ,rSize.y
+ );
+ delete pTextFont;
+ return TRUE;
+} // end of wxRadioBox::Create
+
+wxSize wxRadioBox::DoGetBestSize() const