X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e59b88579c7a1e8b4da0827be75dc5d2a84ec73..9f6e407c7d555078b6fd2ef62534acfbf9781545:/interface/wx/hyperlink.h?ds=sidebyside diff --git a/interface/wx/hyperlink.h b/interface/wx/hyperlink.h index fa33892e62..1d2bb02c8a 100644 --- a/interface/wx/hyperlink.h +++ b/interface/wx/hyperlink.h @@ -3,17 +3,21 @@ // Purpose: interface of wxHyperlinkEvent // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @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,23 +44,26 @@ 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} Align the text to the left. @style{wxHL_ALIGN_RIGHT} - Align the text to the right. + Align the text to the right. This style is not supported under + Windows XP but is supported under all the other Windows versions. @style{wxHL_ALIGN_CENTRE} - Center the text (horizontally). + Center the text (horizontally). This style is not supported by the + native MSW implementation used under Windows XP and later. @style{wxHL_CONTEXTMENU} Pop up a context menu when the hyperlink is right-clicked. The context menu contains a "Copy URL" menu item which is automatically @@ -68,6 +74,17 @@ public: wxBORDER_NONE|wxHL_CONTEXTMENU|wxHL_ALIGN_CENTRE. @endStyleTable + @beginEventEmissionTable{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 + + 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{wxadv} @category{ctrl} @appearance{hyperlinkctrl.png} @@ -80,13 +97,13 @@ public: /** Constructor. See Create() for more info. */ - wxHyperLink(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"); + 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); /** Creates the hyperlink control. @@ -102,22 +119,18 @@ 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 @@ -127,8 +140,7 @@ public: /** 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. */ virtual wxColour GetNormalColour() const; @@ -145,9 +157,8 @@ 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). */ virtual wxColour GetVisitedColour() const; @@ -158,8 +169,7 @@ public: 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. */ virtual void SetNormalColour(const wxColour& colour); @@ -176,8 +186,7 @@ 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). */ virtual void SetVisitedColour(const wxColour& colour); };