From 932b55d0d60650d8337e1343105a1e98df268127 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 13 May 2003 17:45:23 +0000 Subject: [PATCH] Reordered the slow-click test, otherwise it would never be fired if in row-select more. Also added a ClearSelection, which was omitted in the changes since 2.4. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/grid.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 178c2fd8cd..3e38c3085c 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -5427,7 +5427,20 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) m_winCapture = NULL; } - if ( m_selectingTopLeft != wxGridNoCellCoords && + if ( coords == m_currentCellCoords && m_waitForSlowClick && CanEnableCellControl()) + { + ClearSelection(); + EnableCellEditControl(); + + wxGridCellAttr* attr = GetCellAttr(coords); + wxGridCellEditor *editor = attr->GetEditor(this, coords.GetRow(), coords.GetCol()); + editor->StartingClick(); + editor->DecRef(); + attr->DecRef(); + + m_waitForSlowClick = FALSE; + } + else if ( m_selectingTopLeft != wxGridNoCellCoords && m_selectingBottomRight != wxGridNoCellCoords ) { if ( m_selection ) @@ -5449,21 +5462,6 @@ void wxGrid::ProcessGridCellMouseEvent( wxMouseEvent& event ) // drag-shrinking. ShowCellEditControl(); } - else - { - if( m_waitForSlowClick && CanEnableCellControl()) - { - EnableCellEditControl(); - - wxGridCellAttr* attr = GetCellAttr(coords); - wxGridCellEditor *editor = attr->GetEditor(this, coords.GetRow(), coords.GetCol()); - editor->StartingClick(); - editor->DecRef(); - attr->DecRef(); - - m_waitForSlowClick = FALSE; - } - } } else if ( m_cursorMode == WXGRID_CURSOR_RESIZE_ROW ) { -- 2.45.2