X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6670f56440ae9209b3e2e51e06acf3bc5aaf1905..c56ae04274fda26269c6d06be34cf59a45eb70ce:/src/os2/radiobut.cpp diff --git a/src/os2/radiobut.cpp b/src/os2/radiobut.cpp index 61fd55f4b0..6d6376cde7 100644 --- a/src/os2/radiobut.cpp +++ b/src/os2/radiobut.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: radiobut.cpp +// Name: src/os2/radiobut.cpp // Purpose: wxRadioButton // Author: David Webster // Modified by: @@ -17,12 +17,11 @@ #endif #ifndef WX_PRECOMP -#include -#include "wx/setup.h" -#include "wx/radiobut.h" -#include "wx/brush.h" -#include "wx/dcscreen.h" -#include "wx/settings.h" + #include + #include "wx/radiobut.h" + #include "wx/brush.h" + #include "wx/dcscreen.h" + #include "wx/settings.h" #endif #include "wx/os2/private.h" @@ -111,17 +110,11 @@ bool wxRadioButton::Create( 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; @@ -131,7 +124,7 @@ wxSize wxRadioButton::DoGetBestSize() const ,&nRadioWidth ,&nRadioHeight ); - nRadioWidth += snRadioSize + GetCharWidth(); + nRadioWidth += snRadioSize; if (nRadioHeight < snRadioSize) nRadioHeight = snRadioSize; }