There is a problem using .IsVisible [] or .IsFiltered [], and it is very slow, I have a probe filter in a tree with 25,000 nodes and too slow.
aproach, Include (Node.states, vsFiltered) (Node.States, vsVisible), Node. , ( ).
, 25 000 , , , :
procedure TFC_Articulo.Filtrar(Filtro:String);
var
Node:PVirtualNode;
Data:PArticulo;
begin
Node := TV.GetFirst;
TV.RootNode.TotalHeight:=TV.DefaultNodeHeight;
while Assigned(Node) do
begin
Data:=TV.GetNodeData(Node);
Exclude(Node.States,vsFiltered);
if ComparationHereForDetermineFiltering then
Include(Node.States,vsFiltered)
else
Inc(TV.RootNode.TotalHeight,Node.NodeHeight);
Node:=TV.GetNext(Node);
end;
TV.RootNode.TotalHeight:=TV.RootNode.TotalHeight+TV.BottomSpace;
TV.UpdateScrollBars(True);
end;
,
...