%tv - Tree Control


To insert a hierarchical tree.


winio@('%N.Mtv[options]', treenitemssel)
character(*) tree(nitems)     (input/output)
integer nitems     (input parameter)
integer sel     (input/output)
winio@('%`N.Mtv[options]', treenitemssel, icon_str)
character(*) icon_str     (input)


Grave accent (`) - for programmer supplied icons.

Caret (^) - call-back function that is called when the user selects an item.


This format has been superseded by %bv (Branch View). For new code consider using %bv instead.

N and M are not optional and specify the width and depth of the area in average characters.

tree is a character array of nitems.

sel is the index of the item selected by the user.

icon_str is a character string giving a list of icon resources in the form 'icon1,icon2'.

options can take the keyword fixed_font which causes the control to use a fixed font for the names of the tree nodes. This can be useful in cases where the node names are intended to line up. options can also take the keyword keep_focus to prevent the focus from shifting from the selected item. This is similar to the effect produced by a list box.

If variable_size is included as one of the options, nitems is treated as a variable that subsequently can be modified and updated by a call to WINDOW_UPDATE@. However, the size cannot be increased above its initial value. Since blank elements in the input array are ignored, the only reason to use this feature is to reduce the processing time (and therefore possible flicker) when using a very large array, most of whose elements are blank.

For further details see Tree-view.


Icon resource names can be constructed from known Windows (integer kind=7) handles (see Using the handle of a resource).


cl_book ICON book1.ico      (resource file)
op_book ICON book2.ico

See also

%bv (Branch View), %ls (List Box (or Combo Box)), %ms (Multi-select Box), %pb (Parameter Box), %ps (Property Sheet Container), SEE_TREEVIEW_SELECTION@




Copyright © 1999-2024 Silverfrost Limited