/////////////////////////////////////////////////////////////////////////////
-// Name: radiobut.cpp
+// Name: src/os2/radiobut.cpp
// Purpose: wxRadioButton
// Author: David Webster
// Modified by:
#endif
#ifndef WX_PRECOMP
-#include <stdio.h>
-#include "wx/setup.h"
-#include "wx/radiobut.h"
-#include "wx/brush.h"
-#include "wx/dcscreen.h"
-#include "wx/settings.h"
+ #include <stdio.h>
+ #include "wx/radiobut.h"
+ #include "wx/brush.h"
+ #include "wx/dcscreen.h"
+ #include "wx/settings.h"
#endif
#include "wx/os2/private.h"
wxSize wxRadioButton::DoGetBestSize() const
{
- static int snRadioSize = 0;
+ // We should probably compute snRadioSize but it seems to be a constant
+ // independent of its label's font size and not made available by OS/2.
+ static int snRadioSize = RADIO_SIZE;
- if (!snRadioSize)
- {
- wxScreenDC vDC;
-
- vDC.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
- snRadioSize = vDC.GetCharHeight();
- }
-
- wxString sStr = GetLabel();
+ wxString sStr = wxGetWindowText(GetHwnd());
int nRadioWidth;
int nRadioHeight;
,&nRadioWidth
,&nRadioHeight
);
- nRadioWidth += snRadioSize + GetCharWidth();
+ nRadioWidth += snRadioSize;
if (nRadioHeight < snRadioSize)
nRadioHeight = snRadioSize;
}