X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..939fdcf6b767cd8beec43c46e43f576fed530e1a:/interface/wx/hyperlink.h?ds=inline diff --git a/interface/wx/hyperlink.h b/interface/wx/hyperlink.h index bd62fe8fd9..115db369cb 100644 --- a/interface/wx/hyperlink.h +++ b/interface/wx/hyperlink.h @@ -9,11 +9,15 @@ /** @class wxHyperlinkEvent - This event class is used for the events generated by - wxHyperlinkCtrl. + This event class is used for the events generated by wxHyperlinkCtrl. + + @beginEventTable{wxHyperlinkEvent} + @event{EVT_HYPERLINK(id, func)} + User clicked on an hyperlink. + @endEventTable @library{wxadv} - @category{FIXME} + @category{events} */ class wxHyperlinkEvent : public wxCommandEvent { @@ -21,8 +25,7 @@ public: /** The constructor is not normally used by the user code. */ - wxHyperlinkEvent(wxObject* generator, int id, - const wxString& url); + wxHyperlinkEvent(wxObject* generator, int id, const wxString& url); /** Returns the URL of the hyperlink where the user has just clicked. @@ -41,15 +44,15 @@ public: @class wxHyperlinkCtrl 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. + 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. + wxWindow::SetFont, wxWindow::SetCursor, wxWindow::SetLabel can be used to + customize appearance of the hyperlink. @beginStyleTable @style{wxHL_ALIGN_LEFT} @@ -68,9 +71,17 @@ public: wxBORDER_NONE|wxHL_CONTEXTMENU|wxHL_ALIGN_CENTRE. @endStyleTable + @beginEventTable{wxHyperlinkEvent} + @event{EVT_HYPERLINK(id, func)} + The hyperlink was (left) clicked. If this event is not handled in user's + code (or it's skipped; see wxEvent::Skip), then a call to wxLaunchDefaultBrowser + is done with the hyperlink's URL. + @endEventTable + + @library{wxadv} @category{ctrl} - + @appearance{hyperlinkctrl.png} @see wxURL, wxHyperlinkEvent */ @@ -102,40 +113,35 @@ public: @param pos Window position. @param size - Window size. If the wxDefaultSize is specified then the window is sized - appropriately. + Window size. + If the wxDefaultSize is specified then the window is sized appropriately. @param style Window style. See wxHyperlinkCtrl. - @param validator - Window validator. @param name Window name. */ - bool Create(wxWindow* parent, wxWindowID id, - const wxString& label, - const wxString& url, - const wxPoint& pos = wxDefaultPosition, + 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 = "hyperlink"); + const wxString& name = wxHyperlinkCtrlNameStr); /** Returns the colour used to print the label of the hyperlink when the mouse is over the control. */ - wxColour GetHoverColour() const; + virtual wxColour GetHoverColour() const; /** Returns the colour used to print the label when the link has never been clicked - before - (i.e. the link has not been @e visited) and the mouse is not over the control. + before (i.e. the link has not been @e visited) and the mouse is not over the control. */ - wxColour GetNormalColour() const; + virtual wxColour GetNormalColour() const; /** Returns the URL associated with the hyperlink. */ - wxString GetURL() const; + virtual wxString GetURL() const; /** Returns @true if the hyperlink has already been clicked by the user at least @@ -145,29 +151,27 @@ public: /** 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 @e - visited). + control and the link has already been clicked before (i.e. the link has + been @e visited). */ - wxColour GetVisitedColour() const; + virtual wxColour GetVisitedColour() const; /** Sets the colour used to print the label of the hyperlink when the mouse is over the control. */ - void SetHoverColour(const wxColour& colour); + virtual void SetHoverColour(const wxColour& colour); /** - Sets the colour used to print the label when the link has never been clicked - before + Sets the colour used to print the label when the link has never been clicked before (i.e. the link has not been @e visited) and the mouse is not over the control. */ - void SetNormalColour(const wxColour& colour); + virtual void SetNormalColour(const wxColour& colour); /** Sets the URL associated with the hyperlink. */ - void SetURL(const wxString& url); + virtual void SetURL(const wxString& url); /** Marks the hyperlink as visited (see wxHyperlinkCtrl::SetVisitedColour). @@ -176,9 +180,8 @@ public: /** 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 @e - visited). + and the link has already been clicked before (i.e. the link has been @e visited). */ - void SetVisitedColour(const wxColour& colour); + virtual void SetVisitedColour(const wxColour& colour); };