]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
Added stubs .cpp files.
[wxWidgets.git] / src / msw / radiobox.cpp
index 81467bcfb3e3913733de43ac038bd0fb9352c505..dcd27cbba21fc5d8cc4b15b97589d611c366bf9f 100644 (file)
@@ -116,7 +116,8 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
   m_noRowsOrCols = majorDim;
   if (majorDim==0)
     m_majorDim = n ;
-  m_majorDim = majorDim ;
+  else // Seemed to make sense to put this 'else' here...  (RD)
+    m_majorDim = majorDim ;
 
   long msStyle = GROUP_FLAGS;
 
@@ -321,7 +322,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
 wxRadioBox::~wxRadioBox(void)
 {
   m_isBeingDeleted = TRUE;
-  
+
   if (m_radioButtons)
   {
     int i;
@@ -409,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;
@@ -575,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;
@@ -642,7 +654,7 @@ void wxRadioBox::Enable(int item, bool enable)
 void wxRadioBox::Enable(bool enable)
 {
   wxControl::Enable(enable);
-  
+
   int i;
   for (i = 0; i < m_noItems; i++)
     ::EnableWindow((HWND) m_radioButtons[i], enable);
@@ -733,7 +745,7 @@ void wxRadioBox::SetLabelFont(wxFont *font)
     if (font)
     {
       font->RealizeResource();
-      
+
       if (font->GetResourceHandle())
         SendMessage(hWnd, WM_SETFONT,
                   (WPARAM)font->GetResourceHandle(),TRUE);