[Lazarus] Question about TRichMemo
Dmitry Boyarintsev
skalogryz.lists at gmail.com
Thu Nov 3 20:48:34 CET 2016
On Thu, Nov 3, 2016 at 3:36 PM, silvioprog via Lazarus <
lazarus at lists.lazarus-ide.org> wrote:
> There's ALinkRef parameter, that serves this particular purpose.
>>
> Naturally, LinkRef should end up in TLinkMouseInfo .
>>
>
> Perfect.
>
Now, I take that back.
"ref" information might need to go to some other, rather than
TLinkMouseInfo.
Instead, TLinkMouseInfo should contain information about the cursor (x,y,
shift state, etc)
An extra parameter could be added that would contain LinkInformation
I have a question regarding SetTextUIStyle for WinVCL,
>
Why WinVCL? :)
> what about to change it to?
>
> txt := GetTextUtf8(RichEditWnd, true);
> st.codepage:=CP_UTF8;
> st.flags:=ST_SELECTION;
> linkrtf:=Concat('{\rtf1{\field{\*\fldinst{ HYPERLINK
> "',ui.linkref,'"}}{\fldrslt{ ',txt,' }}}}');
> SendMessage(RichEditWnd, EM_SETTEXTEX, WPARAM(@st), LParam(@linkrtf[1]));
>
That's fine. You just need to make sure that parameters are RTF escaped.
Also, newer versions of RichEdit do provide API for Link management without
need of going into raw RTF.
But that's why TRichEditManager class is there (even through there's only
one implementation available)
thanks,
Dmitry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161103/1d97fb15/attachment.html>
More information about the Lazarus
mailing list