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

TCustomShellTreeView.CanExpand

Determines if the specified tree node can be expanded in the shell control.

Declaration

Source position: shellctrls.pas line 87

protected function TCustomShellTreeView.CanExpand(

  Node: TTreeNode

):Boolean; override;

Arguments

Node

  

Tree node examined in the method.

Function result

True when the tree node contains child nodes and be expanded.

Description

CanExpand is an overridden Boolean function used to determine if the specified tree node can be expanded in the shell control. Node contains the TTreeNode examined in the method.

CanExpand calls the inherited method to signal the OnExpanding event handler (when assigned). No additional actions are performed if the inherited method returns False.

CanExpand temporarily disables the AutoExpand functionality in the shell control, and removes all child tree nodes in Node. The child nodes are re-created using the PopulateTreeNodeWithFiles method. This ensures that the shell control reflects the current content in the local file system during execution of the method. The value in AutoExpand is restored to its original value prior to exiting from the method.

The entire update process is done in a BeginUpdate / EndUpdate block to reduce the number of screen refreshes in the method.

See also

TCustomShellTreeView.PopulateTreeNodeWithFiles

  

Adds tree nodes for file system objects found starting at the specified node / path.

TShellTreeView.AutoExpand

  

Unfold a tree-item when user clicks it or an item activated by code.

TShellTreeNode

  

Represents tree nodes in TShellTreeView.

TTreeNode

TCustomTreeView.AutoExpand

  

Unfold a tree-item when user clicks it or an item activated by code.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.