System Projects Reference > The Library Controls Include Project > Use the Library Controls > EquipTree Library Control
Equipment Tree Library Control

The Equipment Tree Genie (named "equiptree") allows you to create an in-memory menu hierarchy. It has the following parameters:

Note: For the Genie to work, a report server needs to be defined in your project and accessible at runtime.

Parameter

Description

Tree Name

Name of the tree. Used to identify the Genie when on a graphics page. Each tree on a page must have a unique name.

Width

Pixel width of the table at runtime.

Note:Leave the size of the Genie at design time as 100 pixels, as it will be automatically calculated at runtime.

Menu Name

Name of the menu that stores the content that will be used by the tree. By default, "_Equip" is used. This specifies that all of the equipment hierarchy will be used (based on what is available to the current user).

If you apply a filter expression to the tree using the Filter parameter (see below), you need to enter a unique menu name, as all EquipTree controls share the same equipment tree if they are assigned to the same menu name.

Number of items

Number of items displayed on the page.

Item Height

Pixel height of item in the tree display.

Show CheckBox

True/False drop down box. False is selected by default. Determines whether to show the checkboxes next to each of the tree items.

Force Child

True/False drop down box. False is selected by default. Determines whether to force all children tree items to follow the checked status of their parent when the latter is checked / unchecked.

Window Inst

True/False drop down box. True is selected by default. Determines whether create a new instance of the equipment hierarchy on each window where the equipment tree is displayed.

Refresh Rate

The minimum (quickest possible) rate that the control will be redrawn.

The control is only redrawn as required upon changes to the layout, scrolling or other user initiated events.

Expand Level

The minimum expand level of the tree hierarchy. Set to 0 to allow the tree be collapsed to its root items.

Horizontal Scrollbar (Optional)

The name of the horizontal scroll bar Genie on the page that allows the user to horizontally scroll the content displayed on the control Genie If you will not require horizontal scrolling, leave this field blank.

Vertical Scrollbar (Optional)

The name of the horizontal scroll bar Genie on the page that allows the user to vertically scroll the content displayed on the control Genie If you will not require vertical scrolling, leave this field blank.

Label Font

The font used for displaying the tree item label.

Item Font

The font used for displaying the optional dynamic text next to the tree item.

Symbol Library (Optional)

The name of the symbol library that contains the symbols for displayed next to the tree items.

Refresh Rate

The minimum rate that the control will be redrawn.

Note: The control is only redrawn as required upon changes to the layout, scrolling or other user initialized events.

Scan Delay

The number of page scan delay before the Genie is initialized at runtime. This can be set to different number on different control Genies to stagger the initialization order.

Expand Level

The minimum expand level of the tree hierarchy. Set this to 0 to allow the tree to be collapsed to its root items.

Filter (Optional)

A filter expression specifying the equipment records that will be available to the tree. If it is not specified, all equipment available to the currently logged on user will be returned.

If you apply a filter, you need to enter a unique name in the Menu Name parameter (see above). A unique menu name will allow you to determine which filter settings apply to a particular menu.

Intialize

Callback function that is called when the control initializes. The callback function should return either TRUE (1) for success or FALSE (0) for unsuccessful. By default, if the user specified function does not initialize, the control Genie will retry the function a few times before giving up. This callback only supports the #Name keyword which represents the name assigned to the control Genie.

Row Item

Callback function that is called when the table initializes The callback function should return a string value. The value returned will be displayed next to the tree item label. It supports the following keyword in its argument list:

#Name - name assigned to the Genie.

#Ref – the complete path of the tree item.

#Label – the label of the tree item.

#ItemDsp- the position of the item as displayed on screen.

#IsChecked - the checked status of the tree item.

#IsParent - whether the item is expanded/collapsed.

#ItemDsp - the position of the item as displayed on screen.

#Node - the handle to the internal menu node object that represents the tree item.

#Level - the level of the tree item.

Selected

Callback function that is called when a tree item is selected. No particular return value is expected from this function, and it supports the same set of keywords as that of the Row Item function in its argument list. Callback function that is called when the check box of a tree item is clicked. No particular return value is expected from this function, and it supports the same set of keywords as that of the Row Item function in its argument list.

Checked

Callback function that is called when a tree item is selected. No particular return value is expected from this function, and it supports the same set of keywords as that of the Row Item function in its argument list. Callback function that is called when the check box of a tree item is clicked. No particular return value is expected from this function, and it supports the same set of keywords as that of the Row Item function in its argument list.

Left Mouse

Callback function that is called when the user clicks the left mouse button No particular return value is expected from this function, and it supports the following keywords in its argument list:

#Node - the handle to the internal menu node object that represents the tree item.

#Level - the level of the tree item.

Right Mouse

Callback function that is called when the user clicks the right mouse button. It uses the same specification as that of the Left mouse callback .

Double Click

Callback function that is called when the user double-click the left mouse button. It uses the same specification as that of the Left mouse callback.

Tree Reload

Callback function that is called when the control is redrawn. No particular return value is expected from this function, and it supports the following keywords in its argument list:

#Name = name assigned to the Genie.

Tree Name

Name of table (max characters). Used to identify the Genie when on a graphics page.

Width

Pixel width of the table at runtime.

Note:Leave the size of the Genie at design time as 100 pixels, as it will be automatically calculated at runtime.

Note: The project will compile and run when configured with longer equipment names, a runtime error may occur when you attempt to interact with the tree display based on the 'EquipTree' Genie. When this happens, an alarm icon will appear on the tree view, and a "Too few arguments for function or argument string too long" hardware alarm will be reported. This usually indicates either the equipment name is too long or the name of the tree Genie is too long.

See Also

Published June 2018