delphi - How to define that node of TVirtualStringTree is presented on screen? -
it's easy check node visible. don't know how rightly define node presented on screen. can find out so:
bottomnode := tree.bottomnode; node := tree.topnode; idbottomnode := tree.absoluteindex(bottomnode); while tree.absoluteindex(node) <> idbottomnode begin node := node.nextsibling; if not assigned(node) break; end;
(code without checking)
but think rather rough way. may there more accurate way?
you may write function follows. tree
parameter there specifies virtual tree, node
node want check if it's visible, , column
optional parameter index of column if need determine whether node , column visible in client rect:
function isnodevisibleinclientrect(tree: tbasevirtualtree; node: pvirtualnode; column: tcolumnindex = nocolumn): boolean; begin result := tree.isvisible[node] , tree.getdisplayrect(node, column, false).intersectswith(tree.clientrect); end;
but maybe there's more straightforward way...
Comments
Post a Comment