|
|
|
Items |
Items within tree controls have relationships to other items based on the level they are on. This determines how items are connected to each other. The following table defines the terms used throughout to identify relationships and the connecting lines drawn for each type:
The following table defines the terms used throughout to identify relationships and the connecting lines drawn for each type:
Term |
Description |
Dependents |
A dependent is an item which has a parent. The item is said to be a dependent of the parent item. Dependents can be parent items themselves or leaf items. A dependent cannot be at the root level. The Item.FirstDependent and Item.LastDependent properties can be used to retrieve dependent item information for an item. |
Expand Status |
The expand status indicates whether dependent items are visible or not. A parent item that has one or more visible dependents is considered expanded. If a parent item is expanded, all its immediate dependents, i.e., all dependents on the next lower level are visible. If a parent item is collapsed, no immediate dependents are visible. The Item.Expanded property can be used to determine the current expand status of an item. Items can be expanded and collapsed using the Item.Expand and Item.Collapse methods. An item can be marked expandable using the Item.Expandable property, even if it has no child items. |
Leaf Item |
A leaf item is an item which has no dependents, i.e., it is not a parent item. Leaf items may have sibling and parent items. |
Parent |
A parent item can be located at any level. In order to become a parent item, an item has to have one or more dependents, which are items that immediately follow the parent item and are on a lower level. A parent item may be expanded and collapsed using the Item.Expand and Item.Collapse methods. Expanding a parent item means making its immediate dependents (dependents on the next lower level) visible. Collapsing a parent item means hiding all its dependents (on all lower levels). Parent items may have sibling and parent items. Parent items can be expanded and collapsed using the Item.Expand and Item.Collapse methods. An item can be marked expandable using the Item.Expandable property, even if it has no child items. The Item.Parent property returns an item's parent index. |
Root Level |
Any item without parent is at the root level, usually level 0. Multiple items can be at the root level, parent items or leaf items. The Item.Level property can be used to retrieve an item's level number. |
Siblings |
A sibling is an item which precedes or follows another item on the same level with the same parent. An item can have zero or more sibling items. Sibling items can be parent and leaf items. The Item.FirstSibling, Item.NextSibling, Item.PrevSibling, Item.LastSibling properties can be used to retrieve sibling information about an item. |
Top Parent |
A parent item is a top parent (or top level parent) if it has no parent of its own. Top parent items may have sibling items. The Item.TopParent property can be used to retrieve the topmost parent item. |
Visibility Status |
The visibility status indicates whether an item is visible or not. An item is considered visible if its immediate and all other parent items are expanded. An item is considered visible even if it isn't currently displayed in the window client area. The Item.Shown property can be used to define an item's visibility status. |
When adding items to a tree control, all that is required from an application is that the level numbers be set. The SftTree/OCX tree control automatically determines the correct relationships and draws connecting lines appropriately. Applications can then interrogate the tree control about relationships and don't have to manage these themselves.