]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/radiobox.cpp
Moved EnsureVisible to avoid spurious selection of root during idle processing
[wxWidgets.git] / src / msw / radiobox.cpp
index 09abc323191c48ab4e5fede8800459c62514acb1..baeb42a491ef70caf8e032e2064e97e53b917f9e 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        msw/radiobox.cpp
+// Name:        src/msw/radiobox.cpp
 // Purpose:     wxRadioBox implementation
 // Author:      Julian Smart
 // Modified by:
 // headers
 // ---------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "radiobox.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 
 #include "wx/msw/subwin.h"
 
-// This is switched off because in some situations, the radiobox
-// buttons simply don't appear when deferred sizing is on.
-// Instead, refreshing on WM_MOVE seems to at least cure the droppings.
-#define USE_DEFERRED_SIZING 0
-
 #if wxUSE_TOOLTIPS
     #if !defined(__GNUWIN32_OLD__) || defined(__CYGWIN10__)
         #include <commctrl.h>
@@ -493,7 +484,7 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
 
     // and also wide enough for its label
     int widthLabel;
-    GetTextExtent(GetTitle(), &widthLabel, NULL);
+    GetTextExtent(GetLabel(), &widthLabel, NULL);
     widthLabel += RADIO_SIZE; // FIXME this is bogus too
     if ( widthLabel > width )
         width = widthLabel;
@@ -557,17 +548,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
             height = heightOld;
     }
 
-    // if our parent had prepared a defer window handle for us, use it (unless
-    // we are a top level window)
-
-#if USE_DEFERRED_SIZING
-    wxWindowMSW *parent = GetParent();
-    HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL;
-#else
-    HDWP hdwp = 0;
-#endif
-
-    wxMoveWindowDeferred(hdwp, this, GetHwnd(), xx, yy, width, height);
+    DoMoveWindow(xx, yy, width, height);
 
     // Now position all the buttons: the current button will be put at
     // wxPoint(x_offset, y_offset) and the new row/column will start at
@@ -664,14 +645,6 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
             x_offset += widthBtn + cx1;
         }
     }
-
-#if USE_DEFERRED_SIZING
-    if (parent)
-    {
-        // hdwp must be updated as it may have been changed
-        parent->m_hDWP = (WXHANDLE)hdwp;
-    }
-#endif
 }
 
 // ----------------------------------------------------------------------------
@@ -889,4 +862,3 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd,
 }
 
 #endif // wxUSE_RADIOBOX
-