+bool wxRadioBox::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxString& rsTitle,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ int nNum,
+ const wxString asChoices[],
+ int nMajorDim,
+ long lStyle,
+ const wxValidator& rVal,
+ const wxString& rsName )
+{
+ wxColour vColour(*wxBLACK);
+ LONG lColor;
+ HWND hWndParent = GetHwndOf(pParent);
+
+ m_backgroundColour = pParent->GetBackgroundColour();
+ m_nSelectedButton = -1;
+ m_nNoItems = 0;
+
+ //
+ // Common initialization
+ //
+ if (!CreateControl( pParent
+ ,vId
+ ,rPos
+ ,rSize
+ ,lStyle
+ ,rVal
+ ,rsName
+ ))
+ return false;
+ if (!OS2CreateControl( wxT("STATIC")
+ ,SS_GROUPBOX
+ ,rPos
+ ,rSize
+ ,rsTitle
+ ))
+ return false;
+
+ wxAssociateWinWithHandle(m_hWnd, this);
+
+ //
+ // Now we can set m_nNoItems and let SetMajorDim set m_numCols/m_numRows
+ //
+ m_nNoItems = (unsigned int)nNum;
+ SetMajorDim(nMajorDim == 0 ? nNum : nMajorDim, lStyle);
+
+ 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_VISIBLE;
+ int nNewId = NewControlId();
+
+ if (i == 0)
+ lStyleBtn |= WS_GROUP | WS_TABSTOP;
+
+ wxString sLabel = ::wxPMTextToLabel(asChoices[i]);
+
+ HWND hWndBtn = (WXHWND)::WinCreateWindow ( hWndParent,
+ WC_BUTTON,
+ sLabel.c_str(),
+ lStyleBtn,
+ 0, 0, 0, 0,
+ hWndParent,
+ HWND_BOTTOM,
+ (HMENU)nNewId,
+ NULL,
+ NULL
+ );
+ if (!hWndBtn)