int GetNumTreeItems (int panelHandle, int controlID, int relation, int relativeIndex, int beginIndex, int direction, int stateCriteria, int *count);
Counts the number of items that have the specified relation to the relative index. The count starts at beginIndex and proceeds in the specified direction. Counts only those items that meet the stateCriteria.
To get the number of all the items in the tree, use GetNumListItems.
Input | ||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel. | ||||||||||||||||||||
controlID | integer | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by NewCtrl or DuplicateCtrl. | ||||||||||||||||||||
relation | integer |
Defines the relationship between the relative item and the items to be counted. You can select the following values: VAL_ALLCount all items regardless of their relationship to the relative item. VAL_SIBLINGCount only items that are siblings of the relative item. VAL_CHILDCount only items that are children of the relative item. VAL_DESCENDENTCount all items that are descendents of the relative item. VAL_ANCESTORCount all items that are ancestors of the relative item. |
||||||||||||||||||||
relativeIndex | integer | Identifies the relative of the items to be counted. All items in the specified direction that match the relationship to the relative item will be counted. | ||||||||||||||||||||
beginIndex | integer |
Zero-based index of the item where the count begins. The item at beginIndex must meet the relation requirement to the relative index. Use VAL_FIRST to start at the first item that meets the relation requirement to the relative index. The first ancestor is the parent. |
||||||||||||||||||||
direction | integer |
Defines the direction of the items from beginIndex to count. You can select the following values: VAL_NEXTInclude the items below beginIndex in the count. VAL_NEXT_PLUS_SELFInclude the items below beginIndex, along with the item at beginIndex, in the count. VAL_PREVInclude the items above beginIndex in the count. VAL_PREV_PLUS_SELFInclude the items above beginIndex, along with the item at beginIndex, in the count. |
||||||||||||||||||||
stateCriteria | integer |
Defines the state of the items to be counted. Use any combination of the following masks to define the state of the items to be counted:
For example, if you pass (VAL_SELECTED | VAL_MARKED) the function will only count items that are selected as well as marked. Pass 0 to count items regardless of their state. |
||||||||||||||||||||
Output | ||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||
count | integer | The number of items in the tree control that match the specified relationship to the relative index that also meet the requirements of stateCriteria. |
Name | Type | Description | ||||
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
|