]> git.saurik.com Git - wxWidgets.git/commitdiff
implement wxRadioBox::Reparent(): it didn't reparent the radio buttons (patch 1891030)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 19 Feb 2008 02:43:29 +0000 (02:43 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 19 Feb 2008 02:43:29 +0000 (02:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/radiobox.h
src/msw/radiobox.cpp

index 86a837aa9f1fa460c14b70bd2f1ba74a4229c274..c2c13ee7308d0be2ea06c4f2aa928b5fc38f24a1 100644 (file)
@@ -111,6 +111,8 @@ public:
     }
 #endif // wxUSE_HELP
 
+    virtual bool Reparent(wxWindowBase *newParent);
+
     // we inherit a version always returning false from wxStaticBox, override
     // it to behave normally
     virtual bool AcceptsFocus() const { return wxControl::AcceptsFocus(); }
index 4fc2d2acbd9e373c572a30683c6eb208bffa20f3..e9f53d0f4628415b0b1ad9ca5a97259e24705f0f 100644 (file)
@@ -461,6 +461,25 @@ void wxRadioBox::DoSetItemToolTip(unsigned int item, wxToolTip *tooltip)
 
 #endif // wxUSE_TOOLTIPS
 
+bool wxRadioBox::Reparent(wxWindowBase *newParent)
+{
+    if ( !wxStaticBox::Reparent(newParent) )
+    {
+        return false;
+    }
+
+    HWND hwndParent = GetHwndOf(GetParent());
+    for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ )
+    {
+        ::SetParent((*m_radioButtons)[item], hwndParent);
+    }
+#ifdef __WXWINCE__
+    // put static box under the buttons in the Z-order
+    SetWindowPos(GetHwnd(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
+#endif
+    return true;
+}
+
 WX_FORWARD_STD_METHODS_TO_SUBWINDOWS(wxRadioBox, wxStaticBox, m_radioButtons)
 
 // ----------------------------------------------------------------------------