Hyperlinks and TipsUse hyperlinks to create content that is connected to other Nytril documents or content on the Web. Connect user input to different types of custom actions to create dynamiclly generated content. View on YouTube
Web linksYou can create a hyperlink to a web address simply by placing the URL inside a Span. readonly URL WebAddress = new("www.nytril.com");LinkText = Span { WebAddress;};www.nytril.comUnderlined on mouse-over
Change the textIf you want different text for the link, put the text in a Span and use the Action property to specify the link.Message = Span { Action: WebAddress; TextColor: Colors.Blue; "Visit us on the web";};Visit us on the webHidden URL
Popup tipsUse the Tip property to specify a formatted popup when the mouse hovers over the text in the Span. TheAnswer = Span { TextColor: Colors.DarkGreen; "The answer is "; Bold 42;};PopupMessage = Span { "The answer"; Tip: new Tip(TheAnswer);};The answerThe answer is 42
Tip + ActionUse the TipAction property to specify a both a tip and an action at the same time.ActionTip = Span { "Here's a tip: "; Span { "Visit us on the web"; Underline; TipAction: WebAddress; }};Here's a tip: Visit us on the webwww.nytril.com
Document AnchorsTo create links within a single document, you must first give the target Paragraphs a reference name using the Anchor function. The anchor name of each Paragraph must be unique in the document. HelpAnchor = "HelpCenter";AnchoredPar = Paragraph { "Paragraph with the \"{0}\" anchor. "(HelpAnchor); DocFields.Anchor(HelpAnchor);};Paragraph with the "HelpCenter" anchor.
Anchor LinksOnce the anchor name is assigned to a paragraph, you can create an action that links to that paragaph, no matter where it is placed in the document. HelpLink = Span { Action: new Action(Actions.ToAnchor, HelpAnchor); "Find out more in the help section. ";};Find out more in the help section.
QR CodesTo label products or printed documents, QR codes can be added with the QRBox formatter. Notice that there is always a white border around the QR code which is required by the QR readers. QRCode = VBox { HAlign: Center; "Follow us online"; QRBox(WebAddress, QRSize);};Follow us onlinehttps://www.nytril.com"Quiet zone"
QR Codes with LinksChange the level of error correction in the QR code by setting the error parameter to a number from 0 to 3. QRLink = VBox { HAlign: Center; "Community Edition"; QRBox(WebAddress, QRSize, 3) { TipAction: WebAddress; };};Community Editionhttps://www.nytril.comMore complex patternincludes more error correction
Links to FilesCreate an action to browse to a local file with the ToFile action type. This will bring up File Explorer on Windows (or Finder on the Mac) and point it to the specified path. FileLink = Span { "Open in File System"; Tip: "Browse the File"; Action: new Action(Actions.ToFile, res "Hyperlinks.nytril");};Open in File SystemBrowse the File
Custom ActionsCreate a complex custom action by inheriting the Action class and overriding the Execute function. class CustomAction: Action { var Text; Constructor(text) { super.Constructor(Actions.Execute); Text = text; } override EventResponse Execute { System.TextToClipboard(Text); return EventResponses.MessageTip("Text copied to the clipboard"); }}CustomLink = Span { Icons.copy; Space; "Copy Text"; TipAction: new CustomAction("Custom Text");}; Copy TextText copied to the clipboard