Sign in Join
FPDoc Onlineexperiment

TCustomShellTreeView.UpdateView procedure

Member of TCustomShellTreeViewpublicIn unit ShellCtrls

Reloads the nodes for tree view control and synchronizes an associated ShellListView control.

Declaration

pascal
procedure UpdateView(AStartDir: string='')

Description

UpdateView is a method used to repopulate the nodes on a tree view control. It ensures that Items contains the entries needed for the current state of the local file system in the tree view control.

UpdateView ensures that the Selected and expanded tree node(s) are captured, and restored when the nodes in Items have been reloaded. If one of the selected or expanded nodes no longer exists on the file system, the Path in an existing parent node is used for the update. When a node is updated, its HasChildren property is changed to reflect whether subdirectories have been added or removed for the node.

The Selected property provides the selected tree node on the control.

Updates to the Items in the control are enclosed by BeginUpdate and EndUpdate method calls to reduce the number of updates while the control is reloaded.

UpdateView causes an associated ShellListView control to call its UpdateView method to synchronize the two controls. This action is omitted if ShellListView has not been assigned, or the directory requested does not affect the Selected tree node.

See also

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.