PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Adds a link onto a text section in an RTF edit control. The clicks on this link are processed by programming.
Example
// == Declare the global variables of the window ==
arrLinkTarget is array of strings

// == Click the "Add a note" button ==
LinkRank is int
Destination is string

// Asks for a note to associate with the link
IF Input("Enter a note associated with this link:", ...
Destination) = 1 THEN

// Stores the note in an array
LinkRank = Add(arrLinkTarget, Destination)

// Adds the link into the RTF edit control
RTFAddLink(EDT_Edit, EDT_Edit..Cursor, ...
EDT_Edit..CursorEnd, ClickOnLink, LinkRank)
END
// == ClickOnLink procedure ==
PROCÉDURE ClickOnLink(LinkRank is int)
InfoBuild("The note associated with the %1 link is: %2", LinkRank, ...
arrLinkTarget[LinkRank])
Syntax
RTFAddLink(<Edit control> , <Start Position of Link> , <End Position of Link> , <Procedure Name> [, <Procedure Parameter>])
<Edit control>: Character string (with or without quotes)
Name of the RTF edit control to use.
<Start Position of Link>: Integer
Position of the first character of the link. The subscript of the first character found 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 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.
<Procedure Name>: Character string (with or without quotes)
Name of the WLanguage procedure called during a click on the link.
<Procedure Parameter>: Optional variant
Parameter that will be passed to the procedure during a click on the link. If this parameter is not specified, the procedure will receive no parameter.
Remarks
  • RTFAddLink can be used on the text and RTF edit controls (but not on the HTML edit controls).
  • To delete a link, all you have to do is reassign the corresponding text section.
  • The links added by RTFAddLink are not kept:
    • during a copy into the clipboard.
    • during a call to ScreenToFile. In this case, only the HTML is copied into the HFSQL buffer.
  • In an RTF control, the line wraps correspond to a character.
  • Versions 22 and later
    The color of the links can be configured by LinkColor.
    New in version 22
    The color of the links can be configured by LinkColor.
    The color of the links can be configured by LinkColor.
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 19
This page is also available for…
Comments
Click [Add] to post a comment