mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 15:39:14 +02:00
LCL: TCustomListView: allow to change ItemIndex in OwnerData mode. issue #19825
git-svn-id: trunk@35264 -
This commit is contained in:
parent
3603901d03
commit
353087a643
@ -1193,10 +1193,20 @@ procedure TCustomListView.SetItemIndex(const AValue: Integer);
|
||||
begin
|
||||
if (AValue < -1) or (AValue >= Items.Count) then
|
||||
raise Exception.CreateFmt(rsListIndexExceedsBounds,[AValue]);
|
||||
|
||||
if OwnerData then
|
||||
FSelectedIdx := AValue;
|
||||
if AValue = -1 then
|
||||
Selected := nil
|
||||
else
|
||||
Selected := Items.Item[AValue];
|
||||
begin
|
||||
Selected := nil;
|
||||
end else
|
||||
begin
|
||||
// trigger ws selection update, it'll update Selected too
|
||||
if OwnerData then
|
||||
Items.Item[AValue].Selected := True
|
||||
else
|
||||
Selected := Items.Item[AValue];
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user