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 and #PB_Gadget_BackColor types to change the color of the text and background (if the window's background have changed).

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,40,"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() ->