X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7ee21e3a3dd028502ef81f832a24a049a0734f2b..3eabbbcc5d6a3dc2395a48eeed3da4bc894f644b:/src/msw/radiobox.cpp diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index de869045c1..e7dd3514a6 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -203,7 +203,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowIDRef subid = NewControlId(); HWND hwndBtn = ::CreateWindow(wxT("BUTTON"), - choices[i].wx_str(), + choices[i].t_str(), styleBtn, 0, 0, 0, 0, // will be set in SetSize() GetHwndOf(parent), @@ -252,6 +252,10 @@ bool wxRadioBox::Create(wxWindow *parent, // 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; } @@ -494,7 +498,7 @@ void wxRadioBox::DoSetItemToolTip(unsigned int item, wxToolTip *tooltip) // we have already checked for the item to be valid in wxRadioBoxBase const HWND hwndRbtn = (*m_radioButtons)[item]; if ( tooltip != NULL ) - tooltip->Add(hwndRbtn); + tooltip->AddOtherWindow(hwndRbtn); else // unset the tooltip wxToolTip::Remove(hwndRbtn, 0, wxRect(0,0,0,0)); // the second parameter can be zero since it's ignored by Remove() @@ -625,6 +629,12 @@ void wxRadioBox::DoMoveWindow(int x, int y, int width, int height) { wxStaticBox::DoMoveWindow(x, y, width, height); + PositionAllButtons(x, y, width, height); +} + +void +wxRadioBox::PositionAllButtons(int x, int y, int width, int WXUNUSED(height)) +{ wxSize maxSize = GetMaxButtonSize(); int maxWidth = maxSize.x, maxHeight = maxSize.y;