Guest User

Untitled

a guest
Jul 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. if Node.Index mod 2 = 0 then
  2. begin
  3. TargetCanvas.Brush.Color := clBlack;
  4. TargetCanvas.FillRect(CellRect);
  5. end
  6. else
  7. begin
  8. TargetCanvas.Brush.Color := clPurple;
  9. TargetCanvas.FillRect(CellRect);
  10. end;
  11.  
  12. function GetVisibleIndex(Tree: TBaseVirtualTree; Node: PVirtualNode): Integer;
  13. var
  14. P: PVirtualNode;
  15. begin
  16. Assert(Assigned(Node), 'Node must not be nil!');
  17. Assert(Tree.IsVisible[Node], 'Node must be visible!');
  18.  
  19. Result := 0;
  20.  
  21. P := Tree.GetFirstVisible;
  22. while Assigned(P) and (P <> Node) do
  23. begin
  24. Inc(Result);
  25. P := Tree.GetNextVisible(P);
  26. end;
  27. end;
Add Comment
Please, Sign In to add comment