+
+ // Create a dummy radio control to end the group.
+ m_dummyId = NewControlId();
+
+ m_dummyHwnd = (WXHWND)::CreateWindow(wxT("BUTTON"),
+ wxEmptyString,
+ WS_GROUP | BS_AUTORADIOBUTTON | WS_CHILD,
+ 0, 0, 0, 0, GetHwndOf(parent),
+ (HMENU)wxUIntToPtr(m_dummyId.GetValue()),
+ wxGetInstance(), NULL);
+
+
+ m_radioButtons->SetFont(GetFont());
+
+#ifdef __WXWINCE__
+ // Set the z-order correctly
+ SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
+#endif
+
+ SetMajorDim(majorDim == 0 ? n : majorDim, style);
+ SetSelection(0);
+ SetSize(pos.x, pos.y, size.x, size.y);
+
+ // Now that we have items determine what is the best size and set it.
+ SetInitialSize(size);
+
+ // And update all the buttons positions to match it.
+ const wxSize actualSize = GetSize();
+ PositionAllButtons(pos.x, pos.y, actualSize.x, actualSize.y);
+
+ return true;
+}
+
+bool wxRadioBox::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& title,
+ const wxPoint& pos,
+ const wxSize& size,
+ const wxArrayString& choices,
+ int majorDim,
+ long style,
+ const wxValidator& val,
+ const wxString& name)
+{
+ wxCArrayString chs(choices);
+ return Create(parent, id, title, pos, size, chs.GetCount(),
+ chs.GetStrings(), majorDim, style, val, name);
+}
+
+wxRadioBox::~wxRadioBox()
+{
+ SendDestroyEvent();
+
+ // Unsubclass all the radio buttons and remove their soon-to-be-invalid
+ // HWNDs from the global map. Notice that we need to unsubclass because
+ // otherwise we'd need the entries in gs_boxFromButton for the buttons
+ // being deleted to handle the messages generated during their destruction.
+ for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ )