06-15-2011, 03:48 PM,
(This post was last modified: 06-20-2011, 04:26 PM by kino.)
|
|||||
|
|||||
User Interface Basics1:Linking to Content
It's common to link to other information sources from a Curl applet. Once a user selects the link, the selected page can be displayed in the current browser window, a new empty window, or a predefined window. The displayed information can be Curl content that results from launching another Curl applet, or content defined in any other format recognized by the browser, such as HTML.
Linking to Web Pages Adding a hyperlink to a document is done using the link text procedure with the following keyword arguments. The simplest case only specifies the href, in which case the destination of the link will display in the current browser window. Code: {curl 6.0, 7.0 applet} In the next example, we are adding the target="_blank" property. This will open the link in a new browser window. Other properties control the tooltip, cursor style, and color. Code: {curl 6.0, 7.0 applet} This implementation is similar to HTML, where you would have the following code: Code: Click me Linking to Curl Content A link to a Curl applet can include an anchor, or destination, specification introduced by a # character. In this case, when the user selects the link, the Curl applet will launch and it will be directed to a specific location in the file, so the selected applet is loaded in a browser and scrolled to a particular point in the applet. The applet and the destination location are specified by: Code: {url link-applet.curl#introduction} The link-applet.curl file must designate that location as a destination, using the destination text format. In our case, we are adding the following line to the file: Code: {destination name = introduction, {bold color = blue, Introduction to Curl}} In our example, the code in the file would resemble the following: Code: {paragraph Note that we can use the destination text procedure multiple times in the file, with each location specifying a different destination name. Adding Links as Actions The previous examples use the link text procedure, whose associated text is rendered in an underlined style similar to standard Web conventions for links. You can also create a button that when selected automatically goes to a specified Url. This next example shows how to do this using the browse-url procedure. (Note that the creation of a CommandButton is discussed in a subsequent Curl Cue.) Code: {curl 6.0, 7.0 applet} Tip: Note that link and browse-url each have two arguments: href and target. A link renders as text that is underlined for the user to click on, while browse-url is used as a function that can be called in any graphical object's event handler. For more information regarding links, please refer to the following section in the Curl Documentation:Curl Developer's Guide > Text Formatting > Special Text Formats > link and destination |
|||||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
Serving Content3:Dynamically Generating Curl Content | kino | 0 | 5,191 |
06-15-2011, 05:19 PM Last Post: kino |
|
User Interface Basics7:Stretching Graphical Objects | kino | 0 | 4,781 |
06-15-2011, 04:12 PM Last Post: kino |
|
User Interface Basics6:Object Layout | kino | 0 | 4,507 |
06-15-2011, 04:08 PM Last Post: kino |
|
User Interface Basics5:Swapping UI Content | kino | 0 | 3,500 |
06-15-2011, 04:03 PM Last Post: kino |
|
User Interface Basics4:Populating Control List Data | kino | 0 | 3,709 |
06-15-2011, 03:58 PM Last Post: kino |
|
User Interface Basics3:Creating Dialogs | kino | 0 | 3,360 |
06-15-2011, 03:55 PM Last Post: kino |
|
User Interface Basics2:Adding Pop-ups | kino | 0 | 3,718 |
06-15-2011, 03:52 PM Last Post: kino |
Users browsing this thread:
2 Guest(s)
2 Guest(s)