X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/117f566fcc2282f8dc6e96aa95d76b34ec9e3540..c585ccef9cc010d0557a17998f3d5a4c286de537:/src/msw/radiobox.cpp?ds=sidebyside diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 4fc2d2acbd..26519adcbb 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -150,6 +150,11 @@ bool wxRadioBox::Create(wxWindow *parent, if ( !wxStaticBox::Create(parent, id, title, pos, size, style, name) ) return false; + // the code elsewhere in this file supposes that either wxRA_SPECIFY_COLS + // or wxRA_SPECIFY_ROWS is set, ensure that this is indeed the case + if ( !(style & (wxRA_SPECIFY_ROWS | wxRA_SPECIFY_COLS)) ) + style |= wxRA_SPECIFY_COLS; + #if wxUSE_VALIDATORS SetValidator(val); #else @@ -183,7 +188,7 @@ bool wxRadioBox::Create(wxWindow *parent, styleBtn, 0, 0, 0, 0, // will be set in SetSize() GetHwndOf(parent), - (HMENU)subid.GetValue(), + (HMENU)wxUIntToPtr(subid.GetValue()), wxGetInstance(), NULL); @@ -210,7 +215,8 @@ bool wxRadioBox::Create(wxWindow *parent, wxEmptyString, WS_GROUP | BS_AUTORADIOBUTTON | WS_CHILD, 0, 0, 0, 0, GetHwndOf(parent), - (HMENU)m_dummyId.GetValue(), wxGetInstance(), NULL); + (HMENU)wxUIntToPtr(m_dummyId.GetValue()), + wxGetInstance(), NULL); m_radioButtons->SetFont(GetFont()); @@ -461,6 +467,25 @@ void wxRadioBox::DoSetItemToolTip(unsigned int item, wxToolTip *tooltip) #endif // wxUSE_TOOLTIPS +bool wxRadioBox::Reparent(wxWindowBase *newParent) +{ + if ( !wxStaticBox::Reparent(newParent) ) + { + return false; + } + + HWND hwndParent = GetHwndOf(GetParent()); + for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ ) + { + ::SetParent((*m_radioButtons)[item], hwndParent); + } +#ifdef __WXWINCE__ + // put static box under the buttons in the Z-order + SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); +#endif + return true; +} + WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxRadioBox, wxStaticBox, m_radioButtons) // ----------------------------------------------------------------------------