rvico TRichView Reference | TRichView

TCustomRichView.ClientToDocument

Top  Previous  Next

Translates client coordinates to document coordinates.

function ClientToDocument(const APoint: TPoint): TPoint;

(introduced in v1.9)

This method translates Point from the control’s coordinate system to the document coordinate system.

In client area coordinates, (0, 0) corresponds to the top left corner of the control's client area. For example, mouse events use this coordinate system.

In document coordinates, (0, 0) corresponds to the top left corner of the scrollable area. For example, GetItemAt uses this coordinate system.

Note:

This method must be used instead of adding HScrollPos to X and VScrollPos*VSmallStep to Y. The old method was used in some old example code, it is correct only if the document is top-aligned.

See also:

Example in OnRVMouseDown.


RichView © Sergey Tkachenko