HyperLinkGadget()

Syntax

Result = HyperLinkGadget(#Gadget, x, y, Width, Height, Text$, Color [, Flags])
Description
Creates an HyperLink gadget in the current GadgetList. A hyperlink gadget is a text area which reacts to the mouse pointer by changing its color and the cursor shape.

Parameters

#Gadget A number to identify the new gadget. #PB_Any can be used to auto-generate this number.
x, y, Width, Height The position and dimensions of the new gadget.
Text$ The text to display on the link.
Color The color for the text when the mouse is over the gadget. The text color for the non-highlighted state can be changed with SetGadgetColor().
Flags (optional) Flags to modify the gadget behavior. It can be a combination of the following values:
  #PB_Hyperlink_Underline: Draw a line under the text without the need to use an underlined font.

Return value

Returns nonzero on success and zero on failure. If #PB_Any was used as the #Gadget parameter then the return-value is the auto-generated gadget number on success.

Remarks

A 'mini help' can be added to this gadget using GadgetToolTip().

This gadget supports the SetGadgetColor() and GetGadgetColor() functions with the #PB_Gadget_FrontColor type to change the text color.

Example

  If OpenWindow(0, 0, 0, 270, 160, "HyperlinkGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    HyperLinkGadget(0, 10, 10, 250,20,"Red HyperLink", RGB(255,0,0))
    HyperLinkGadget(1, 10, 30, 250,20,"Arial Underlined Green HyperLink", RGB(0,255,0), #PB_HyperLink_Underline)
  EndIf

See Also

GetGadgetText(), SetGadgetText(), GetGadgetColor(), SetGadgetColor()
<- HideGadget() - Gadget Index - ImageGadget() ->