Page 1 of 1

TSRichView - GetItemAt returns wrong corrdinates

Posted: Tue Aug 22, 2023 3:01 pm
by Jim Knopf
In a form I use TSRichViewEdit V. 9
The function GetItemAt returns wrong corrdinates and therefore does not return the item under the mouse pointer. I have already tried all possible combinations like:
minus PageProperty.LeftMargin and PageProperty.TopMargin
and/or
minus the coordinates of srv.GetPageClientRect(PageNo);
but I can't find the appropriate item under the mouse cursor. It even doesn't work if the zoom factor is <> 100?

How can I reliably find the item that is under the mouse pointer?

Re: TSRichView - GetItemAt returns wrong corrdinates

Posted: Tue Aug 22, 2023 3:53 pm
by Sergey Tkachenko
SRichViewEdit.GetItemAt must work (but not SRichViewEdit.RichViewEdit.GetItemAt).

See the example in <TRichView Dir>\ScaleRichView\Demos\Delphi\CustomDraw\Rectangles\DrawAtCursor\
This demo highlights an item below the mouse pointer.

Re: TSRichView - GetItemAt returns wrong corrdinates

Posted: Tue Aug 22, 2023 6:13 pm
by Jim Knopf
Jippie - that works - thnaks a lot!