TUrlLink
Back Home Up Next

 

Header File
    <owl/urllink.h>

This is a simple hyperlink control that can be plugged into any dialog. The hyperlink is initially colored blue, but changes color when the cursor is over it, and after the user has clicked on it. The cursor that appears when the mouse pointer is over the link can easily be set using SetCursor(), as can the link colors and underlining. The default cursor is a small pointing hand (cursor from OWL.DLL or #106 from the winhlp32.exe). There is also a ToolTip for the link that displays the underlying URL of the control.The control can auto-size itself to fit the size of the caption (to preserve a true hyperlink look and feel). The resizing will honor the SS_CENTERIMAGE, SS_LEFT, SS_RIGHT and SS_CENTER flags. To actually follow the link, "ShellExecute" is called to open the URL, but if this fails, then the registry is examined in order to find a likely candidate for .html files. If one is found then this it is launched with the hope that it can handle the URL string supplied. In any case, an error message is displayed on failure.

See example urllink.zip

Description
   

Constructors
    TUrlLink::TUrlLink
        Form 1
            TUrlLink(TWindow* parent, int id, LPCTSTR title, int x, int y, int w, int h, uint textLimit = 0, TModule* module = 0);
        Form 2
            TUrlLink(TWindow* parent, int resourceId, uint textLimit = 0, TModule* module = 0);
        Description
            Form 1: Creates a TUrlLink object from scratch.
            Form 2: Creates a TUrlLink object from dialog template.

Public Member Functions

SetURL
    Syntax
        void SetURL(LPCTSTR str);
    Description
        Set URL in control .
GetURL
    Syntax
        LPCTSTR GetURL() const;
    Description
        Get URL from control .
SetLinkColor
    Syntax
        void SetLinkColor(TColor& color);
    Description
        Set URL link color .
GetLinkColor
    Syntax
        TColor GetLinkColor() const;
    Description
        Get URL link color .
SetVisitedColor
    Syntax
        void SetVisitedColor(TColor& color);
GetVisitedColor
    Syntax
        TColor GetVisitedColor() const;
SetHoverColor
    Syntax
        void SetHoverColor(TColor& color);
GetHoverColor
    Syntax
        TColor GetHoverColor() const;
SetVisited
    Syntax
        void SetVisited(bool bVisited = true);
GetVisited
    Syntax
        bool GetVisited() const;
SetUnderline
    Syntax
        void SetUnderline(bool bUnderline = true);
GetUnderline
    Syntax
        bool GetUnderline() const;
GetTooltip
    Syntax
        TTooltip* GetTooltip() const;
EnableTooltip
    Syntax
        void EnableTooltip(bool enable=true);
SetTooltip
    Syntax
        void SetTooltip(TTooltip* tooltip);


Copyright © 1998-2001 Yura Bidus. All rights reserved.