]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/slider.cpp
Comment out extraneous include wx/wxprec.h (part of other commented out stuff)
[wxWidgets.git] / src / os2 / slider.cpp
index e8558d2e8db3b005446da2a933fcd494ce1d30d8..1dec64ffc2a85aad015711f21b94d11606d47b91 100644 (file)
 #include <stdio.h>
 #include <wx/utils.h>
 #include <wx/brush.h>
 #include <stdio.h>
 #include <wx/utils.h>
 #include <wx/brush.h>
+#include <wx/scrolwin.h>
 #endif
 
 #endif
 
+#if wxUSE_SLIDER
+
 #include "wx/slider.h"
 #include "wx/os2/private.h"
 
 #include "wx/slider.h"
 #include "wx/os2/private.h"
 
@@ -57,18 +60,18 @@ void wxSlider::AdjustSubControls(
 , int                               nSizeFlags
 )
 {
 , int                               nSizeFlags
 )
 {
-    SWP                             vSwp;
     int                             nXOffset = nX;
     int                             nYOffset = nY;
     int                             nCx;     // slider,min,max sizes
     int                             nCy;
     int                             nCyf;
     char                            zBuf[300];
     int                             nXOffset = nX;
     int                             nYOffset = nY;
     int                             nCx;     // slider,min,max sizes
     int                             nCy;
     int                             nCyf;
     char                            zBuf[300];
+    wxFont                          vFont = this->GetFont();
 
     wxGetCharSize( GetHWND()
                   ,&nCx
                   ,&nCy
 
     wxGetCharSize( GetHWND()
                   ,&nCx
                   ,&nCy
-                  ,&this->GetFont()
+                  ,&vFont
                  );
 
     if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
                  );
 
     if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
@@ -79,10 +82,10 @@ void wxSlider::AdjustSubControls(
             int                     nMaxLen = 0;
 
             ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
             int                     nMaxLen = 0;
 
             ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
-            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont());
+            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
 
             ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
 
             ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
-            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont());
+            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
 
             if (m_hStaticValue)
             {
 
             if (m_hStaticValue)
             {
@@ -95,7 +98,7 @@ void wxSlider::AdjustSubControls(
                                   ,(LONG)nYOffset
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
                                   ,(LONG)nYOffset
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
-                                  ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+                                  ,SWP_SIZE | SWP_MOVE
                                  );
             }
             ::WinSetWindowPos( (HWND)m_hStaticMin
                                  );
             }
             ::WinSetWindowPos( (HWND)m_hStaticMin
@@ -103,8 +106,8 @@ void wxSlider::AdjustSubControls(
                               ,(LONG)nXOffset - (nMinLen + nCx)
                               ,(LONG)nYOffset
                               ,(LONG)nMinLen
                               ,(LONG)nXOffset - (nMinLen + nCx)
                               ,(LONG)nYOffset
                               ,(LONG)nMinLen
-                              ,(LONG)nCy
-                              ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+                              ,(LONG)nCyf
+                              ,SWP_SIZE | SWP_MOVE
                              );
             nXOffset += nWidth + nCx;
 
                              );
             nXOffset += nWidth + nCx;
 
@@ -113,14 +116,59 @@ void wxSlider::AdjustSubControls(
                               ,(LONG)nXOffset
                               ,(LONG)nYOffset
                               ,(LONG)nMaxLen
                               ,(LONG)nXOffset
                               ,(LONG)nYOffset
                               ,(LONG)nMaxLen
-                              ,(LONG)nCy
-                              ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
+                              ,(LONG)nCyf
+                              ,SWP_ZORDER | SWP_SHOW
+                             );
+        }
+    }
+    else
+    {
+        //
+        // Now deal with a vertical slider
+        //
+
+        if (m_windowStyle & wxSL_LABELS )
+        {
+            int                     nMinLen = 0;
+            int                     nMaxLen = 0;
+
+            ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
+            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
+
+            ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
+            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
+
+            if (m_hStaticValue)
+            {
+                int                 nNewWidth = (wxMax(nMinLen, nMaxLen));
+
+                ::WinSetWindowPos( (HWND)m_hStaticValue
+                                  ,HWND_TOP
+                                  ,(LONG)nXOffset
+                                  ,(LONG)nYOffset + nHeight + nCyf
+                                  ,(LONG)nNewWidth
+                                  ,(LONG)nCyf
+                                  ,SWP_SIZE | SWP_MOVE
+                                 );
+            }
+            ::WinSetWindowPos( (HWND)m_hStaticMax
+                              ,HWND_TOP
+                              ,(LONG)nXOffset
+                              ,(LONG)nYOffset + nHeight
+                              ,(LONG)nMaxLen
+                              ,(LONG)nCyf
+                              ,SWP_SIZE | SWP_MOVE
+                             );
+            ::WinSetWindowPos( (HWND)m_hStaticMin
+                              ,HWND_TOP
+                              ,(LONG)nXOffset
+                              ,(LONG)nYOffset - nCyf
+                              ,(LONG)nMinLen
+                              ,(LONG)nCyf
+                              ,SWP_SIZE | SWP_MOVE
                              );
         }
     }
                              );
         }
     }
-    //
-    // Now deal with a vertical slider -- OS/2 doesn't have vertical sliders
-    //
 } // end of wxSlider::AdjustSubControls
 
 void wxSlider::ClearSel()
 } // end of wxSlider::AdjustSubControls
 
 void wxSlider::ClearSel()
@@ -158,9 +206,7 @@ bool wxSlider::Create(
 , const wxPoint&                    rPos
 , const wxSize&                     rSize
 , long                              lStyle
 , const wxPoint&                    rPos
 , const wxSize&                     rSize
 , long                              lStyle
-#if wxUSE_VALIDATORS
 , const wxValidator&                rValidator
 , const wxValidator&                rValidator
-#endif
 , const wxString&                   rsName
 )
 {
 , const wxString&                   rsName
 )
 {
@@ -219,6 +265,7 @@ bool wxSlider::Create(
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lWstyle |= WS_CLIPSIBLINGS;
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lWstyle |= WS_CLIPSIBLINGS;
+
         m_hStaticMin = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
                                                  ,(PSZ)wxBuffer            // Initial Text
         m_hStaticMin = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
                                                  ,(PSZ)wxBuffer            // Initial Text
@@ -237,9 +284,9 @@ bool wxSlider::Create(
 
     vSlData.cbSize = sizeof(SLDCDATA);
     if (m_windowStyle & wxSL_VERTICAL)
 
     vSlData.cbSize = sizeof(SLDCDATA);
     if (m_windowStyle & wxSL_VERTICAL)
-        lMsStyle = SLS_VERTICAL | WS_VISIBLE | WS_TABSTOP;
+        lMsStyle = SLS_VERTICAL | SLS_HOMEBOTTOM | WS_VISIBLE | WS_TABSTOP;
     else
     else
-        lMsStyle = SLS_HORIZONTAL | WS_VISIBLE | WS_TABSTOP;
+        lMsStyle = SLS_HORIZONTAL | SLS_HOMELEFT | WS_VISIBLE | WS_TABSTOP;
 
     if (m_windowStyle & wxCLIP_SIBLINGS)
         lMsStyle |= WS_CLIPSIBLINGS;
 
     if (m_windowStyle & wxCLIP_SIBLINGS)
         lMsStyle |= WS_CLIPSIBLINGS;
@@ -262,6 +309,7 @@ bool wxSlider::Create(
         lMsStyle |= SLS_PRIMARYSCALE1 | SLS_PRIMARYSCALE2;
     else
         lMsStyle |= SLS_PRIMARYSCALE2;
         lMsStyle |= SLS_PRIMARYSCALE1 | SLS_PRIMARYSCALE2;
     else
         lMsStyle |= SLS_PRIMARYSCALE2;
+    lMsStyle |= SLS_RIBBONSTRIP;
 
     m_nPageSize = ((nMaxValue - nMinValue)/10);
     vSlData.usScale1Increments = m_nPageSize;
 
     m_nPageSize = ((nMaxValue - nMinValue)/10);
     vSlData.usScale1Increments = m_nPageSize;
@@ -273,7 +321,7 @@ bool wxSlider::Create(
                                                                    ,(ULONG)lMsStyle          // Style flags
                                                                    ,0L, 0L, 0L, 0L           // Origin -- 0 size
                                                                    ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
                                                                    ,(ULONG)lMsStyle          // Style flags
                                                                    ,0L, 0L, 0L, 0L           // Origin -- 0 size
                                                                    ,(HWND)GetHwndOf(pParent) // owner window handle (same as parent
-                                                                   ,HWND_TOP                 // initial z position
+                                                                   ,HWND_BOTTOM                 // initial z position
                                                                    ,(HMENU)m_windowId       // Window identifier
                                                                    ,&vSlData                 // Slider control data
                                                                    ,NULL                     // no Presentation parameters
                                                                    ,(HMENU)m_windowId       // Window identifier
                                                                    ,&vSlData                 // Slider control data
                                                                    ,NULL                     // no Presentation parameters
@@ -286,7 +334,7 @@ bool wxSlider::Create(
     //
     ::WinSendMsg( hScrollBar
                  ,SLM_SETTICKSIZE
     //
     ::WinSendMsg( hScrollBar
                  ,SLM_SETTICKSIZE
-                 ,MPFROM2SHORT(SMA_SETALLTICKS, 6)
+                 ,MPFROM2SHORT(SMA_SETALLTICKS, (USHORT)12)
                  ,NULL
                 );
     //
                  ,NULL
                 );
     //
@@ -301,7 +349,8 @@ bool wxSlider::Create(
     m_hWnd = (WXHWND)hScrollBar;
     SubclassWin(GetHWND());
     ::WinSetWindowText((HWND)m_hWnd, "");
     m_hWnd = (WXHWND)hScrollBar;
     SubclassWin(GetHWND());
     ::WinSetWindowText((HWND)m_hWnd, "");
-    SetFont(pParent->GetFont());
+
+    SetFont(*wxSMALL_FONT);
     if (m_windowStyle & wxSL_LABELS)
     {
         //
     if (m_windowStyle & wxSL_LABELS)
     {
         //
@@ -311,6 +360,7 @@ bool wxSlider::Create(
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lMsStyle |= WS_CLIPSIBLINGS;
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lMsStyle |= WS_CLIPSIBLINGS;
+
         m_hStaticMax = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
                                                  ,(PSZ)wxBuffer            // Initial Text
         m_hStaticMax = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
                                                  ,(PSZ)wxBuffer            // Initial Text
@@ -342,6 +392,8 @@ bool wxSlider::Create(
         }
     }
 
         }
     }
 
+    SetXComp(0);
+    SetYComp(0);
     SetSize( nX
             ,nY
             ,nWidth
     SetSize( nX
             ,nY
             ,nWidth
@@ -382,8 +434,36 @@ bool wxSlider::Create(
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
                       ,sizeof(LONG)
                       ,(PVOID)&lColor
                      );
+    lColor = (LONG)m_backgroundColour.GetPixel();
+    ::WinSetPresParam( m_hStaticMin
+                      ,PP_BACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+    ::WinSetPresParam( m_hStaticMax
+                      ,PP_BACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+    ::WinSetPresParam( m_hStaticValue
+                      ,PP_BACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+    ::WinSetPresParam( m_hWnd
+                      ,PP_BACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
+    vColour.Set(wxString("BLUE"));
+    lColor = (LONG)vColour.GetPixel();
+    ::WinSetPresParam( m_hWnd
+                      ,PP_HILITEBACKGROUNDCOLOR
+                      ,sizeof(LONG)
+                      ,(PVOID)&lColor
+                     );
     SetValue(nValue);
     SetValue(nValue);
-    return TRUE;
+    return true;
 } // end of wxSlider::Create
 
 void wxSlider::DoSetSize(
 } // end of wxSlider::Create
 
 void wxSlider::DoSetSize(
@@ -406,6 +486,7 @@ void wxSlider::DoSetSize(
     int                             nCurrentX;
     int                             nCurrentY;
     char                            zBuf[300];
     int                             nCurrentX;
     int                             nCurrentY;
     char                            zBuf[300];
+    wxFont                          vFont = this->GetFont();
 
     //
     // Adjust for OS/2's reverse coordinate system
 
     //
     // Adjust for OS/2's reverse coordinate system
@@ -451,7 +532,7 @@ void wxSlider::DoSetSize(
     wxGetCharSize( GetHWND()
                   ,&nCx
                   ,&nCy
     wxGetCharSize( GetHWND()
                   ,&nCx
                   ,&nCy
-                  ,&this->GetFont()
+                  ,&vFont
                  );
 
     if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
                  );
 
     if ((m_windowStyle & wxSL_VERTICAL) != wxSL_VERTICAL)
@@ -462,9 +543,9 @@ void wxSlider::DoSetSize(
             int                  nMaxLen = 0;
 
             ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
             int                  nMaxLen = 0;
 
             ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
-            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont());
+            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
             ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
             ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
-            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont());
+            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
 
             if (m_hStaticValue)
             {
 
             if (m_hStaticValue)
             {
@@ -474,7 +555,7 @@ void wxSlider::DoSetSize(
                 ::WinSetWindowPos( (HWND)m_hStaticValue
                                   ,HWND_TOP
                                   ,(LONG)nXOffset
                 ::WinSetWindowPos( (HWND)m_hStaticValue
                                   ,HWND_TOP
                                   ,(LONG)nXOffset
-                                  ,(LONG)nYOffset - (nCyf * 1.2)
+                                  ,(LONG)nYOffset - (LONG)(nCyf * 1.2)
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
                                   ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
                                   ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
@@ -484,7 +565,7 @@ void wxSlider::DoSetSize(
             ::WinSetWindowPos( (HWND)m_hStaticMin
                               ,HWND_TOP
                               ,(LONG)nXOffset
             ::WinSetWindowPos( (HWND)m_hStaticMin
                               ,HWND_TOP
                               ,(LONG)nXOffset
-                              ,(LONG)nYOffset - nCyf
+                              ,(LONG)nYOffset - (LONG)(nCyf * 1.2)
                               ,(LONG)nMinLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                               ,(LONG)nMinLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
@@ -511,12 +592,20 @@ void wxSlider::DoSetSize(
                               ,(LONG)nSliderHeight
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                              );
                               ,(LONG)nSliderHeight
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                              );
+            ::WinQueryWindowPos(GetHwnd(), GetSwp());
+            ::WinSendMsg( GetHwnd()
+                         ,SLM_SETSLIDERINFO
+                         ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
+                                       ,0
+                                      )
+                         ,MPFROMLONG((ULONG)(nSliderHeight/2))
+                        );
             nXOffset += nSliderLength + nCx;
 
             ::WinSetWindowPos( (HWND)m_hStaticMax
                               ,HWND_TOP
                               ,(LONG)nXOffset
             nXOffset += nSliderLength + nCx;
 
             ::WinSetWindowPos( (HWND)m_hStaticMax
                               ,HWND_TOP
                               ,(LONG)nXOffset
-                              ,(LONG)nYOffset - nCyf
+                              ,(LONG)nYOffset - (LONG)(nCyf * 1.2)
                               ,(LONG)nMaxLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                               ,(LONG)nMaxLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
@@ -561,41 +650,32 @@ void wxSlider::DoSetSize(
             int                  nMaxLen;
 
             ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
             int                  nMaxLen;
 
             ::WinQueryWindowText((HWND)m_hStaticMin, 300, zBuf);
-            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &this->GetFont());
+            GetTextExtent(zBuf, &nMinLen, &nCyf, NULL, NULL, &vFont);
             ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
             ::WinQueryWindowText((HWND)m_hStaticMax, 300, zBuf);
-            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &this->GetFont());
+            GetTextExtent(zBuf, &nMaxLen, &nCyf, NULL, NULL, &vFont);
             if (m_hStaticValue)
             {
                 int              nNewWidth = wxMax(nMinLen, nMaxLen);
                 int              nValueHeight = nCyf;
 
             if (m_hStaticValue)
             {
                 int              nNewWidth = wxMax(nMinLen, nMaxLen);
                 int              nValueHeight = nCyf;
 
-                nNewWidth += nCx;
-
-                //
-                // The height needs to be a bit bigger under Win95 if using native
-                // 3D effects.
-                //
-                nValueHeight = (int)(nValueHeight * 1.5);
                 ::WinSetWindowPos( (HWND)m_hStaticValue
                                   ,HWND_TOP
                                   ,(LONG)nXOffset
                 ::WinSetWindowPos( (HWND)m_hStaticValue
                                   ,HWND_TOP
                                   ,(LONG)nXOffset
-                                  ,(LONG)nYOffset
+                                  ,(LONG)nYOffset + nHeight
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
                                   ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                                  );
                                   ,(LONG)nNewWidth
                                   ,(LONG)nValueHeight
                                   ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                                  );
-                nYOffset -= nValueHeight;
-                nUsedHeight += nValueHeight;
+                nUsedHeight += nCyf;
             }
             ::WinSetWindowPos( (HWND)m_hStaticMin
                               ,HWND_TOP
                               ,(LONG)nXOffset
             }
             ::WinSetWindowPos( (HWND)m_hStaticMin
                               ,HWND_TOP
                               ,(LONG)nXOffset
-                              ,(LONG)nYOffset
+                              ,(LONG)nYOffset + nHeight - nCyf
                               ,(LONG)nMinLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                              );
                               ,(LONG)nMinLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                              );
-            nYOffset -= nCy;
             nUsedHeight += nCy;
 
             int                  nSliderLength = nHeight1 - (nUsedHeight + (2 * nCy));
             nUsedHeight += nCy;
 
             int                  nSliderLength = nHeight1 - (nUsedHeight + (2 * nCy));
@@ -610,20 +690,27 @@ void wxSlider::DoSetSize(
             if (nSliderLength < 100)
                 nSliderLength = 100;
 
             if (nSliderLength < 100)
                 nSliderLength = 100;
 
-            ::WinSetWindowPos( (HWND)m_hStaticMin
+            ::WinSetWindowPos( GetHwnd()
                               ,HWND_TOP
                               ,(LONG)nXOffset
                               ,HWND_TOP
                               ,(LONG)nXOffset
-                              ,(LONG)nYOffset
+                              ,(LONG)nYOffset + nCyf
                               ,(LONG)nSliderWidth
                               ,(LONG)nSliderLength
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                              );
                               ,(LONG)nSliderWidth
                               ,(LONG)nSliderLength
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                              );
-            nYOffset -= nSliderLength;
+            ::WinQueryWindowPos(GetHwnd(), GetSwp());
+            ::WinSendMsg( GetHwnd()
+                         ,SLM_SETSLIDERINFO
+                         ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
+                                       ,0
+                                      )
+                         ,MPFROMLONG((ULONG)(nSliderWidth/2))
+                        );
             nUsedHeight += nSliderLength;
             ::WinSetWindowPos( (HWND)m_hStaticMax
                               ,HWND_TOP
                               ,(LONG)nXOffset
             nUsedHeight += nSliderLength;
             ::WinSetWindowPos( (HWND)m_hStaticMax
                               ,HWND_TOP
                               ,(LONG)nXOffset
-                              ,(LONG)nYOffset
+                              ,(LONG)nYOffset - nCyf
                               ,(LONG)nMaxLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
                               ,(LONG)nMaxLen
                               ,(LONG)nCy
                               ,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
@@ -741,6 +828,16 @@ int wxSlider::GetSelStart() const
     return 0;
 } // end of wxSlider::GetSelStart
 
     return 0;
 } // end of wxSlider::GetSelStart
 
+void wxSlider::DoGetSize(
+  int*                              pnWidth
+, int*                              pnHeight
+) const
+{
+    GetSize( pnWidth
+            ,pnHeight
+           );
+} // end of wxSlider::DoGetSize
+
 void wxSlider::GetSize(
   int*                              pnWidth
 , int*                              pnHeight
 void wxSlider::GetSize(
   int*                              pnWidth
 , int*                              pnHeight
@@ -769,8 +866,10 @@ void wxSlider::GetSize(
         wxFindMaxSize( m_hStaticValue
                       ,&vRect
                      );
         wxFindMaxSize( m_hStaticValue
                       ,&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 wxSlider::GetSize
 
 int wxSlider::GetThumbLength() const
 } // end of wxSlider::GetSize
 
 int wxSlider::GetThumbLength() const
@@ -846,7 +945,7 @@ bool wxSlider::OS2OnScroll(
             break;
 
         default:
             break;
 
         default:
-            return FALSE;
+            return false;
     }
 
     int                             nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
     }
 
     int                             nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
@@ -867,7 +966,7 @@ bool wxSlider::OS2OnScroll(
                                                                           ,(MPARAM)0
                                                                          )
                                                             );
                                                                           ,(MPARAM)0
                                                                          )
                                                             );
-    nNewPos = (nPixelPos/m_dPixelToRange);
+    nNewPos = (int)(nPixelPos/m_dPixelToRange);
     if (nNewPos > (m_nRangeMax - m_nRangeMin)/2)
         nNewPos++;
     if ((nNewPos < GetMin()) || (nNewPos > GetMax()))
     if (nNewPos > (m_nRangeMax - m_nRangeMin)/2)
         nNewPos++;
     if ((nNewPos < GetMin()) || (nNewPos > GetMax()))
@@ -875,7 +974,7 @@ bool wxSlider::OS2OnScroll(
         //
         // Out of range - but we did process it
         //
         //
         // Out of range - but we did process it
         //
-        return TRUE;
+        return true;
     }
     SetValue(nNewPos);
 
     }
     SetValue(nNewPos);
 
@@ -986,7 +1085,7 @@ void wxSlider::SetTick(
   int                               nTickPos
 )
 {
   int                               nTickPos
 )
 {
-    nTickPos *= m_dPixelToRange;
+    nTickPos = (int)(nTickPos * m_dPixelToRange);
     ::WinSendMsg( GetHwnd()
                  ,SLM_ADDDETENT
                  ,MPFROMSHORT(nTickPos)
     ::WinSendMsg( GetHwnd()
                  ,SLM_ADDDETENT
                  ,MPFROMSHORT(nTickPos)
@@ -1024,7 +1123,7 @@ void wxSlider::SetTickFreq(
     ::WinSendMsg(GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vWndParams, (MPARAM)0);
     for (i = 1; i < (m_nRangeMax - m_nRangeMin)/n; i++)
     {
     ::WinSendMsg(GetHwnd(), WM_SETWINDOWPARAMS, (MPARAM)&vWndParams, (MPARAM)0);
     for (i = 1; i < (m_nRangeMax - m_nRangeMin)/n; i++)
     {
-        nPixelPos = i * n * m_dPixelToRange;
+        nPixelPos = (int)(i * n * m_dPixelToRange);
         ::WinSendMsg( GetHwnd()
                      ,SLM_ADDDETENT
                      ,MPFROMSHORT(nPixelPos)
         ::WinSendMsg( GetHwnd()
                      ,SLM_ADDDETENT
                      ,MPFROMSHORT(nPixelPos)
@@ -1037,14 +1136,6 @@ void wxSlider::SetValue(
   int                               nValue
 )
 {
   int                               nValue
 )
 {
-    int                             nPixelPos = SHORT1FROMMR(::WinSendMsg( GetHwnd()
-                                                                          ,SLM_QUERYSLIDERINFO
-                                                                          ,MPFROM2SHORT( SMA_SLIDERARMPOSITION
-                                                                                        ,SMA_RANGEVALUE
-                                                                                       )
-                                                                          ,(MPARAM)0
-                                                                         )
-                                                            );
     int                             nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
                                                                             ,SLM_QUERYSLIDERINFO
                                                                             ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
     int                             nPixelRange = SHORT1FROMMR(::WinSendMsg( GetHwnd()
                                                                             ,SLM_QUERYSLIDERINFO
                                                                             ,MPFROM2SHORT( SMA_SHAFTDIMENSIONS
@@ -1081,6 +1172,7 @@ bool wxSlider::Show(
         ::WinShowWindow((HWND)m_hStaticMin, bShow);
     if(m_hStaticMax)
         ::WinShowWindow((HWND)m_hStaticMax, bShow);
         ::WinShowWindow((HWND)m_hStaticMin, bShow);
     if(m_hStaticMax)
         ::WinShowWindow((HWND)m_hStaticMax, bShow);
-    return TRUE;
+    return true;
 } // end of wxSlider::Show
 
 } // end of wxSlider::Show
 
+#endif // wxUSE_SLIDER