TSRichViewEdit.GetItemAt

<< Click to display table of contents >>

TSRichViewEdit.GetItemAt

Returns the ActiveEditor's item at the specified coordinates.

function GetItemAt(X, Y : Integer; var RVData: TCustomRVFormattedData;

  var ItemNo, OffsetInItem: Integer; Strict: Boolean): Boolean;

Input parameters:

X, Y – coordinates relative to the client area of TSRichViewEdit control.

If Strict=True, the method returns the item only if it is located exactly at the specified position (if it exists). If False, the method returns the closest item for any position above  a page.

Output parameters:

Output parameters are valid only if this method returns True.

RVData – object containing this item (ActiveEditor.RVData or table cell or RVData of cell inplace editor)

ItemNo – index of item (in the items list of RVData), or -1 if no item was found.

OffsetInItem – position of this item:

for non-text: 0 (closer to the beginning of the item) or 1 (to the end);

for text: position is before the OffsetInItem-th character of text; characters are indexed from 1, the last position is Length(text)+1.

Return value:

"item found?"