From: Stefan Neis Date: Mon, 13 Mar 2000 22:11:24 +0000 (+0000) Subject: Improved selection mode handling in wxGrid::SelectBlock X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/399b60a0ad232265cd74ce8bf6a53a1f2cc57ff2?ds=inline Improved selection mode handling in wxGrid::SelectBlock git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/gridsel.h b/include/wx/generic/gridsel.h index b521834cc7..c44819a419 100644 --- a/include/wx/generic/gridsel.h +++ b/include/wx/generic/gridsel.h @@ -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 ); diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 65a3603c05..2a8075f226 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -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;