There is currently no such method to get the node visibility index. But you can make your own, where you will go through visible nodes and count each iteration. Something like this (how you implement it in real code):
function GetVisibleIndex(Tree: TBaseVirtualTree; Node: PVirtualNode): Integer;
var
P: PVirtualNode;
begin
Assert(Assigned(Node), 'Node must not be nil!');
Assert(Tree.IsVisible[Node], 'Node must be visible!');
Result := 0;
P := Tree.GetFirstVisible;
while Assigned(P) and (P <> Node) do
begin
Inc(Result);
P := Tree.GetNextVisible(P);
end;
end;
TLama source
share