]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/gauge.cpp
corrected path splitting for mac relative paths
[wxWidgets.git] / src / os2 / gauge.cpp
index b227ebf692cddc28aea6931882ccfaa98fe88e39..b7700f4147cbf29e2a47ea18f36c0bc5305aaf63 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef WX_PRECOMP
 #include "wx/defs.h"
 #include "wx/utils.h"
+#include "wx/scrolwin.h"
 #endif
 
 #include "wx/os2/private.h"
@@ -122,6 +123,7 @@ bool wxGauge::Create(
     int                             nWidth   = rSize.x;
     int                             nHeight  = rSize.y;
     long                            lMsStyle = 0L;
+    SWP                             vSwp;
 
     SetName(rsName);
 #if wxUSE_VALIDATORS
@@ -154,7 +156,14 @@ bool wxGauge::Create(
     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)))
+            lMsStyle |= WS_CLIPSIBLINGS;
 
     m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
                                        ,WC_ENTRYFIELD            // Window class
@@ -173,6 +182,9 @@ bool wxGauge::Create(
                             );
     ::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this);
     fnWndProcGauge = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxGaugeWndProc);
+    ::WinQueryWindowPos(m_hWnd, &vSwp);
+    SetXComp(vSwp.x);
+    SetYComp(vSwp.y);
     SetFont(pParent->GetFont());
     if (nWidth == -1L)
         nWidth = 50L;