%HI_AddTreeItem function


Function
The function add an item to the specified Windows control of Tree view type (Control function).
Declaration
%HI_AddTreeItem(
   INT in refId, 
   TEXT in itemText, 
   INT in parentHandle, 
   INT in itemHandle
   [, HBJ in insertAfterHandle]
 ) 

Parameters
refId Reference to graphic object (reference variable).
itemText Text in the added item.
parentHandle Parent item identifier or 0.
itemHandle New item identifier.
insertAfterHandle Optional parameter - identifier of the item, after which you want to add new item. If the value is 0, the item will be inserted as the last one (as well as the parameter is not defined). If the value is -1, the item will be inserted as first one.

Description
The function adds the item to the tree view defined by the parameter refId. Each item is identified by a integer value, that is entered when the item is added. Therefore there can be defined the same identifier for two items.
The parameter itemText defines the text displayed within the item.
The parameter parentHandle determines the parent item of the added item. If the parameter is 0, the added item is a root item.
The function adds the new item to the end of current level (level is given by the parameter parentHandle). If you need to add the item after any of existing ones, you must define the item by the parameter insertAfterHandle.
Example
Adding items to the tree view as follows:


 
 ; two root items
 %HI_AddTreeItem(_tree, "10", 0, 10)
 %HI_AddTreeItem(_tree, "20", 0, 20)
 ; 
 %HI_AddTreeItem(_tree, "11", 10, 11)
 %HI_ExpandItem(_tree, 10, @TRUE)

 

The reference variable _tree identifies the tree view.


Napíšte komentár