How to define that node of TVirtualStringTree is presented on screen?

前端 未结 1 332
暖寄归人
暖寄归人 2020-12-11 06:09

It\'s easy to check that node is visible. But I don\'t know how to rightly define that node is presented on screen. I can find out only so:

BottomNode := Tre         


        
相关标签:
1条回答
  • 2020-12-11 06:50

    You may write a function like follows. The Tree parameter there specifies the virtual tree, the Node is the node for which you want to check if it's visible, and the Column optional parameter is the index of a column if you would need to determine whether the node and even column is visible in client rect:

    function IsNodeVisibleInClientRect(Tree: TBaseVirtualTree; Node: PVirtualNode;
      Column: TColumnIndex = NoColumn): Boolean;
    begin
      Result := Tree.IsVisible[Node] and
        Tree.GetDisplayRect(Node, Column, False).IntersectsWith(Tree.ClientRect);
    end;
    

    But maybe there's a more straightforward way...

    0 讨论(0)
提交回复
热议问题