]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/radiobox.cpp
Output deprecated warning for --rezflags and permanently disable it.
[wxWidgets.git] / src / os2 / radiobox.cpp
index af010f9576a6c27f29031397a56818232df0878a..b379cd372474b01f5c90c2be2c07a34ceb8f505d 100644 (file)
@@ -337,7 +337,7 @@ bool wxRadioBox::Create(
 
         HWND                        hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
                                                                          ,WC_BUTTON
-                                                                         ,(PSZ)asChoices[i].c_str()
+                                                                         ,::wxPMTextToLabel(asChoices[i])
                                                                          ,lStyleBtn
                                                                          ,0, 0, 0, 0
                                                                          ,GetWinHwnd(pParent)
@@ -376,16 +376,16 @@ bool wxRadioBox::Create(
     //
     // 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()
@@ -824,10 +824,7 @@ int wxRadioBox::GetSelection() const
     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;
@@ -876,26 +873,27 @@ wxSize wxRadioBox::GetTotalButtonSize( const wxSize& rSizeBtn ) const
 {
     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;
 
@@ -1184,17 +1182,14 @@ MRESULT wxRadioBtnWndProc(
                             );
 } // 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