Take the AUI floating title bar height into account when dragging it.

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
This commit is contained in:
Vadim Zeitlin
2011-05-14 14:17:55 +00:00
parent 2bd82d72f5
commit cb542c4046

View File

@@ -3429,6 +3429,15 @@ void wxAuiManager::StartPaneDrag(wxWindow* pane_window,
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;
}
}