RTF control link to TD procedure

Discussion forum about all things Team Developer 5.x and 6.x
e.russo
Italy
Posts: 38
Joined: 16 Feb 2018, 14:02
Location: Turin, Italy

RTF control link to TD procedure

Post by e.russo » 18 Sep 2018, 15:04

Hello,

is it possible to use a link in the richtext control to perform a TD function?

Thank you


Enrico

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1088
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: RTF control link to TD procedure

Post by Dave Rabelink » 19 Sep 2018, 10:59

Rich Text Control supports hyperlinks.
By default the links are started automatically when you click on them.

So, if the RTF text contains http://anysite.com, it will start the default browser and loads the URL.
If it contains file://c:\\\\temp it will start Explorer and shows the folder contents of c:\temp

To "override" the default action, it is possible on API level to catch the click notification and do custom stuff.
But unfortunately, not in TD.

Problem I have seen is that the WM_NOTIFY message is not processed at all at the Rich Text Control level message actions.
In fact it is processed, but on a higher level which we can not overrule.

A "complete" TD Rich Text Control implementation would IMHO consist of (most) API features, wrapped in SAL functions and SAM messages.

But the RTF control as implemented now in TD is not wrapping much at all, so there is no way doing stuff like you ask.

To get custom links working, you need this:
The first 2 can be done in TD.
The last one is not possible. At least, I could not get it working.


Another solution which could work is not using the TD RIch Text Control, but use the custom control.
Probably the WM_NOTIFY can be overruled, but I did not try this.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1088
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: RTF control link to TD procedure

Post by Dave Rabelink » 19 Sep 2018, 13:05

Did a quick check to get it working using RTF custom control and it seems to work.

RTF_Hyperlink.png

http://samples.tdcommunity.net/index.ph ... erlink.zip

(ANSI & UNICODE version)
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

e.russo
Italy
Posts: 38
Joined: 16 Feb 2018, 14:02
Location: Turin, Italy

Re: RTF control link to TD procedure

Post by e.russo » 19 Sep 2018, 14:32

Thank you

Enrico

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests