Modified <shift>+arrow key behaviour so that the starting cell is
authorMichael Bedward <mbedward@ozemail.com.au>
Tue, 7 Mar 2000 10:07:36 +0000 (10:07 +0000)
committerMichael Bedward <mbedward@ozemail.com.au>
Tue, 7 Mar 2000 10:07:36 +0000 (10:07 +0000)
included in the selection

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

src/generic/grid.cpp

index 754941202620c7662793e9ffc506b9d84722424a..fccc79f0851f0c18a36e913e47554b4d9413d76b 100644 (file)
@@ -6131,6 +6131,10 @@ bool wxGrid::MoveCursorUp( bool expandSelection )
     if ( m_currentCellCoords != wxGridNoCellCoords  &&
          m_currentCellCoords.GetRow() > 0 )
     {
+        if ( expandSelection )
+            m_selection->SelectCell( m_currentCellCoords.GetRow(),
+                                     m_currentCellCoords.GetCol() );
+        
         MakeCellVisible( m_currentCellCoords.GetRow() - 1,
                         m_currentCellCoords.GetCol() );
 
@@ -6149,11 +6153,13 @@ bool wxGrid::MoveCursorUp( bool expandSelection )
 
 bool wxGrid::MoveCursorDown( bool expandSelection )
 {
-    // TODO: allow for scrolling
-    //
     if ( m_currentCellCoords != wxGridNoCellCoords  &&
          m_currentCellCoords.GetRow() < m_numRows-1 )
     {
+        if ( expandSelection )
+            m_selection->SelectCell( m_currentCellCoords.GetRow(),
+                                     m_currentCellCoords.GetCol() );
+
         MakeCellVisible( m_currentCellCoords.GetRow() + 1,
                         m_currentCellCoords.GetCol() );
 
@@ -6175,6 +6181,10 @@ bool wxGrid::MoveCursorLeft( bool expandSelection )
     if ( m_currentCellCoords != wxGridNoCellCoords  &&
          m_currentCellCoords.GetCol() > 0 )
     {
+        if ( expandSelection )
+            m_selection->SelectCell( m_currentCellCoords.GetRow(),
+                                     m_currentCellCoords.GetCol() );
+
         MakeCellVisible( m_currentCellCoords.GetRow(),
                         m_currentCellCoords.GetCol() - 1 );
 
@@ -6196,6 +6206,10 @@ bool wxGrid::MoveCursorRight( bool expandSelection )
     if ( m_currentCellCoords != wxGridNoCellCoords  &&
          m_currentCellCoords.GetCol() < m_numCols - 1 )
     {
+        if ( expandSelection )
+            m_selection->SelectCell( m_currentCellCoords.GetRow(),
+                                     m_currentCellCoords.GetCol() );
+
         MakeCellVisible( m_currentCellCoords.GetRow(),
                         m_currentCellCoords.GetCol() + 1 );