Silverfrost Logo About Us | Contact Us
 

%tv - Tree Control

Purpose

To insert a hierarchical tree.

Syntax

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)

Modifiers

Grave accent (`) - for programmer supplied icons.

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

Description

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.

Notes

Icon resource names can be contructed from known Windows handles (see Using the handle of a resource).

Example

winio@('%^`20.16tv',tree,15L,sel,'cl_book,op_book',cb)
cl_book ICON book1.ico      (resource file)
op_book ICON book2.ico

See also

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

 

 

 

Copyright © 1999-2017 Silverfrost Limited