]> git.saurik.com Git - wxWidgets.git/commitdiff
Improved selection mode handling in wxGrid::SelectBlock
authorStefan Neis <Stefan.Neis@t-online.de>
Mon, 13 Mar 2000 22:11:24 +0000 (22:11 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Mon, 13 Mar 2000 22:11:24 +0000 (22:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/gridsel.h
src/generic/grid.cpp

index b521834cc7310299bfb9a9409aec183f1a29471c..c44819a419100464ee7d7f1fd2d3c7b9d22c6434 100644 (file)
@@ -29,6 +29,7 @@ public:
     bool IsSelection();
     bool IsInSelection ( int row, int col );
     void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
+    wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; }
     void SelectRow( int row,
                     bool ControlDown = FALSE,  bool ShiftDown = FALSE,
                     bool AltDown = FALSE, bool MetaDown = FALSE );
index 65a3603c05aef9ecabc2a4567fcb6691c02b061e..2a8075f2267de94d2cb8172ba436324531483d47 100644 (file)
@@ -7665,7 +7665,17 @@ void wxGrid::SelectBlock( int topRow, int leftCol, int bottomRow, int rightCol )
 {
     int temp;
     wxGridCellCoords updateTopLeft, updateBottomRight;
-
+    
+    if ( m_selection->GetSelectionMode() == wxGrid::wxGridSelectRows )
+    {
+        leftCol = 0;
+        rightCol = GetNumberCols() - 1;
+    }
+    else if ( m_selection->GetSelectionMode() == wxGrid::wxGridSelectColumns )
+    {
+        topRow = 0;
+        bottomRow = GetNumberRows() - 1;
+    }
     if ( topRow > bottomRow )
     {
         temp = topRow;