]> git.saurik.com Git - wxWidgets.git/commitdiff
aui docking works well on systems with solid window dragging turned off
authorBenjamin Williams <bwilliams@kirix.com>
Tue, 31 Oct 2006 13:12:36 +0000 (13:12 +0000)
committerBenjamin Williams <bwilliams@kirix.com>
Tue, 31 Oct 2006 13:12:36 +0000 (13:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/aui/floatpane.h
src/aui/floatpane.cpp

index 158c0a272ba9937d68fbf27abffb72a5ea9ceb2c..afa1416db12d6d9d199d8bc4ea270455ce45b018 100644 (file)
@@ -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;
index 5d9c010da25341ee66148f86b5f32d43dcbb170a..595a0a5629cebf58c3aa124b84e900c6351d6c6a 100644 (file)
@@ -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();
         }