TSysLink

Fonte: source/classes/tsyslink.prg

Inherits from: TControl

TSysLink wraps the Windows SysLink common control (Vista+), providing clickable hyperlinks within dialogs. Multiple links can be embedded in a single text string using HTML-style <a> tags. Links open URLs in the default browser or trigger Harbour code blocks.

Key DATA Members

DATATypeDescription
cTextCharacterDisplay text with <a> tags defining link regions
cUrlCharacterURL opened when a link is clicked
nLinkIdNumericIndex of the last clicked link

Methods

MethodDescription
New( nRow, nCol, oWnd, cText, cUrl, nW, nH, lPixel, lDesign, cMsg, bWhen, bClick, lTransparent, ... )Create a new SysLink control
ReDefine( nId, oWnd, cText, cUrl )Redefine from a dialog resource
SetText( cText ) / GetText()Change or retrieve the link text
HitTest( nX, nY )Test which link is at the given coordinates
GetIdealHeight( nWidth )Return ideal height for a given width
SetItem( nIndex, cUrl, nState ) / GetItem( nIndex )Modify or query individual link items

Commands

@ nRow, nCol SYSLINK oLink TEXT cText OF oWnd

Example: Multiple Links

#include "FiveWin.ch"
function Main()
   local oWnd, oLink
   DEFINE WINDOW oWnd TITLE "TSysLink Demo" SIZE 400, 200
   @ 20, 20 SYSLINK oLink TEXT ;
      "Visit <a href=""https://www.fivetechsoft.com"">FiveTech</a> " + ;
      "and <a href=""https://github.com"">GitHub</a>" ;
      OF oWnd
   ACTIVATE WINDOW oWnd CENTERED
return nil

Notes

Veja Também