Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiCreateHypertextField

hiCreateHypertextField(
?name s_name
[ ?title t_title ]
[ ?titleAlignment g_titleAlignment ]
[ ?value t_value ]
[ ?pos t_position ]
[ ?defValue t_defaultValue ]
[ ?help g_fieldHelp ]
[ ?callback g_callback ]
[ ?enabled g_enabled ]
[ ?shadowed g_shadowed ]
[ ?hasVerticalScrollbar g_hasVerticalScrollbar ]
[ ?hasHorizontalScrollbar g_hasHorizontalScrollbar ]
[ ?invisible g_invisible ]
)
=> r_fieldHandle

Description

Creates a hypertext field, which displays rich text with hypertext navigation. You can also specify hyperlinks to execute SKILL commands.

Angle brackets (less-than and greater-than characters) are used to enclose text formatting and other HTML commands. Therefore, to display a greater-than (">") or less-than ("<") character, you must use the special strings “&gt” or “&lt” respectively.

Links to a Web page is displayed on a Web browser. If a browser is already open, it is used, otherwise, the browser specified in the Web Browser field of the CIW User Preferences form is used. The default browser is Netscape. For more information on browser selection, see hiLaunchBrowser.

The hypertext field is based on QTextBrowser (for reference you may want to look over the QTextBrowser class documentation).

This field can also have a context menu, that is, a pop-up menu that is displayed when you right-click on the field.

For information on creating tooltips for fields, see Creating Tool Tips for Fields.

Arguments

?name s_name

Handle to the field. To reference it, use:

formHandle->hiFieldSym

?title t_title

The title of the hypertext field, which is displayed above the field.

?titleAlignment g_titleAlignment

  

Alignment of the hypertext field title. Use one of the following values:

’left

’center

’right

The default value is ’left.

?value t_value

The text, including hyperlinks, that is the initial and current value of the field.

Specify the hyperlinks in the same format as an HTML anchor tag. You can specify three attributes in the anchor tag:

  • HREF Specifies the URL
  • NAME Specifies a name that identifies the link; you can jump to this from another link in the document
  • TARGET Specifies the window in which to load the page; for example, TARGET="_blank" loads the page in a new browser window while TARGET="_self" loads the page in the same window

For example:

"<A href=http://www.cadence.com> Cadence Design Systems</A>"
"<A name=cadence href=http://www.cadence.com> Cadence Design Systems</A>"
"<A href=http://www.cadence.com target=_blank> Cadence Design Systems </A>"
"<A href=#cadence> Jump to the Cadence link </A>"

All the standard formats for the HREF attribute are supported. For example:

href=http://www.myWebsite.com
href=mailto://xyz@mycompany.com
href="#linkName"
href=/localFile
(localfile is loaded into the hypertext field when the link is clicked.)
href=file:/localFile or href=file:///localFile(localfile is always sent to the Web browser.)

In addition, a SKILL href can be specified to execute a SKILL command. For example:

href=SKILL:println(\"Hello world\")

You need to use the ampersand encoding for the less-than ("<") and greater-than (">") characters in the SKILL command. For ">" use "&gt;" and for "<" use "&lt;". Otherwise, they are interpreted as HTML enclosures. Space and equal characters can also be misinterpreted and translated into ampersand encoded representations by the HTML interpreter. If this occurs for:

  • Spaces separating arguments, replace the spaces with commas.
  • An equal symbol, use the appropriate set, setq, equal, eq, etc. SKILL command to workaround the issue.

To specify a new line in the text, use \n.

Quotation marks must be preceded with a backslash.

After the form is instantiated, you can use the hiHypertextReplace() function or the value property to modify the value. Use the following syntax for the value property:

formHandle->hiFieldSym->value

You can also load a text file as the value of the hypertext field by using the hiHypertextReadin() function.

?pos t_position

Position of the field that is to be displayed initially, specified by a link name. For example, "myLink" displays the text associated with the tag </A NAME=myLink> when the field is first displayed.

After the form is instantiated, you can use the pos property to specify the part of the field that you want to display. For example:

formHandle->hiFieldSym->pos="linkToDisplay"

You can also use the hiHypertextScroll() function to specify the part of the field that you want to display.

?defValue t_defaultValue

  

The text, including hyperlinks, that is the default value of the field.

If you do not specify this argument, the default value is equal to the initial entry in t_value.

To reference the default value, use:

formHandle->hiFieldSym->defValue

?help g_fieldHelp

A string or symbol used to reference help. If not specified, s_name is used. This argument is currently not used.

?callback g_callback

  

Callback function of string, symbol, or function object type  that is executed when a hyperlink is clicked. The callback function is passed from the following arguments:

fieldUT form hyperlinkName hyperlinkRef

where:

fieldUT is the field user type.

A field user type (UT) is the representation for an instantiated field. When a form is initially displayed (hiDisplayForm) or instantiated (hiInstantiateForm), the fields are converted from defstructs to user types, which are associated with the field widgets.

form is the form defstruct.

hyperlinkName is an empty string.

hyperlinkRef is the hyperlink reference (the HREF in the HTML anchor tag).

In the following example:

"<A name=cadence href=http://www.cadence.com> Cadence Design Systems</A>"

the hyperlink name is cadence and the hyperlink reference is http://www.cadence.com.

Although, in this example, the anchor name is set as cadence, the hyperlinkName passed to the callback always remains a blank string.

?enabled g_enabled

  

Specifies whether the fields in the layout are enabled. The default value is t.

?shadowed g_shadowed

  

Locates a shadow box around the spin box field. The default value is t.

?hasVerticalScrollbar g_hasVerticalScrollbar

  

Displays a vertical scroll bar on the field. The default value is t.

?hasHorizontalScrollbar g_hasHorizontalScrollbar

  

Displays a horizontal scroll bar on the field. The default value is t.

?invisible g_invisible

  

Specifies whether the layout and the fields within are invisible. The default value is nil.

Values Returned

r_fieldHandle

Handle to the hypertext field.

Related Topics

Form and Field Functions

Creating Context Menus for Fields

hiCreateSimpleHypertextField

hiHypertextReadin

hiHypertextReplace

hiHypertextScroll

hiLaunchBrowser


Return to top
 ⠀
X