]> git.saurik.com Git - wxWidgets.git/commitdiff
Take the AUI floating title bar height into account when dragging it.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 14 May 2011 14:17:55 +0000 (14:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 14 May 2011 14:17:55 +0000 (14:17 +0000)
The cursor wasn't positioned correctly when a floating toolbar was dragged by
pressing the mouse over its gripper because its position didn't take into
account the difference between the client and window coordinates of the
floating window (which is basically the height of the window title bar).

Notice that the same problem still remains when starting to drag a docked
toolbar as it doesn't have the title bar initially but does have it later
so the same fix should probably be applied when we reparent the toolbar.

Closes #9984.

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

src/aui/framemanager.cpp

index 40a3a14490faaa2d4f28ab3bfb632de09d237f50..4c0ca6cf5467725e15da3b7564f0272f67ec380b 100644 (file)
@@ -3429,6 +3429,15 @@ void wxAuiManager::StartPaneDrag(wxWindow* pane_window,
     m_action_window = pane_window;
     m_action_offset = offset;
     m_frame->CaptureMouse();
     m_action_window = pane_window;
     m_action_offset = offset;
     m_frame->CaptureMouse();
+
+    if (pane.frame)
+    {
+        wxRect window_rect = pane.frame->GetRect();
+        wxRect client_rect = pane.frame->GetClientRect();
+        wxPoint client_pt = pane.frame->ClientToScreen(client_rect.GetTopLeft());
+        wxPoint origin_pt = client_pt - window_rect.GetTopLeft();
+        m_action_offset += origin_pt;
+    }
 }
 
 
 }