Admin Production ni-theme
Current Publication

AreTreeItemsRelated

LabWindows/CVI

AreTreeItemsRelated

int AreTreeItemsRelated (int panelHandle, int controlID, int itemIndex, int relation, int relativeIndex, int *areRelated);

Purpose

Returns a Boolean value indicating whether two tree items are related in a specified manner.

Returns true if the item at itemIndex meets the relation requirement with respect to the item at relativeIndex.

Supported Controls

You can use AreTreeItemsRelated with tree controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int 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 functions such as NewCtrl and DuplicateCtrl.
itemIndex int Zero-based index of a tree item.
relation int Defines the relationship to be tested between the two tree items.

You can select the following values.

VAL_ALL—Specify whether the tree items have any relationship.
VAL_SIBLING—Specify whether the tree items are siblings.
VAL_CHILD—Specify whether itemIndex is a child of relativeIndex.
VAL_DESCENDENT—Specify whether itemIndex is a descendent of relativeIndex.
VAL_ANCESTOR—Specify whether itemIndex is an ancestor of relativeIndex.
relativeIndex int Zero-based index of a tree item.
Output
Name Type Description
areRelated int A Boolean value indicating whether the items are related to each other with the specified relationship.

0 = not related
1 = related

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 7.0 and later