]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/radiobut.cpp
added SetDoubleBuffered() (patch 1491093)
[wxWidgets.git] / src / os2 / radiobut.cpp
index 61fd55f4b0237fc28adf0bd0a35ced3dcabe278c..6d6376cde7a5ecbd2632a193c3e21a5272119a14 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// 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"
@@ -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;
     }