Page 1 of 1

Hyperlink Help

Posted: Fri Nov 11, 2005 10:40 am
by CCY
Current I am before inserting a hyperlink, I will check on the caret position whether it is an hyperlink or not, after users have fill in the required hyperlink details like display text and the address, if the current item is a hyperlink I will call SetItemTagEd to update the tag of the hyperlink but if current iten is not a hyperlink I will call InsertStringTag to create a new hyperlink.

Example:
in the RVE there is a hyperlink with display text: Go Google and the address is: http://www.google.com. When user right click on the hyperlink I will allow user to edit the hyperlink details, from the demo given by RichView it will disable the Display Text field so that user can only edit the address while display remain unchanged. My problem is I will allow users to change the display text as well. So after changed, by calling SetItemTagEd I can only update the tag but not the display text. Now I was trying to do something when I have detected the display text has been changed then I will call InsertStringTag to recreate a new hyperlink rather than calling SetItemTagEd to update the hyperlink. It works anyway, but I am just wondering whether is this a correct implemetation? Any other better way of implementing it?

Posted: Fri Nov 11, 2005 1:21 pm
by Michel
Similarly to what you are doing to modify an existing Tag (link), you can call SetItemTextEd() to modify the Hyperlink's Text.
Michel

Posted: Fri Nov 11, 2005 3:38 pm
by Sergey Tkachenko
You can study the source code of TRVActionInsertHyperlink in RichViewActions http://www.trichview.com/resources/actions/