]> git.saurik.com Git - wxWidgets.git/commitdiff
Allow dragging floating AUI frames by the gripper.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 15 May 2011 16:16:11 +0000 (16:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 15 May 2011 16:16:11 +0000 (16:16 +0000)
Previously starting to drag a pane by its gripper worked but once it undocked
it was impossible to drag it by the gripper any more which was annoying for
the user and unexpected.

Fix this by ensuring that we move the correct top level window and not the
child window when dragging floating panes.

Closes #13177.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/framemanager.cpp

index b4b08093c7f783a1b440797a017211e34132949f..bdb37e182c35d1fadec69391a3daf478d1d5a7af 100644 (file)
@@ -4623,6 +4623,15 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
     {
         if (m_action_window)
         {
+            // We can't move the child window so we need to get the frame that
+            // we want to be really moving. This is probably not the best place
+            // to do this but at least it fixes the bug (#13177) for now.
+            if (!m_action_window->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
+            {
+                wxAuiPaneInfo& pane = GetPane(m_action_window);
+                m_action_window = pane.frame;
+            }
+
             wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
             m_action_window->Move(pt.x - m_action_offset.x,
                                 pt.y - m_action_offset.y);