Menu ▾ ▴

#13 TREESELECT for virtual trees (TVirtualStringTree)

open
nobody
None
4 hours ago
4 hours ago
No

TREESELECT (#11) works on TTreeView only. Many IDE views are TVirtualStringTrees, among them the page tree of the Options dialog from Delphi 10.3 on, so there it answers "... is a TVirtualStringTree, not a tree view".

What is known:

  • Reading works already. TREETEXT reads such a tree by putting a handler in front of its OnGetText and making it repaint. Checked on the Options dialog of Delphi 13. It returns the visible rows only, without their level.
  • Selecting can be done with the tree's own keyboard handling. Posting WM_KEYDOWN for Down 14 times to the tree's window moved the focus to "GetIt Package Manager" and the dialog switched to that page, without the IDE being in the foreground. The tree expanded "Compiling and Running" on the way, because the focus passed it.
  • The tree's own properties for the focused and selected node are public, not published, so they cannot be set through RTTI.

Proposed: TREESELECT accepts virtual trees too, with the same path syntax. It finds the node from the rows TREETEXT reads, expands the parents and moves the focus there with key messages, so the tree runs its own change handlers. Where the path does not match, the answer lists the nodes at that level, as it does for TTreeView.

Discussion


Log in to post a comment.