mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 19:57:14 +01:00
LCL: Prevent scrolling in the default Widgetset implementation of ListBox.SelectRange. Fix off by 1 error. Part of issue #0036929.
git-svn-id: trunk@63337 -
This commit is contained in:
parent
f0e8acae66
commit
703f17cf32
@ -368,10 +368,17 @@ end;
|
||||
class procedure TWSCustomListBox.SelectRange(const ACustomListBox: TCustomListBox;
|
||||
ALow, AHigh: integer; ASelected: boolean);
|
||||
var
|
||||
i: Integer;
|
||||
OldTopIndex, i: Integer;
|
||||
begin // A default implementation. A widgetset can override it with a better one.
|
||||
for i := ALow to AHigh - 1 do
|
||||
SelectItem(ACustomListBox, i, ASelected);
|
||||
OldTopIndex := ACustomListBox.TopIndex; //prevent scrolling to last Item selected on Windows, Issue #0036929
|
||||
ACustomListBox.Items.BeginUpdate; //prevent visual update when selecting large ranges on Windows, Issue #0036929
|
||||
try
|
||||
for i := ALow to AHigh do
|
||||
SelectItem(ACustomListBox, i, ASelected);
|
||||
ACustomListBox.TopIndex := OldTopIndex;
|
||||
finally
|
||||
ACustomListBox.Items.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TWSCustomListBox.SetBorder(const ACustomListBox: TCustomListBox);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user