]> git.saurik.com Git - wxWidgets.git/commitdiff
Reordered the slow-click test, otherwise it would never
authorJulian Smart <julian@anthemion.co.uk>
Tue, 13 May 2003 17:45:23 +0000 (17:45 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Tue, 13 May 2003 17:45:23 +0000 (17:45 +0000)
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

index 178c2fd8cdc13952d632f3683d7a6f277cb0970c..3e38c3085c089951e875cc6dc6a3aedcce31984f 100644 (file)
@@ -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 )
         {