The TREE container defines the presentation of a list of ordered records in a tree-view widget.
TREE [identifier] [ ( attribute [,...] ) ] { title [...] [name_column [|identifier [|...]] ] [...] } END
COMMENT, DOUBLECLICK, HIDDEN, FONTPITCH, STYLE, TAG, UNHIDABLECOLUMNS, UNMOVABLECOLUMNS, UNSIZABLECOLUMNS, UNSORTABLECOLUMNS, WANTFIXEDPAGESIZE, WIDTH, HEIGHT, PARENTIDCOLUMN, IDCOLUMN, EXPANDEDCOLUMN, ISNODECOLUMN, IMAGEEXPANDED, IMAGECOLLAPSED, IMAGELEAF.
To create a tree view, you must define the following elements in the form file:
Tree view definitions are very similar to regular table containers; before reading further about tree views, you should be familiar with TABLE containers.
The first column in the TREE container must be the field defining the text of the tree-view nodes. The screen array definition must have exactly the same number of columns as the TREE container. If column titles are used in the table layout, the first line of a table-area must be a set of text entries defining the column titles. The column title can contain blank characters, but several blanks will be interpreted as a column title separator. When column titles are used in the tree layout, the second line defines the columns, referencing form fields receiving data. Otherwise, the first line defines the columns. This line can be repeated several times on the other lines.
LAYOUT GRID { <Tree t1 > Name Index [c1 |c2 ] [c1 |c2 ] [c1 |c2 ] [c1 |c2 ] } END END ATTRIBUTES LABEL c1 = FORMONLY.name; LABEL c2 = FORMONLY.idx; PHANTOM FORMONLY.pid; PHANTOM FORMONLY.id; TREE t1: tree1 PARENTIDCOLUMN = pid, IDCOLUMN = id; END INSTRUCTIONS SCREEN RECORD sr_tree(name, pid, id, idx); END