HWND hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
,WC_BUTTON
- ,(PSZ)asChoices[i].c_str()
+ ,::wxPMTextToLabel(asChoices[i])
,lStyleBtn
,0, 0, 0, 0
,GetWinHwnd(pParent)
{
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;