get_tree_length, get_tree_selected,
tree_parent, tree_child, tree_next_brother
Entity: functions

insert_tree_item, delete_tree_item,
get_tree_item, set_tree_item,
clean_the_tree, set_tree_icons
Entity: predicates


Usage:
L is get_tree_length(Tree_Box)
S is get_tree_selected(Tree_Box)
R is tree_parent(Tree_Box, Item)
R is tree_child(Tree_Box, Item)
R is tree_next_brother(Tree_Box, Item)
insert_tree_item(Tree_Box, Item_Handle, Parent, After, Text, Icon1, Icon2)
delete_tree_item(Tree_Box, Item)
get_tree_item(Tree_Box, Item, Text, Icon1, Icon2)
set_tree_item(Tree_Box, Item, Text, Icon1, Icon2)
clean_the_tree(Tree_Box)
set_tree_icons(Tree_Box, Icon1, Icon2, ...)
 

Tree Box

In all tree box functions and predicates you have to specify (in Tree_Box) which tree box have to be used. Everywhere Item is the handle of the tree item which has to be used.  For Item you have to use "root", "last" or the value returned by some tree function.

Number is get_tree_length(Tree_Box)
Returns the number of items which are in Tree_Box.

Item is get_tree_selected(Tree_Box)
Returns the position of the selected item in Tree_Box. If there is not any item selected then this function fails.

Parent is tree_parent(Tree_Box, Item)
Returns a handle of the item which is parent of Item. If it has not parent then "root" will be returned.

Child is tree_child(Tree_Box, Item)
Returns a handle of the item which is the first child of Item.

Brother is tree_next_brother(Tree_Box, Item)
Returns a handle of the item which is the next child of the same parent as Item. If this is the last child of the same parent then this function will fail.

insert_tree_item(Tree_Box, Item_Handle, Parent, After, Text, Icon1, Icon2)
Inserts item at position which is determined by the handles of the items Parent and After with label Text and icons Icon1 and Icon2. The first icon is for not selected state and the second is for the selected state. Icon1and Icon2 have to be numbers from the list added by set_tree_icons. The handle of the new item will be returned in the variable Item_Handle.

delete_tree_item(Tree_Box, Item)
Deletes the item which has handle Item.

get_tree_item(Tree_Box, Item, Text, Icon1, Icon2)
Takes the item with handle Item and returns in the variables Text, Icon1and Icon2 the text and the numbers of the icons which are for not selected and for the selected states.

set_tree_item(Tree_Box, Item, Text, Icon1, Icon2)
Takes the item with handle Item and changes its text with Text and icons with Icon1and Icon2 (which are for not selected and for the selected states). Icon1and Icon2 have to be numbers from the list added by set_tree_icons.

clean_the_tree(Tree_Box)
Deletes all items in the Tree_Box.

set_tree_icons(Tree_Box, Icon1, Icon2, ...)
Attach to the Tree_Box a list of icons. The tree box needs this list of icons to put them at the tree items. Icon1, Icon2, ... have to be strings containing file names of ICO files.

Look at the example:
Tree Box.spj (in folder Examples)