]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
improved handling of frames with parent: now they have a NULL parent HWND (to
[wxWidgets.git] / src / msw / radiobox.cpp
index 5d50a6c2f036df916193d489bbe05b4f98fdf12b..dcd27cbba21fc5d8cc4b15b97589d611c366bf9f 100644 (file)
@@ -410,6 +410,8 @@ void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
   if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
     yy = currentY;
 
+  AdjustForParentClientOrigin(xx, yy, sizeFlags);
+
   char buf[400];
 
   int y_offset = yy;
@@ -576,6 +578,15 @@ void wxRadioBox::GetPosition(int *x, int *y) const
   {
     ::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;