Page 1 of 1

AtSynEdit - Handpoint Cursor Mouse Hovering over Link/Url

Posted: 29.05.2022 05:52
by TomC
I'm converting over from SynEdit to AtSynEdit.

Background:
I loaded a plain text file that contained a link/url eg- "www.website.com/page"..
Wow, Url Link is blue and underlined by default, Nice..
I figured out how to load web page via OnMemoClickLink Event

Question:
I would love to have Cursor change to crHandPoint, when hovering over url link with mouse..
(Might have something to do with adding a Hotspot?)
I wonder if anyone would have an example code to do this..


Thank You Sincerely..

Posted: 30.05.2022 17:48
by main Alexey
I did not try this. Maybe try this
a) override MouseMove method and handle it -- hard to do
b) add Hotspot - https://wiki.lazarus.freepascal.org/ATS ... ots_object

Posted: 30.05.2022 18:28
by main Alexey
note that links are not collected in ATsynedit as usual, they are only calculated in DoPaintXXX method before the painting, this is to avoid finding links for invisible spaces.
so I am not sure you can easily get links coords.
better find links only in OnScroll event.

Posted: 30.05.2022 18:48
by main Alexey
ah, you can get found links from ATsynedit.
read Attribs object items, whiich have Tag equal to ATEditorOptions.UrlMarkerTag.
ATEditorOptions is in unit atsynedit_globals.