+ wxColour vColour;
+ LONG lColor;
+
+ vColour.Set(wxString("BLACK"));
+ m_backgroundColour = pParent->GetBackgroundColour();
+ m_nSelectedButton = -1;
+ m_nNoItems = 0;
+
+ m_nMajorDim = nMajorDim == 0 ? nNum : nMajorDim;
+ m_nNoRowsOrCols = nMajorDim;
+
+ //
+ // Common initialization
+ //
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+ ,rVal
+ ,rsName
+ ))
+ return false;
+ if (!OS2CreateControl( "STATIC"
+ ,SS_GROUPBOX
+ ,rPos
+ ,rSize
+ ,rsTitle
+ ))
+ return false;
+
+ wxAssociateWinWithHandle(m_hWnd, this);
+
+ //
+ // Some radio boxes test consecutive id.
+ //
+ m_nNoItems = nNum;
+ (void)NewControlId();
+ m_ahRadioButtons = new WXHWND[nNum];
+ m_pnRadioWidth = new int[nNum];
+ m_pnRadioHeight = new int[nNum];
+
+ 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);
+ wxAssociateWinWithHandle(hWndBtn, this);
+ wxOS2SetFont( hWndBtn
+ ,*wxSMALL_FONT
+ );
+ ::WinSetWindowULong(hWndBtn, QWL_USER, (ULONG)this);
+ m_aSubControls.Add(nNewId);
+ }