Top  | Previous | Next

Tree View

Trees are useful for navigating<br>
hierarchies.

Trees are useful for navigating
hierarchies.

Description

The Tree View component can display any tree hierarchy. It is configured by filling in a dataset. Each row in the dataset will become a node in the tree. Each node has a path, for example, "West Area/Process/Valve1" that determines its location in the tree. The Separation Character property (by default it is forward-slash), dictates how the paths are broken up. Any missing folder nodes needed by a leaf node are created implicitly.

 

The other columns in the dataset besides "Path" are used to configure the look for the node, both when it is selected and when it is not. Columns with the following names (case-insensitive) in the dataset will be recognized:

Path - the path determines the node's location. Broken up into a list by splitting on the separation character.
Text - the text of the node while not selected.
Icon - a path to an icon for the node. Use the value: "default" to use the tree automatic folder/leaf icons.
Background - a string column that will be coerced into a color for the unselected background. e.g. "white" or "(255,255,255)" Use an empty string to use the default color.
Foreground - a string representation of the unselected foreground color
Tooltip - if not empty, will be used as the tooltip for the node.
Border - a string that will be coerced into a Border for the node while unselected. May be empty.
SelectedText - the text of the node while selected.
SelectedIcon - a path to an icon for the node while selected. Use the value: "default" to use the tree automatic folder/leaf icons.
SelectedBackground - a string representation of the selected foreground color
SelectedForeground - a string representation of the selected foreground color
SelectedTooltip - if not empty, will be used as the tooltip for the node while selected.
SelectedBorder - a string that will be coerced into a Border for the node while selected. May be empty.

 

The Selected Item property will be updated as the user selects different nodes in the tree. It represents the index in the Items dataset at which the node is defined. If the selected node was implicitly created, the Selected Item will be -1. You can use this index to get the path and name of the selected node with an expression binding like this:

if ({Root Container.Tree View.selectedItem}<0,"n/a",

{Root Container.Tree View.data}[{Root Container.Tree View.selectedItem},"text"])

 

Properties

Appearance

Font

Font of text of this component

Scripting name

font

Data type

Font

Background Color

The background color of the component.

Scripting name

background

Data type

Color

Row Height

The height of each row in the tree

Scripting name

rowHeight

Data type

int

Show Root Handles

Whether or not to show handles next to parent nodes

Scripting name

showRootHandles

Data type

boolean

Default Node Background

The default background of a node if no background is set

Scripting name

defaultBackground

Data type

Color

Flags

expert

Default Node Foreground

The default foreground of a node if no foreground is set

Scripting name

defaultForeground

Data type

Color

Flags

expert

Default Node Border

The default border of a node if no border is set

Scripting name

defaultBorder

Data type

Border

Flags

expert

Default Node Selected Background

The default selected background of a node if no background is set

Scripting name

defaultSelectedBackground

Data type

Color

Flags

expert

Default Node Selected Foreground

The default selected foreground of a node if no foreground is set

Scripting name

defaultSelectedForeground

Data type

Color

Flags

expert

Default Node Selected Border

The default selected border of a node if no border is set

Scripting name

defaultSelectedBorder

Data type

Border

Flags

expert

Default Leaf Icon

The default leaf icon if no icon is set

Scripting name

defaultLeafIconPath

Data type

String

Flags

expert

Default Open Icon

The default open icon if no icon is set

Scripting name

defaultOpenIconPath

Data type

String

Flags

expert

Default Closed Icon

The default closed icon if no icon is set

Scripting name

defaultClosedIconPath

Data type

String

Flags

expert

Line Style

The tree's line style

Scripting name

lineStyle

Data type

int

Flags

expert

Values

0

Angled

2

None

Antialias

Draw with antialias on? Makes text smoother

Scripting name

antialias

Data type

boolean

Flags

expert

Behavior

Separation Character

The separation character for the path

Scripting name

separationCharacter

Data type

String

Auto Sort

Whether or not to automatically sort the tree

Scripting name

autoSort

Data type

boolean

Auto Expand

If true, the tree will automatically expand the tree structure up to the level specified by Auto Expansion Level.

Scripting name

autoExpand

Data type

boolean

Auto Expansion Level

If Auto Expand is true, this is the depth level that will be expanded. Zero means expand-all.

Scripting name

autoExpansionLevel

Data type

int

Flags

bindable

Selection Mode

What kind of selection regions does the tree allow.

Scripting name

selectionMode

Data type

int

Values

1

Single Selection

2

Multiple - Contiguous

4

Multiple - Discontiguous

Common

Name

The name of this component.

Scripting name

name

Data type

String

Flags

bindable

Enabled

If disabled, a component cannot be used.

Scripting name

componentEnabled

Data type

boolean

Visible

If disabled, the component will be hidden.

Scripting name

visible

Data type

boolean

Flags

bindable

Border

The border surrounding this component. NOTE that the border is unaffected by rotation.

Scripting name

border

Data type

Border

Mouseover Text

The text that is displayed in the tooltip which pops up on mouseover of this component.

Scripting name

toolTipText

Data type

String

Data

Items

Contains the items of the tree view

Scripting name

data

Data type

Dataset

Flags

bindable

Selected Item

The index of the currently selected item, or -1 if no selection.

Scripting name

selectedItem

Data type

int

Flags

bindable

Selected Path

The path of the currently selected item, or "" if no selection.

Scripting name

selectedPath

Data type

String

Flags

bindable

Data Quality

The data quality code for any tag bindings on this component.

Scripting name

dataQuality

Data type

int

Flags

bindable | expert

Scripting

Events

The following event sets are fired by this component. See Component Event Handlers to learn more.

mouse
mouseMotion
propertyChange

 

Scripting Functions

clearSelection()

 

Clears the current selection.

Parameters

none

Returns

nothing

collapseAll()

 

Collapses all nodes in the tree.

Parameters

none

Returns

nothing

expandAll()

 

Expands all nodes in the tree.

Parameters

none

Returns

nothing

getSelectedItems()

 

Returns a list of the selected item's indexes. These are the row indexes that the selected tree nodes were found in the underlying dataset. Implicitly created folder nodes that have no index will not be included.

Parameters

none

Returns

int[]

getSelectedPaths()

 

Returns a list of the selected item's paths. A path to an item is the path to its parent plus its normal (non-selected) text.

Parameters

none

Returns

String[]