TREE container

The TREE container defines the presentation of a list of ordered records in a tree-view widget.

Syntax

TREE [identifier] [ ( attribute [,...] ) ]
{
 title [...]
 [name_column   [|identifier   [|...]] ]
[...]
}  
END
  1. identifier defines the name of the element.
  2. attribute is an attribute for the element.
  3. title is the text to be displayed as column title.
  4. name_column is a mandatory column referencing a form item defining the node text.
  5. identifier references a form item.

Attributes

COMMENT, DOUBLECLICK, HIDDEN, FONTPITCH, STYLE, TAG, UNHIDABLECOLUMNS, UNMOVABLECOLUMNS, UNSIZABLECOLUMNS, UNSORTABLECOLUMNS, WANTFIXEDPAGESIZE, WIDTH, HEIGHT, PARENTIDCOLUMN, IDCOLUMN, EXPANDEDCOLUMN, ISNODECOLUMN, IMAGEEXPANDED, IMAGECOLLAPSED, IMAGELEAF.

Usage

To create a tree view, you must define the following elements in the form file:

  1. The layout of the tree-view, with a TREE container in the LAYOUT section.
  2. The column data types and field properties, in the ATTRIBUTES section.
  3. The field list definition to group form fields together with a screen array, in the INSTRUCTIONS section.

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