]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/slidrmsw.cpp
Next attempt at dynlib.cpp
[wxWidgets.git] / src / msw / slidrmsw.cpp
index 63d743e66c518824fd9661d7642fa94b89a0158a..f8a6f33e2a96720962af26279185d5d53b959b0b 100644 (file)
@@ -302,6 +302,15 @@ void wxSliderMSW::GetPosition(int *x, int *y) const
   if (parent)
     ::ScreenToClient((HWND) parent->GetHWND(), &point);
 
+  // We may be faking the client origin.
+  // So a window that's really at (0, 30) may appear
+  // (to wxWin apps) to be at (0, 0).
+  if (GetParent())
+  {
+    wxPoint pt(GetParent()->GetClientAreaOrigin());
+    point.x -= pt.x;
+    point.y -= pt.y;
+  }
   *x = point.x;
   *y = point.y;
 }
@@ -320,6 +329,8 @@ void wxSliderMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
   if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     y1 = currentY;
 
+  AdjustForParentClientOrigin(x1, y1, sizeFlags);
+
   char buf[300];
 
   int x_offset = x;