Search Locate Previous Next Contents

TreeView (TR)


Description
A standard Windows95 tree which may also be used to select multiple entries using the ‘Checked’ property.

Index – should an integer index into ...

Structure – which defines the tree labels, depth and optional image

The ‘Structure’ should be a nested text vector and a parallel column of level numbers with optional imageindex in column-3. The level numbers must start with level-0, but you may have as many 0-level items as you like. The levels must work down incrementally, but may step out in jumps, for example 0 1 1 2 3 1 2 2 0 1 is valid, but 0 2 2 1 2 4 0 1 is not.

Use the SetImage function to attach an ImageList (see the IL class) on creation. The optional 3rd column gives the positions of your icons in this list. Use 16 x 16 icons for preference and ensure that the ImageList is defined on the form before the tree! The optional 4th column is a boolean with 1 where the node should be expanded.

Class Property Table
NameTypeDefaultDescription
HintString
EditableBoolItem labels may be edited by the user with F2
StyleManyOf
3DOneOf‘Recess’Border style
IndexUserIndex of selected line
StructureUserTree structure [;vtv level {imageindex} {expanded} ]
CheckedUserSelected items (integer vector 1=Y 0=N ¯1=Some)
PropagateBool1Propagate selection up/down tree
ExpandedUserWhich items are opened up (boolean vector)
DragSourceBoolUser can drag items off this control
DragModeOneOfPermitted drag operations
DropAcceptStringListAccepts drag-over and drag-drop from these groups

Class-specific Events
IDCItem double-clicked
DRAGOFFItem dragged off the tree
DRAGOVERItem draggged over the tree
DRAGDROPItem dropped on the tree
EDITItem label edited by user
RMMRight-mouse menu request

Class-specific Functions
AddChildrenAdd item(s) as children of specific item
AddItemsAdd same-depth item(s) after specific item
AutoExpandSet Expand depth on refresh
CollapseAllCurl up entire tree
CollapseItemsCollapse specified item(s)
DeleteChildrenDelete all children of specified item(s)
DeleteItemsDelete specified item(s) and their children
EnsureVisibleEnsure specific item visible
ExpandAllUncurl entire tree
ExpandItemsExpand selected item(s)
GetAncestorsIndices of ancestors of specified item (nearest to most distant)
GetChildrenIndices of first-generation children of specified item
GetDescendantsIndices of all children, grandchildren, etc., of specified item
GetFirstVisibleReturn index of first visible item
GetItemDepthReturn depth of specified item(s)
GetItemImageReturn index of image of specified item(s)
GetSiblingsIndices of siblings of specified item
GetVisibleCountReturn number of visible items
SetFirstVisibleScroll to make specified item the first one visible
SetImageAttach image list
SetItemImageSet image(s) associated with item(s)
ShowItemShow specified item


Continue to: TreeView – Checked Property
© Copyright Causeway Graphical Systems Ltd 2003