A Simple Tree Control

Description

The formatting string %S=BLR% is used to specify that tree should be displayed with the familiar boxes and lines. The "B" directive indicates that open/close boxes should be displayed; the "L" directive indicates that lines should be drawn on the tree control, and the "R" directive indicates that the open/close boxes should be drawn at the root level.

In addition to the BLR directive, the X directive can also be used. This causes the dialog to open with the tree control fully expanded.

dim data[10] as C
data[1] = "a.1.A"
data[2] = "a.1.B"
data[3] = "a.2.A"
data[4] = "a.2.B"
data[5] = "b.1.A"
data[6] = "b.1.B"
data[7] = "b.2.A"
data[8] = "b.2.B"
result=ui_dlg_box("Simple Tree",<<%dlg%
{ysize=2}
[%S=BLR%.32,10node^<data]
%dlg% )

A Simple Tree Control with Icons

images/XD_Tree Control_1.gif

When icons are displayed in the tree control, you can open a branch either by double clicking on the branch itself, or by single clicking on the icon to the left of the branch.

A Simple Tree Control - Showing the Return Variable

dim data[10] as C
data[1] = "a.1.A"
data[2] = "a.1.B"
data[3] = "a.2.A"
data[4] = "a.2.B"
data[5] = "b.1.A"
data[6] = "b.1.B"
data[7] = "b.2.A"
data[8] = "b.2.B"
result=ui_dlg_box("Simple Tree",<<%dlg%
{ysize=2}
[.32,10node^<data]
;
[.32node]
%dlg% )

The following diagram shows the tree control with several branches open.

images/XD_Tree Control_2.gif

Limitations

Desktop applications only.

See Also