TCustomListBox.ItemAtPos function
Get the item index for the given client coordinates.
Declaration
function ItemAtPos(const Pos: TPoint; Existing: Boolean): IntegerArguments
Pos | The item position. |
Existing | True when the index is requested for insertion of a new item. |
Function result
The calculated item index, can be out of the Items bounds.
Description
ItemAtPos is an
Integer function used to get the index
position in Items for the value at the specified screen coordinates.
Pos is
TPoint instance with the X and Y coordinates
used in the method.
Existing indicates whether the return value is set to -1 or the
number of entries in
Items when Pos refers to entry which does not
exist. When Existing is set to
True, -1 is returned for an invalid
entry. Otherwise, the value in
Item.Count is returned.
ItemAtPos calls GetIndexAtXY using the X and Y values in Pos to
locate the index for the item.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
