[Overview][Types][Classes][Procedures and functions][Index] | Reference for unit 'ShellCtrls' (#lcl)

# TCustomShellTreeView

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The base class for a tree view control used to display files, directories and other objects (such as devices) from the local file system.

## Declaration

Source position: shellctrls.pas line 80

`type TCustomShellTreeView = class(TCustomTreeView)`
`protected`
`class procedure WSRegisterClass; override;`
`procedure DoCreateNodeClass(); override;` |  | Performs actions needed to create a new tree node in the shell control.
`procedure Loaded; override;` |  | Performs actions needed when LCL component streaming has been completed.
`function CreateNode; override;` |  | Creates a new tree node for the shell control.
`function PopulateTreeNodeWithFiles();` |  | Adds tree nodes for file system objects found starting at the specified node / path.
`procedure DoSelectionChanged; override;` |  | Performs actions needed when a new item is selected in the shell control.
`procedure DoAddItem();` |  | Performs actions needed to add a new tree node to the shell control.
`function CanExpand(); override;` |  | Determines if the specified tree node can be expanded in the shell tree view control.
`procedure Collapse(); override;` |  | Removes child nodes (if needed) when the specified tree node is collapsed.
`function DrawBuiltInIcon(); override;` |  | Draws the Shell Icon for the specified tree node.
`function ExistsAndIsValid();` |  | Checks whether the specified path is a valid file system object and type for the tree view control.
`function GetBuiltinIconSize; override;` |  | Gets the size for a shell icon used in the control.
`function NodeHasChildren(); override;` |  | Determines whether the specified tree view Node has child nodes.
`property ExpandCollapseMode: TExpandCollapseMode; [rw]` |  | Controls the actions performed when a tree node is expanded or collapsed on the control.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`class function GetBasePath;` |  | Returns the initial path in the file system hierarchy for the tree structure in the control.
`function GetRootPath;` |  | Returns the effective value for Root when an explicit value has not been assigned.
`class procedure GetFilesInDir();` |  | Fills a TStrings instance with file system objects which match the specified path and mask.
`function GetPathFromNode();` |  | Returns the path (including the file name) for the file system object represented in the specified node.
`procedure PopulateWithBaseFiles;` |  | Fills the tree view when the Root directory is empty.
`procedure Refresh(); overload;` |  | Updates the tree view to display file system objects starting at the specified tree node.
`procedure UpdateView();` |  | Reloads the nodes for tree view control and synchronizes an associated ShellListView control.
`property UseBuiltinIcons: Boolean; [rw]` |  | Indicates if OS-provided icons are used for entries in the Shell control.
`property ObjectTypes: TObjectTypes; [rw]` |  | Indicates the file system objects displayed using the control.
`property ShellListView: TCustomShellListView; [rw]` |  | Connects this ShellTreeView to a ShellListView.
`property FileSortType: TFileSortType; [rw]` |  | Indicates the sort type used for items (tree nodes) on the tree view control.
`property Root: string; [rw]` |  | Indicates the directory or path which is the top-level node in the tree view.
`property Path: string; [rw]` |  | Path to the directory displayed in the shell control.
`property OnAddItem: TAddItemEvent; [rw]` |  | Event handler signalled when an item (tree node) is added to the shell control.
`property OnSortCompare: TFileItemCompareEvent; [rw]` |  | Event handler signalled to compare file items in a custom sort routine.
`property Items: TTreeNodes;` |  | Contains the tree nodes used to represent the hierarchical tree structure for the tree view control.
`end;`

## Inheritance

`TCustomShellTreeView` |  | The base class for a tree view control used to display files, directories and other objects (such as devices) from the local file system.
`TCustomTreeView` |  | The base class for TTreeView.
`TCustomControl` |  | The base class for windowed controls which paint themselves.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCustomShellTreeView is a TCustomTreeView descendant that defines the base class used to display files, directories, and other objects (such as devices) from the local file system. TCustomShellTreeView provides a hierarchical tree view for the file system objects, and is used to navigate between items in the control.

TCustomShellTreeView extends the ancestor class with properties, methods, and events needed to access, maintain, and navigate file system objects in the control. Applications should not create instances of TCustomShellTreeView; use the TShellTreeView class instead.

Remark: | Event handlers inherited from TCustomTreeView may include arguments which use TCustomTreeView or TTreeNode types. When they are implemented in TCustomShellTreeView, it is often necessary to cast these arguments to the TShellTreeNode or TCustomShellTreeView types to access properties and/or methods implemented in the descendent classes.

## See also

TShellTreeView |  | Implements a tree view control to display the files, directories and other objects (such as devices) from the local file system.
TCustomTreeView |  | The base class for TTreeView.