TSRichView - GetItemAt returns wrong corrdinates

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

TSRichView - GetItemAt returns wrong corrdinates

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17554
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TSRichView - GetItemAt returns wrong corrdinates

Post 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.
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Re: TSRichView - GetItemAt returns wrong corrdinates

Post by Jim Knopf »

Jippie - that works - thnaks a lot!
Post Reply