From cf37c9a90d49c8a624cd11a939f4efd91c77600f Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Sun, 19 Nov 2006 18:10:18 +0000 Subject: [PATCH] allow programmatic access to start pane dragging git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43528 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/aui/framemanager.h | 19 +++++++++++++------ src/aui/framemanager.cpp | 24 ++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index 201768dccc..0307c3d4f2 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -476,15 +476,22 @@ public: void Update(); public: + virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p); - wxRect CalculateHintRect(wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset); + void StartPaneDrag( + wxWindow* pane_window, + const wxPoint& offset); + + wxRect CalculateHintRect( + wxWindow* pane_window, + const wxPoint& pt, + const wxPoint& offset); - void DrawHintRect(wxWindow* pane_window, - const wxPoint& pt, - const wxPoint& offset); + void DrawHintRect( + wxWindow* pane_window, + const wxPoint& pt, + const wxPoint& offset); virtual void ShowHint(const wxRect& rect); virtual void HideHint(); diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 9d35f47f7f..2e3aecb032 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -3074,6 +3074,27 @@ void wxAuiManager::HideHint() +void wxAuiManager::StartPaneDrag(wxWindow* pane_window, + const wxPoint& offset) +{ + wxAuiPaneInfo& pane = GetPane(pane_window); + if (!pane.IsOk()) + return; + + if (pane.IsToolbar()) + { + m_action = actionDragToolbarPane; + } + else + { + m_action = actionDragFloatingPane; + } + + m_action_window = pane_window; + m_action_offset = offset; + m_frame->CaptureMouse(); +} + // CalculateHintRect() calculates the drop hint rectangle. The method // first calls DoDrop() to determine the exact position the pane would @@ -4041,9 +4062,8 @@ void wxAuiManager::OnMotion(wxMouseEvent& event) pt.y - m_action_offset.y); // float the window - if(pane_info->IsMaximized()) { + if (pane_info->IsMaximized()) RestorePane(*pane_info); - } pane_info->Float(); Update(); -- 2.45.2