X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/743e24aa72ed41a56884698802e3b31ca9f26b31..a55d039a23c730975a8b5efedab6b4940fb4009b:/src/os2/radiobox.cpp diff --git a/src/os2/radiobox.cpp b/src/os2/radiobox.cpp index 0a2a31fde1..b379cd3724 100644 --- a/src/os2/radiobox.cpp +++ b/src/os2/radiobox.cpp @@ -337,7 +337,7 @@ bool wxRadioBox::Create( HWND hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent) ,WC_BUTTON - ,(PSZ)asChoices[i].c_str() + ,::wxPMTextToLabel(asChoices[i]) ,lStyleBtn ,0, 0, 0, 0 ,GetWinHwnd(pParent) @@ -873,23 +873,27 @@ wxSize wxRadioBox::GetTotalButtonSize( const wxSize& rSizeBtn ) const { int nCx1; int nCy1; - int nExtraHeight; int nHeight; int nWidth; - int nWidthLabel; - wxFont vFont = GetFont(); - - wxGetCharSize( m_hWnd, &nCx1, &nCy1, &vFont ); - nExtraHeight = nCy1; + int nWidthLabel = 0; + nCx1 = GetCharWidth(); + nCy1 = GetCharHeight(); nHeight = GetNumVer() * rSizeBtn.y + (2 * nCy1); nWidth = GetNumHor() * (rSizeBtn.x + nCx1) + nCx1; // // And also wide enough for its label // - GetTextExtent( GetLabel(), &nWidthLabel, NULL ); - nWidthLabel += RADIO_SIZE; + wxString sStr = wxGetWindowText(GetHwnd()); + if (!sStr.IsEmpty()) + { + GetTextExtent( sStr + ,&nWidthLabel + ,NULL + ); + nWidthLabel += 2*nCx1; + } if (nWidthLabel > nWidth) nWidth = nWidthLabel;