ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / RTF functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a link to a text section in an RTF Edit control. Clicks on this link are processed programmatically.
Example
// == Déclarations globales de la fenêtre ==
tabCibleLien is array of strings

// == Clic sur le bouton "Ajouter une note" ==
RangLien is int
Destination is string

// Demande une note à associer au lien
IF Input("Saisissez une note associée à ce lien :", ...
			Destination) = 1 THEN

	// Conserve la note dans un tableau
	RangLien = Add(tabCibleLien, Destination)

	// Ajoute le lien dans le champ de saisie RTF
	RTFAddLink(SAI_Saisie, SAI_Saisie.Curseur, ...
		SAI_Saisie.FinCurseur, ClicSurLien, RangLien)
END
// == Procédure ClicSurLien ==
PROCEDURE ClicSurLien(RangLien is int)
InfoBuild("La note associée au lien %1 est : %2", RangLien, ...
		tabCibleLien[RangLien])
Syntax
RTFAddLink(<Edit control> , <Start position of the link> , <End position of the link> , <WLanguage procedure> [, <Procedure parameter>])
<Edit control>: Character string
Name of the RTF edit control to use.
<Start position of the link>: Integer
Position of the first character of the link. The index of the first character in the control is set to 1. The function has no effect if the start position of the link is greater than the size of the text.
<End position of the link>: Integer
Position of the first character after the link. The function has no effect if the end position of the link is less than the start position of the link.
<WLanguage procedure>: Procedure name
Name of the WLanguage procedure called when the link is clicked on.
<Procedure parameter>: Optional variant
Parameter that will be passed to the procedure when the link is clicked on. If this parameter is not specified, the procedure will receive no parameter.
Remarks
  • RTFAddLink can be used on standard and RTF Edit controls.
  • To remove a link, simply reassign the corresponding text area.
  • Links added with RTFAddLink are not kept:
    • when copying to the clipboard.
    • when ScreenToFile is called. In this case, only the RTF content is copied into the HFSQL buffer.
  • In an RTF control, the line wraps correspond to a character.
  • You can set the color of links with LinkColor.
  • You can set the color of links added with RTFAddLink by using LinkColorRTF.
Component: wd300obj.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help