Version: 2.9.4
Public Member Functions
wxHyperlinkCtrl Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/hyperlink.h>

Inheritance diagram for wxHyperlinkCtrl:

Detailed Description

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 wxHyperlinkEvent is sent but if that event is not handled (or it's skipped; see wxEvent::Skip), then a call to wxLaunchDefaultBrowser() is done with the hyperlink's URL.

Note that standard wxWindow functions like wxWindow::SetBackgroundColour, wxWindow::SetFont, wxWindow::SetCursor, wxWindow::SetLabel can be used to customize appearance of the hyperlink.

Styles

This class supports the following styles:

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxHyperlinkEvent& event)

Event macros for events emitted by this class:

Currently this class is implemented using native support in wxGTK and wxMSW (under Windows XP and later only) and a generic version is used by the other ports.

Library:  wxAdvanced
Category:  Controls

Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance
参照:
wxURL, wxHyperlinkEvent

Public Member Functions

 wxHyperlinkCtrl ()
 wxHyperlinkCtrl (wxWindow *parent, wxWindowID id, const wxString &label, const wxString &url, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHL_DEFAULT_STYLE, const wxString &name=wxHyperlinkCtrlNameStr)
 Constructor.
bool Create (wxWindow *parent, wxWindowID id, const wxString &label, const wxString &url, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxHL_DEFAULT_STYLE, const wxString &name=wxHyperlinkCtrlNameStr)
 Creates the hyperlink control.
virtual wxColour GetHoverColour () const
 Returns the colour used to print the label of the hyperlink when the mouse is over the control.
virtual wxColour GetNormalColour () const
 Returns the colour used to print the label when the link has never been clicked before (i.e.
virtual wxString GetURL () const
 Returns the URL associated with the hyperlink.
virtual bool GetVisited () const =0
 Returns true if the hyperlink has already been clicked by the user at least one time.
virtual wxColour GetVisitedColour () const
 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.
virtual void SetHoverColour (const wxColour &colour)
 Sets the colour used to print the label of the hyperlink when the mouse is over the control.
virtual void SetNormalColour (const wxColour &colour)
 Sets the colour used to print the label when the link has never been clicked before (i.e.
virtual void SetURL (const wxString &url)
 Sets the URL associated with the hyperlink.
virtual void SetVisited (bool visited=true)=0
 Marks the hyperlink as visited (see wxHyperlinkCtrl::SetVisitedColour).
virtual void SetVisitedColour (const wxColour &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.

List of all members.


Constructor & Destructor Documentation

wxHyperlinkCtrl::wxHyperlinkCtrl ( )
wxHyperlinkCtrl::wxHyperlinkCtrl ( wxWindow parent,
wxWindowID  id,
const wxString label,
const wxString url,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxHL_DEFAULT_STYLE,
const wxString name = wxHyperlinkCtrlNameStr 
)

Constructor.

See Create() for more info.


Member Function Documentation

bool wxHyperlinkCtrl::Create ( wxWindow parent,
wxWindowID  id,
const wxString label,
const wxString url,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxHL_DEFAULT_STYLE,
const wxString name = wxHyperlinkCtrlNameStr 
)

Creates the hyperlink control.

Parameters:
parentParent window. Must not be NULL.
idWindow identifier. A value of wxID_ANY indicates a default value.
labelThe label of the hyperlink.
urlThe URL associated with the given label.
posWindow position.
sizeWindow size. If the wxDefaultSize is specified then the window is sized appropriately.
styleWindow style. See wxHyperlinkCtrl.
nameWindow name.
virtual wxColour wxHyperlinkCtrl::GetHoverColour ( ) const [virtual]

Returns the colour used to print the label of the hyperlink when the mouse is over the control.

virtual wxColour wxHyperlinkCtrl::GetNormalColour ( ) const [virtual]

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.

virtual wxString wxHyperlinkCtrl::GetURL ( ) const [virtual]

Returns the URL associated with the hyperlink.

virtual bool wxHyperlinkCtrl::GetVisited ( ) const [pure virtual]

Returns true if the hyperlink has already been clicked by the user at least one time.

virtual wxColour wxHyperlinkCtrl::GetVisitedColour ( ) const [virtual]

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).

virtual void wxHyperlinkCtrl::SetHoverColour ( const wxColour colour) [virtual]

Sets the colour used to print the label of the hyperlink when the mouse is over the control.

virtual void wxHyperlinkCtrl::SetNormalColour ( const wxColour colour) [virtual]

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.

virtual void wxHyperlinkCtrl::SetURL ( const wxString url) [virtual]

Sets the URL associated with the hyperlink.

virtual void wxHyperlinkCtrl::SetVisited ( bool  visited = true) [pure virtual]

Marks the hyperlink as visited (see wxHyperlinkCtrl::SetVisitedColour).

virtual void wxHyperlinkCtrl::SetVisitedColour ( const wxColour colour) [virtual]

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).

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines