%HI_GetSelectedItem, %HI_SetSelectedItem functions


Function The function %HI_SetSelectedItem sets the item of the Windows control of List box or Tree view types or the displayer of Browser type as current (selected) one (Control function).

The function %HI_GetSelectedItem detects the index (from 1 ...) of the current (selected) item of the Windows control of List box or Tree view types or the displayer of Browser type.
Declaration
 %HI_SetSelectedItem(
  INT in refId,
 INT in itemIdx,
 BOOL in bInCurrPage := @FALSE
 BOOL in bState := @TRUE
  )


 INT %HI_GetSelectedItem(
  INT in refId,
 BOOL in bInCurrPage := @FALSE
 INT in iFromIdx := 0
  ) 
Parameters
refId Reference to graphic object (reference variable).
itemIdx Item index.
bInCurrPage The parameter can be only used for displayer of Browser type:
  • @TRUE - the parameter itemIdx defines the item index on currently displayed page of the Browser
  • @FALSE - the parameter itemIdx defines the item index regardless of the paging (within the frame of the entire Browser)
bState The parameter can be only used for displayer of Browser type:
  • @TRUE - the line is to be selected
  • @FALSE - the line is to be deselected
iFromIdx The parameter can only be used if the browser is in multiselect mode - it sets the index, from which the selected line will be looked for.

Example: If the selection comprises lines 1, 3 and 5 and the iFromIdx parameter is set to the value of 3, the function returns 5.
Note If no item is selected, the function %HI_GetSelectedItem returns the value of 0.

For displayer of Tree view type, the parameter itemIdx is the unique identifier of the item.

If the function %HI_SetSelectedItem is called on some item in Tree which is out of displayed area, the scrollbars will adjust automatically to see the selected item.


Napíšte komentár