X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0b5881aeaef69976ed1693ab0423187a8bcd53c..2e771cb838a8d22a73d5316e9fecde25ede316a4:/src/msw/radiobut.cpp?ds=sidebyside diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 5196c0ba05..134a81dfe2 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -290,6 +290,13 @@ wxSize wxRadioButton::DoGetBestSize() const dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); s_radioSize = dc.GetCharHeight(); + + // radio button bitmap size under CE is bigger than the font height, + // adding just one pixel seems to work fine for the default font but it + // would be nice to find some better way to find the correct height +#ifdef __WXWINCE__ + s_radioSize++; +#endif // __WXWINCE__ } wxString str = GetLabel(); @@ -297,7 +304,7 @@ wxSize wxRadioButton::DoGetBestSize() const int wRadio, hRadio; if ( !str.empty() ) { - GetTextExtent(wxStripMenuCodes(str), &wRadio, &hRadio); + GetTextExtent(GetLabelText(str), &wRadio, &hRadio); wRadio += s_radioSize + GetCharWidth(); if ( hRadio < s_radioSize ) @@ -314,4 +321,14 @@ wxSize wxRadioButton::DoGetBestSize() const return best; } +WXDWORD wxRadioButton::MSWGetStyle(long style, WXDWORD *exstyle) const +{ + WXDWORD styleMSW = wxControl::MSWGetStyle(style, exstyle); + + if ( style & wxRB_GROUP ) + styleMSW |= WS_GROUP; + + return styleMSW; +} + #endif // wxUSE_RADIOBTN