]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch #1395526 (Autoradiobutton corrections)
authorStefan Neis <Stefan.Neis@t-online.de>
Tue, 3 Jan 2006 11:49:09 +0000 (11:49 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Tue, 3 Jan 2006 11:49:09 +0000 (11:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/radiobox.cpp

index 019dae4ab02b28f231595eb8cc7dd50ddb5debc5..0893aa63b4e7437b08dc64104951ac4d5006ff61 100644 (file)
@@ -197,7 +197,7 @@ void wxRadioBox::AdjustButtons( int nX,
         // radiobox part not belonging to any radiobutton)
         //
         ::WinSetWindowPos( (HWND)m_ahRadioButtons[i]
-                          ,HWND_TOP
+                          ,HWND_BOTTOM
                           ,(LONG)nXOffset
                           ,(LONG)nYOffset
                           ,(LONG)nWidthBtn
@@ -334,7 +334,7 @@ bool wxRadioBox::Create(
         long                        lStyleBtn = BS_AUTORADIOBUTTON | WS_TABSTOP | WS_VISIBLE;
         int                         nNewId = NewControlId();
 
-        if (i == 0 && lStyle == 0)
+        if (i == 0)
             lStyleBtn |= WS_GROUP;
 
         HWND                        hWndBtn = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
@@ -343,7 +343,7 @@ bool wxRadioBox::Create(
                                                                          ,lStyleBtn
                                                                          ,0, 0, 0, 0
                                                                          ,GetWinHwnd(pParent)
-                                                                         ,HWND_TOP
+                                                                         ,HWND_BOTTOM
                                                                          ,(HMENU)nNewId
                                                                          ,NULL
                                                                          ,NULL
@@ -376,12 +376,12 @@ bool wxRadioBox::Create(
     }
 
     //
-    // Create a dummy radio control to end the group.
+    // Create a dummy control to end the group.
     //
     (void)::WinCreateWindow ( GetHwndOf(pParent),
                               WC_BUTTON,
                               "",
-                              WS_GROUP | BS_AUTORADIOBUTTON,
+                              WS_GROUP,
                               0, 0, 0, 0,
                               GetWinHwnd(pParent),
                               HWND_TOP,
@@ -400,23 +400,13 @@ bool wxRadioBox::Create(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    ::WinSetPresParam( m_hWnd
-                      ,PP_BORDERDARKCOLOR
-                      ,sizeof(LONG)
-                      ,(PVOID)&lColor
-                     );
-    lColor = (LONG)m_backgroundColour.GetPixel();
 
+    lColor = (LONG)m_backgroundColour.GetPixel();
     ::WinSetPresParam( m_hWnd
                       ,PP_BACKGROUNDCOLOR
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
-    ::WinSetPresParam( m_hWnd
-                      ,PP_BORDERLIGHTCOLOR
-                      ,sizeof(LONG)
-                      ,(PVOID)&lColor
-                     );
     SetXComp(0);
     SetYComp(0);
     SetSelection(0);
@@ -447,13 +437,8 @@ void wxRadioBox::DoSetSize(
     int                             nHeightOld;
     int                             nXx = nX;
     int                             nYy = nY;
-#if RADIOBTN_PARENT_IS_RADIOBOX
-    int                             nXOffset = 0;
-    int                             nYOffset = 0;
-#else
     int                             nXOffset = nXx;
     int                             nYOffset = nYy;
-#endif
     int                             nCx1;
     int                             nCy1;
     wxSize                          vMaxSize = GetMaxButtonSize();
@@ -639,7 +624,7 @@ void wxRadioBox::DoSetSize(
         // radiobox part not belonging to any radiobutton)
         //
         ::WinSetWindowPos( (HWND)m_ahRadioButtons[i]
-                          ,HWND_TOP
+                          ,HWND_BOTTOM
                           ,(LONG)nXOffset
                           ,(LONG)nYOffset
                           ,(LONG)nWidthBtn
@@ -740,7 +725,7 @@ wxSize wxRadioBox::GetMaxButtonSize() const
 } // end of wxRadioBox::GetMaxButtonSize
 
 void wxRadioBox::GetPosition( int* pnX,
-                              int* pnY ) const
+                              int* WXUNUSED(pnY) ) const
 {
     wxWindowOS2*                    pParent = GetParent();
     RECT                            vRect = { -1, -1, -1, -1 };
@@ -783,9 +768,7 @@ void wxRadioBox::GetPosition( int* pnX,
         vPoint.y = vPt.y;
     }
     if (pnX)
-        *pnX = vPoint.x;
-    if (pnY)
-        *pnY = vPoint.y;
+        *pnX = vPoint.y;
 } // end of wxRadioBox::GetPosition
 
 // Get single selection, for single choice list items
@@ -1096,11 +1079,11 @@ MRESULT wxRadioBtnWndProc(
                         switch(uVk)
                         {
                             case VK_LEFT:
-                                eDir = wxDOWN;
+                                eDir = wxLEFT;
                                 break;
 
                             case VK_RIGHT:
-                                eDir = wxDOWN;
+                                eDir = wxRIGHT;
                                 break;
 
                             case VK_DOWN: