HWND hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
,WC_BUTTON
- ,(PSZ)asChoices[i].c_str()
+ ,::wxPMTextToLabel(asChoices[i])
,lStyleBtn
,0, 0, 0, 0
,GetWinHwnd(pParent)
//
// Create a dummy radio control to end the group.
//
- (void)::WinCreateWindow ( GetHwndOf(pParent)
- ,WC_BUTTON
- ,""
- ,WS_GROUP | BS_AUTORADIOBUTTON
- ,0, 0, 0, 0
- ,GetWinHwnd(pParent)
- ,HWND_TOP
- ,(HMENU)NewControlId()
- ,NULL
- ,NULL
+ (void)::WinCreateWindow ( GetHwndOf(pParent),
+ WC_BUTTON,
+ "",
+ WS_GROUP | BS_AUTORADIOBUTTON,
+ 0, 0, 0, 0,
+ GetWinHwnd(pParent),
+ HWND_TOP,
+ (HMENU)NewControlId(),
+ NULL,
+ NULL
);
SetFont(*wxSMALL_FONT);
fnWndProcRadioBox = (WXFARPROC)::WinSubclassWindow( GetHwnd()
return m_nSelectedButton;
} // end of wxRadioBox::GetSelection
-void wxRadioBox::GetSize(
- int* pnWidth
-, int* pnHeight
-) const
+void wxRadioBox::GetSize( int* pnWidth, int* pnHeight ) const
{
RECT vRect;
int i;
{
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( GetTitle()
- ,&nWidthLabel
- ,NULL
- );
- nWidthLabel += RADIO_SIZE;
+ wxString sStr = wxGetWindowText(GetHwnd());
+ if (!sStr.IsEmpty())
+ {
+ GetTextExtent( sStr
+ ,&nWidthLabel
+ ,NULL
+ );
+ nWidthLabel += 2*nCx1;
+ }
if (nWidthLabel > nWidth)
nWidth = nWidthLabel;
);
} // end of wxRadioBtnWndProc
-MRESULT EXPENTRY wxRadioBoxWndProc(
- HWND hWnd
-, UINT uMessage
-, MPARAM wParam
-, MPARAM lParam
-)
+MRESULT EXPENTRY wxRadioBoxWndProc( HWND hWnd,
+ UINT uMessage,
+ MPARAM wParam,
+ MPARAM lParam )
{
- return (fnWndProcRadioBox( hWnd
- ,(ULONG)uMessage
- ,(MPARAM)wParam
- ,(MPARAM)lParam
- )
+ return (fnWndProcRadioBox( hWnd,
+ (ULONG)uMessage,
+ (MPARAM)wParam,
+ (MPARAM)lParam )
);
} // end of wxRadioBoxWndProc