]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/radiobox.cpp
IsEmpty to empty change, warning fix to OW, whitespaces cleaning.
[wxWidgets.git] / src / os2 / radiobox.cpp
index b0d640ae17bd697d25a93df04a38397484b16344..283fd9cdbf01aa6ed025f887d83558990566a644 100644 (file)
@@ -107,13 +107,12 @@ void wxRadioBox::AdjustButtons(
     int                             nStartY;
     int                             nMaxWidth;
     int                             nMaxHeight;
-    int                             nTotWidth;
-    int                             nTotHeight;
+    wxFont                          vFont = GetFont();
 
     wxGetCharSize( m_hWnd
                   ,&nCx1
                   ,&nCy1
-                  ,&GetFont()
+                  ,&vFont
                  );
     vMaxSize   = GetMaxButtonSize();
     nMaxWidth  = vMaxSize.x;
@@ -253,6 +252,25 @@ bool wxRadioBox::ContainsHWND(
     return FALSE;
 } // end of wxRadioBox::ContainsHWND
 
+bool wxRadioBox::Create(
+  wxWindow*                         pParent
+, wxWindowID                        vId
+, const wxString&                   rsTitle
+, const wxPoint&                    rPos
+, const wxSize&                     rSize
+, const wxArrayString&              asChoices
+, int                               nMajorDim
+, long                              lStyle
+, const wxValidator&                rVal
+, const wxString&                   rsName
+)
+{
+    wxCArrayString chs(asChoices);
+
+    return Create(pParent, vId, rsTitle, rPos, rSize, chs.GetCount(),
+                  chs.GetStrings(), nMajorDim, lStyle, rVal, rsName);
+}
+
 bool wxRadioBox::Create(
   wxWindow*                         pParent
 , wxWindowID                        vId
@@ -299,12 +317,6 @@ bool wxRadioBox::Create(
         return FALSE;
 
     wxAssociateWinWithHandle(m_hWnd, this);
-#if RADIOBTN_PARENT_IS_RADIOBOX
-    HWND                            hWndParent = GetHwnd();
-#else
-    HWND                            hWndParent = GetHwndOf(pParent);
-#endif
-    HFONT                           hFont;
 
     //
     // Some radio boxes test consecutive id.
@@ -452,6 +464,7 @@ void wxRadioBox::DoSetSize(
     int                             nTotHeight;
     int                             nStartX;
     int                             nStartY;
+    wxFont                          vFont = GetFont();
 
     m_nSizeFlags = nSizeFlags;
     GetPosition( &nCurrentX
@@ -473,7 +486,7 @@ void wxRadioBox::DoSetSize(
     wxGetCharSize( m_hWnd
                   ,&nCx1
                   ,&nCy1
-                  ,&GetFont()
+                  ,&vFont
                  );
 
     //
@@ -857,8 +870,10 @@ void wxRadioBox::GetSize(
                       ,&vRect
                      );
 
-    *pnWidth  = vRect.xRight - vRect.xLeft;
-    *pnHeight = vRect.yBottom - vRect.yTop;
+    if (pnWidth)
+        *pnWidth  = vRect.xRight - vRect.xLeft;
+    if (pnHeight)
+        *pnHeight = vRect.yTop - vRect.yBottom;
 } // end of wxRadioBox::GetSize
 
 // Find string for position
@@ -890,11 +905,12 @@ wxSize wxRadioBox::GetTotalButtonSize(
     int                             nHeight;
     int                             nWidth;
     int                             nWidthLabel;
+    wxFont                          vFont = GetFont();
 
     wxGetCharSize( m_hWnd
                   ,&nCx1
                   ,&nCy1
-                  ,(wxFont*)&GetFont()
+                  ,&vFont
                  );
     nExtraHeight = nCy1;
 
@@ -1022,8 +1038,6 @@ bool wxRadioBox::SetFont(
     //
     // Also set the font of our radio buttons
     //
-    WXHFONT                         hFont = wxFont(rFont).GetResourceHandle();
-
     for (int n = 0; n < (int)m_nNoItems; n++)
     {
         HWND                        hWndBtn = (HWND)m_ahRadioButtons[n];
@@ -1080,8 +1094,6 @@ bool wxRadioBox::Show(
   bool                              bShow
 )
 {
-    int                             nCmdShow = 0;
-
     if (!wxControl::Show(bShow))
         return FALSE;
 
@@ -1108,8 +1120,6 @@ void wxRadioBox::SubclassRadioButton(
   WXHWND                            hWndBtn
 )
 {
-    HWND                            hwndBtn = (HWND)hWndBtn;
-
     fnWndProcRadioBtn = (WXFARPROC)::WinSubclassWindow(hWndBtn, (PFNWP)wxRadioBtnWndProc);
 } // end of wxRadioBox::SubclassRadioButton