]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/slider.cpp
wxFileCtrl::Update was hiding wxWindow::Update
[wxWidgets.git] / src / os2 / slider.cpp
index ecb5f09f4543abe710c9e4d7c10e0ae7f0612479..7819dca287ef0ef6af1bea376e76fcede34513ab 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <wx/utils.h>
 #include <wx/brush.h>
+#include <wx/scrolwin.h>
 #endif
 
 #include "wx/slider.h"
@@ -200,6 +201,15 @@ bool wxSlider::Create(
     {
         lMsStyle |= WS_VISIBLE | SS_TEXT | DT_VCENTER;
 
+        //
+        // If the parent is a scrolled window the controls must
+        // have this style or they will overlap the scrollbars
+        //
+        if (pParent)
+            if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+                pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+                lMsStyle |= WS_CLIPSIBLINGS;
+
         m_hStaticValue = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                    ,WC_STATIC                // Window class
                                                    ,(PSZ)NULL                // Initial Text
@@ -219,6 +229,15 @@ bool wxSlider::Create(
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lWstyle |= WS_CLIPSIBLINGS;
+        //
+        // If the parent is a scrolled window the controls must
+        // have this style or they will overlap the scrollbars
+        //
+        if (pParent)
+            if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+                pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+                lWstyle |= WS_CLIPSIBLINGS;
+
         m_hStaticMin = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
                                                  ,(PSZ)wxBuffer            // Initial Text
@@ -263,6 +282,15 @@ bool wxSlider::Create(
     else
         lMsStyle |= SLS_PRIMARYSCALE2;
 
+    //
+    // If the parent is a scrolled window the controls must
+    // have this style or they will overlap the scrollbars
+    //
+    if (pParent)
+        if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+            pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+            lMsStyle |= WS_CLIPSIBLINGS;
+
     m_nPageSize = ((nMaxValue - nMinValue)/10);
     vSlData.usScale1Increments = m_nPageSize;
     vSlData.usScale2Increments = m_nPageSize;
@@ -301,7 +329,7 @@ bool wxSlider::Create(
     m_hWnd = (WXHWND)hScrollBar;
     SubclassWin(GetHWND());
     ::WinSetWindowText((HWND)m_hWnd, "");
-    SetFont(pParent->GetFont());
+    SetFont(*wxSMALL_FONT);
     if (m_windowStyle & wxSL_LABELS)
     {
         //
@@ -311,6 +339,15 @@ bool wxSlider::Create(
         lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
         if (m_windowStyle & wxCLIP_SIBLINGS)
             lMsStyle |= WS_CLIPSIBLINGS;
+        //
+        // If the parent is a scrolled window the controls must
+        // have this style or they will overlap the scrollbars
+        //
+        if (pParent)
+            if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
+                pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
+                lWstyle |= WS_CLIPSIBLINGS;
+
         m_hStaticMax = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                                  ,WC_STATIC                // Window class
                                                  ,(PSZ)wxBuffer            // Initial Text