This class shows a static text element which links to an URL. Appearance and behaviour is completely customizable. In fact, when the user clicks on the hyperlink, a HyperlinkEvent is sent but if that event is not handled (or it’s skipped; see Event#skip), then a call to LaunchDefaultBrowser is done with the hyperlink’s URL.
Note that standard Window functions like set_background_colour, set_font, set_cursor, set_label can be used to customize appearance of the hyperlink.
HL_ALIGN_LEFT |
Align the text to the left. | ||
HL_ALIGN_RIGHT |
Align the text to the right. | ||
HL_ALIGN_CENTRE |
Center the text (horizontally). | ||
HL_CONTEXTMENU |
Pop up a context menu when the hyperlink is right-clicked. The context menu contains a ``Copy URL" menu item which is automatically handled by the hyperlink and which just copies in the clipboard the URL (not the label) of the control. |
||
HL_DEFAULT_STYLE |
The default style for HyperlinkCtrl: @NO_BORDER | HL_CONTEXTMENU | HL_ALIGN_CENTRE@. |
See also window styles overview.
To process input from an hyperlink control, use these event handler macros to direct input to member functions that take a HyperlinkEvent argument.
| evt_hyperlink(id) { | event | ... } | The hyperlink was (left) clicked. If this event is not handled in user’s code (or it’s skipped; see Event#skip), then a call to LaunchDefaultBrowser is done with the hyperlink’s URL. |
_hyper_link(Window parent, Integer id, String label,
String url,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style,
String name = "hyperlink")
Constructor. See Create for more info.
Boolean create(Window parent, Integer id, String label,
String url,
Point pos = DEFAULT_POSITION,
Size size = DEFAULT_SIZE,
Integer style,
String name = "hyperlink")
Creates the hyperlink control.
Colour get_hover_colour()
Returns the colour used to print the label of the hyperlink when the mouse is over the control.
set_hover_colour(Colour colour)
Sets the colour used to print the label of the hyperlink when the mouse is over the control.
Colour get_normal_colour()
Returns the colour used to print the label when the link has never been clicked before (i.e. the link has not been visited) and the mouse is not over the control.
set_normal_colour(Colour colour)
Sets the colour used to print the label when the link has never been clicked before (i.e. the link has not been visited) and the mouse is not over the control.
Colour get_visited_colour()
Returns the colour used to print the label when the mouse is not over the control and the link has already been clicked before (i.e. the link has been visited).
set_visited_colour(Colour colour)
Sets the colour used to print the label when the mouse is not over the control and the link has already been clicked before (i.e. the link has been visited).
Boolean get_visited()
Returns if the hyperlink has already been clicked by the user at least one time.
set_visited(Boolean visited = true)
Marks the hyperlink as visited (see set_visited_colour).
String get_url()
Returns the URL associated with the hyperlink.
set_url(String url)
Sets the URL associated with the hyperlink.
[This page automatically generated from the Textile source at Thu May 01 00:50:39 +0100 2008]