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 Specifies a number to identify the new gadget. #PB_Any can be used to autogenerate this number.
x, y, Width, Height Specifies the position and dimensions of the new gadget.
Text$ Specifies the text to display on the link.
Color Specifies 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) Specifies 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 returnvalue is the autogenerated gadget number on success.

Remarks

You can add a 'mini help' to this gadget by using GadgetToolTip().

This gadget supports the SetGadgetColor() and GetGadgetColor() functions with the #PB_Gadget_FrontColor type to change the text color. The backgroundcolor is always the color of the window.

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)
    SetGadgetFont(1, LoadFont(0, "Arial", 12))
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

See Also

GetGadgetText(), SetGadgetText(), GetGadgetColor(), SetGadgetColor()

Supported OS

All

<- HideGadget() - Gadget Index - IPAddressGadget() ->