]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Reordered the slow-click test, otherwise it would never
[wxWidgets.git] / 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 )
         {