Tree widget

Tree widget is a tree view that can display and control items and provides the possibility to add new items at any time. You can select one or many items (depending on the "selectionMode") and sort (see "setSorting" and "showSortIndicator") the list in increasing or decreasing order by any column.

You can add columns to a tree using the attribute "addColumn" and add items to the tree with "appendItem". The item structure can be defined only in the first column. The remaining columns can contain only description texts (column entry of an item) added with "setText". For an example see "appendItem".

An item can also be switched with another item using "moveItemId". Since the tree view offers multiple selection, it must display keyboard focus and selection state separately. Therefore, there are functions for setting the selection state of an item ( "setSelectedItem") and for what item displays keyboard focus ("currentItem").

If the selectionMode is single, you can select one item at a time, for example, by clicking an item or many items simultaneously when the selection mode is "Multi".

You can navigate the tree view either using the mouse or the keyboard. An item is closed using - icon (hides the children of the item) and opened using the + icon (the children of the item are displayed).

If you use "setSorting" and "showSortIndicator" and type letters with the focus in the tree view, a search will be started. If you, for example, type 'b', the current item will change to the first item that begins with the letter 'b'.

Figure 1. Tree Widget

To create a tree widget

  1. Click on the tree widget symbol in the GEDI.

  2. Click in the panel work area. Specify the size.

  3. Open the Property Sheet

  4. Enter the object name (Name).

  5. On the "Extended" tab define the attributes of the tree widget like "selectionMode" and "treeStepSize". (see Properties of complex graphics objects and Control/Control Graphics/Tree widget functions).

Note: A double-click on the tree widget in the panel during engineering opens the Clicked script.
Note: The space bar triggers the "Clicked" event of the tree widget and returns -2 as column number.
Note: The "RightMousePressed" event is activated when a right mouse press occurs on either the header or an element of the tree. The parameter "onHeader" is true when the press occurs on the header and false when not. A press on the header will also mean the "id" parameter is empty, whereas the elements pass their corresponding ID.