treectrl Overview


This object wraps the common Windows tree control. Along with the basic item operations it supports trees with checkboxes.

Its methods accept a VARIANT item and a DWORD parent in order to identify a tree item:

Example

// Test ensureVisible, parent and get/set expanded
    TreeCtrl.ensureVisible("End leaf");
    index = TreeCtrl.parent("End leaf");
    if (!TreeCtrl.expanded(index))
        Env.LogError("Ensure visible did not expand the parent");
    TreeCtrl.expanded(index) = false; // collapse parent back into place
    TreeCtrl.expanded("Node 1") = false; // and the grandparent node
		

Methods

newItem Inserts a new item into the control, under the specified parent. Returns a handle to the new item.
deleteItem Removes an item from the control.
resetContent Deletes all items from the control.
ensureVisible Scrolls the specified item into view and expands all its parents.

Properties

item Gets/sets the text in the specified item.
itemData Gets/sets the user data associated with the specified item.
curSel Gets/sets the current selection.
findItem Returns the handle of the specified item or 0 if none exists.
count Returns the number of items in the control.
check Gets/sets the checkbox for the specified item, if tree control has checkboxes.
parent Returns the handle of the parent of the specified item.
expanded Set to true/false to expand/collapse children of the specified item. Returns true/false if the specified item is expanded/collapsed

 


© 2003 Lightweight Technologies. All rights reserved.