delphi - Color VirtualStringTree rows with hidden nodes -
I am currently using this code in my code's OnBeforeCellPaint event:
If node. Index mod 2 = 0 then start TargetCanvas.Brush.Color: = clBlack; TargetCanvas.FillRect (CellRect); End and Start TargetCanvas.Brush.Color: = clPurple; TargetCanvas.FillRect (CellRect); End;
To paint my nodes but it does not work with hidden nodes because the index remains the same. Is there a visible index or an easy solution?
Thanks in advance.
There is no such method to obtain the visibility node index at this time But you can make your own, where you repeat through visual nodes and calculate each iteration. Something like that (how do you apply it to the actual code on you):
function GetVisibleIndex (tree: TBVVertualTree; node: Piviular Node): Integer; Var P: P Virtual Node; Start (start the assigned (node), 'node should not be zero!'); Claim (tree. Asi [node], 'node should be visible!'); Results: = 0; P: = Tree. GetfirstSwibel; While assigned (P) and (P & lt; & gt; node) Ink (results); P: = tree. Guttaption utility (P); End; End;
Comments
Post a Comment