From 22fec94aa95d2e1340dfa4bc7f00cea79b868977 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Tue, 31 Oct 2006 13:12:36 +0000 Subject: [PATCH] aui docking works well on systems with solid window dragging turned off git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/aui/floatpane.h | 1 + src/aui/floatpane.cpp | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/include/wx/aui/floatpane.h b/include/wx/aui/floatpane.h index 158c0a272b..afa1416db1 100644 --- a/include/wx/aui/floatpane.h +++ b/include/wx/aui/floatpane.h @@ -57,6 +57,7 @@ private: static bool isMouseDown(); private: wxWindow* m_pane_window; // pane window being managed + bool m_solid_drag; // true if system uses solid window drag bool m_moving; wxRect m_last_rect; wxRect m_last2_rect; diff --git a/src/aui/floatpane.cpp b/src/aui/floatpane.cpp index 5d9c010da2..595a0a5629 100644 --- a/src/aui/floatpane.cpp +++ b/src/aui/floatpane.cpp @@ -52,6 +52,16 @@ wxFloatingPane::wxFloatingPane(wxWindow* parent, m_owner_mgr = owner_mgr; m_moving = false; m_mgr.SetManagedWindow(this); + m_solid_drag = true; + + // find out if the system supports solid window drag. + // on non-msw systems, this is assumed to be the case + #ifdef __WXMSW__ + BOOL b = TRUE; + SystemParametersInfo(38 /*SPI_GETDRAGFULLWINDOWS*/, 0, &b, 0); + m_solid_drag = b ? true : false; + #endif + SetExtraStyle(wxWS_EX_PROCESS_IDLE); } @@ -126,6 +136,20 @@ void wxFloatingPane::OnClose(wxCloseEvent& evt) void wxFloatingPane::OnMoveEvent(wxMoveEvent& event) { + if (!m_solid_drag) + { + // systems without solid window dragging need to be + // handled slightly differently, due to the lack of + // the constant stream of EVT_MOVING events + if (!isMouseDown()) + return; + OnMoveStart(); + OnMoving(event.GetRect(), wxNORTH); + m_moving = true; + return; + } + + wxRect win_rect = GetRect(); if (win_rect == m_last_rect) @@ -194,7 +218,7 @@ void wxFloatingPane::OnMoveEvent(wxMoveEvent& event) if (m_last3_rect.IsEmpty()) return; - OnMoving(event.GetRect(), dir ); + OnMoving(event.GetRect(), dir); } void wxFloatingPane::OnIdle(wxIdleEvent& event) @@ -206,7 +230,7 @@ void wxFloatingPane::OnIdle(wxIdleEvent& event) m_moving = false; OnMoveFinished(); } - else + else { event.RequestMore(); } -- 2.45.2