TCustomRichView.GetItemAt

<< Click to display table of contents >>

TCustomRichView.GetItemAt

Returns item at the position X,Y.

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

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

 

Input parameters:

X,Y coordinates relative to the top level corner of document (scrollable area)

Strict:

True the method returns an item which is exactly at the specified location;

False the method returns a position where caret should be moved, if the user would click the mouse at (X,Y)

 

Output parameters:

RVData object containing this item (RichView.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?"

 

This method must be called only when the document is formatted.

 

See also:

GetWordAt.

See also events:

OnRVMouseDown (contains example);

OnRVMouseUp.

Demo projects:

Demos\*\Assorted\PlanetQuiz\