]> git.saurik.com Git - wxWidgets.git/commitdiff
Captured mouse in grid column label so the drag isn't prematurely and messily
authorJulian Smart <julian@anthemion.co.uk>
Mon, 20 May 2002 13:17:31 +0000 (13:17 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 20 May 2002 13:17:31 +0000 (13:17 +0000)
ended when moving out of the column label window.

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

src/generic/grid.cpp

index 024de20fb01792a6209215ed5a6a001f5105b106..b91e97dca584cc0c1919f411c0ed92bc4e1fb264 100644 (file)
@@ -4583,7 +4583,11 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
 
     if ( event.Dragging() )
     {
-        m_isDragging = TRUE;
+        if (!m_isDragging)
+        {
+            m_isDragging = TRUE;
+            m_colLabelWin->CaptureMouse();
+        }
 
         if ( event.LeftIsDown() )
         {
@@ -4629,8 +4633,14 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event )
         return;
     }
 
-    m_isDragging = FALSE;
+    if ( m_isDragging && (event.Entering() || event.Leaving()) )
+        return;
 
+    if (m_isDragging)
+    {
+        m_colLabelWin->ReleaseMouse();
+        m_isDragging = FALSE;
+    }
 
     // ------------ Entering or leaving the window
     //