%HI_FindItemData function


Function
The function searches the user data in items of Windows control of Tree view type.
Declaration
INT %HI_FindItemData(
   INT in refId,
   INT in root,
   INT in itemHandle,
   INT in position,
   INT in data,
 )

Parameters
refId Reference to Windows control (reference variable).
root Identifier of item - branch the data will be searched in. If the value of the parameter is 0, all tree view will be searched.
item Identifier of item the data are to be searched from (excluding it). If the value of the parameter is 0, there will be searched all the branch.
position Position of data in item (1...15).
data A searched data (optional type).

Description
Each tree view item can contain an array of at most 15 data and user can define and read then by using the %HI_GetItemData and %HI_SetItemData functions. The meaning of the values is not specified at all and they have no effect on the behaviour of the tree view item.

The function %HI_FindItemData is used to search the data contained in items of Windows control of Tree view type.

The Windows control is specified by the refId reference variable.
The parameter root defines a tree branch and the parameter item specifies an item, the branch is searched from.
Position of the data in item is given by the parameter position and the searched data are specified by the parameter data.
Value type of the parameter data is optional, except structures.

Return value of the function is the identifier of the item that contains given data.
Example
The following image contains a tree view.
1. Browsing all the tree, the searched data are "888" on 5th position.

 %HI_FindItemData(_tree, 0, 0, 5, 888)
 

2. Browsing the branch 1 including the item 1, the searched data are "Zilina" on 10th position.

 %HI_FindItemData(_tree, 1, 0, 10, "Zilina")
 

3. Browsing the branch 1 from the item 1.2 (excluding it), the searched data are "Martin" on 1st position.

 %HI_FindItemData(_tree, 1, 12, 1, "Martin")
 

Napíšte komentár