Implements a control used to filter an associated TTreeView control.
treefilteredit.pas
contains classes and other types used to implement a control used to filter an associated TTreeView control. This file is part of the LazControls package.
Filter for an associated TreeView control.

This control has 2 different operation modes. One mode maintains and filters sub-items of root-nodes in a tree. The other mode filters the whole tree using the TreeNode.Visible property for each of the nodes.

Mode 1: Sub-branches under root nodes Items for each branch are maintained in a TTreeFilterBranch class instance.

Mode 2: A whole tree When no branches are defined (no calls made to GetBranch), the TreeFilterEdit control filters the whole tree automatically. It uses each TreeNode's Visible property to show/hide it.

The associated TreeView.
List of selected items. They are restored after filtering.
When a filtered text is a directory name, it is split and shown as a tree structure.

This has effect only in the "sub-branches" mode. The "whole tree" mode uses the existing tree nodes as is and only changes their visibility.

Tree branches are expanded also initially.

The branches are expanded in any case when the tree is filtered and matches are found. This setting only affects the initial state.

ImageIndex can be queried while filtering based on the node data.
Get an existing branch for a given tree-node, or Nil if there is none.

This can be used only with the "sub-branches" mode.

Get a new or existing branch with data cleared for a given tree-node.

This can be used only with the "sub-branches" mode. In fact calling this method switches the filter into "sub-branches" mode. This is the way to add those branches.

A branch associated with an existing TreeNode when the filter is used in "sub-branches" mode.
An existing TreeNode must be passed for the constructor.
Add a data item for this branch.

Text, a data reference, and an associated file name can be added for the node.