1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-26 02:14:22 +00:00

Added additional dontScrollToShowThisRange parameter to selectRangeOfRows in ListBox

This commit is contained in:
luigisambuy 2016-07-25 11:03:37 +01:00
parent 9e1edc7a6e
commit f5398fcab2
2 changed files with 9 additions and 5 deletions

View file

@ -552,7 +552,7 @@ SparseSet<int> ListBox::getSelectedRows() const
return selected;
}
void ListBox::selectRangeOfRows (int firstRow, int lastRow)
void ListBox::selectRangeOfRows (int firstRow, int lastRow, bool dontScrollToShowThisRange)
{
if (multipleSelection && (firstRow != lastRow))
{
@ -566,7 +566,7 @@ void ListBox::selectRangeOfRows (int firstRow, int lastRow)
selected.removeRange (Range<int> (lastRow, lastRow + 1));
}
selectRowInternal (lastRow, false, false, true);
selectRowInternal (lastRow, dontScrollToShowThisRange, false, true);
}
void ListBox::flipRowSelection (const int row)

View file

@ -265,11 +265,15 @@ public:
This will add these rows to the current selection, so you might need to
clear the current selection first with deselectAllRows()
@param firstRow the first row to select (inclusive)
@param lastRow the last row to select (inclusive)
@param firstRow the first row to select (inclusive)
@param lastRow the last row to select (inclusive)
@param dontScrollToShowThisRange if true, the list's position won't change; if false and
the selected range is off-screen, it'll scroll to make
sure that the range of rows is on-screen
*/
void selectRangeOfRows (int firstRow,
int lastRow);
int lastRow,
bool dontScrollToShowThisRange = false);
/** Deselects a row.
If it's not currently selected, this will do nothing.