mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:59:16 +02:00
lcl: return TListView.SelCount even if Handle is not allocated (bug #0011057)
git-svn-id: trunk@18404 -
This commit is contained in:
parent
fefaf6be1a
commit
a21dad9e56
@ -673,10 +673,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomListView.GetSelCount: Integer;
|
function TCustomListView.GetSelCount: Integer;
|
||||||
|
var
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if HandleAllocated
|
if HandleAllocated
|
||||||
then Result := TWSCustomListViewClass(WidgetSetClass).GetSelCount(Self)
|
then Result := TWSCustomListViewClass(WidgetSetClass).GetSelCount(Self)
|
||||||
else Result := 0;
|
else
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
for i := 0 to Items.Count - 1 do
|
||||||
|
if Items[i].Selected then
|
||||||
|
inc(Result);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user