From: Julian Smart Date: Mon, 20 May 2002 13:17:31 +0000 (+0000) Subject: Captured mouse in grid column label so the drag isn't prematurely and messily X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fe77cf604a21504f06c1d667a64676af4b257c4c Captured mouse in grid column label so the drag isn't prematurely and messily 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 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 024de20fb0..b91e97dca5 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -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 //