]>
git.saurik.com Git - wxWidgets.git/blob - interface/hyperlink.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxHyperlinkEvent class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxHyperlinkEvent
11 @wxheader{hyperlink.h}
13 This event class is used for the events generated by
19 class wxHyperlinkEvent
: public wxCommandEvent
23 The constructor is not normally used by the user code.
25 wxHyperlinkEvent(wxObject
* generator
, int id
,
26 const wxString
& url
);
29 Returns the URL of the hyperlink where the user has just clicked.
31 #define wxString GetURL() /* implementation is private */
34 Sets the URL associated with the event.
36 #define void SetURL(const wxString & url) /* implementation is private */
41 @class wxHyperlinkCtrl
42 @wxheader{hyperlink.h}
44 This class shows a static text element which links to an URL.
45 Appearance and behaviour is completely customizable. In fact, when the user
46 clicks on the hyperlink, a wxHyperlinkEvent is
47 sent but if that event is not handled (or it's skipped; see
48 wxEvent::Skip), then a call to
49 wxLaunchDefaultBrowser is done with the
52 Note that standard wxWindow functions like wxWindow::SetBackgroundColour,
53 wxWindow::SetFont, wxWindow::SetCursor, wxWindow::SetLabel can be used to customize appearance of the hyperlink.
56 @style{wxHL_ALIGN_LEFT}:
57 Align the text to the left.
58 @style{wxHL_ALIGN_RIGHT}:
59 Align the text to the right.
60 @style{wxHL_ALIGN_CENTRE}:
61 Center the text (horizontally).
62 @style{wxHL_CONTEXTMENU}:
63 Pop up a context menu when the hyperlink is right-clicked. The
64 context menu contains a "Copy URL" menu item which is automatically
65 handled by the hyperlink and which just copies in the clipboard the
66 URL (not the label) of the control.
67 @style{wxHL_DEFAULT_STYLE}:
68 The default style for wxHyperlinkCtrl:
69 wxBORDER_NONE|wxHL_CONTEXTMENU|wxHL_ALIGN_CENTRE.
74 @appearance{hyperlinkctrl.png}
77 wxURL, wxHyperlinkEvent
79 class wxHyperlinkCtrl
: public wxControl
83 Creates the hyperlink control.
86 Parent window. Must not be @NULL.
89 Window identifier. A value of wxID_ANY indicates a default value.
92 The label of the hyperlink.
95 The URL associated with the given label.
101 Window size. If the wxDefaultSize is specified then the window is sized
105 Window style. See wxHyperlinkCtrl.
113 bool Create(wxWindow
* parent
, wxWindowID id
,
114 const wxString
& label
,
115 const wxString
& url
,
116 const wxPoint
& pos
= wxDefaultPosition
,
117 const wxSize
& size
= wxDefaultSize
,
119 const wxString
& name
= "hyperlink");
122 Returns the colour used to print the label of the hyperlink when the mouse is
125 wxColour
GetHoverColour();
128 Returns the colour used to print the label when the link has never been clicked
130 (i.e. the link has not been @e visited) and the mouse is not over the control.
132 wxColour
GetNormalColour();
135 Returns the URL associated with the hyperlink.
137 #define wxString GetURL() /* implementation is private */
140 Returns @true if the hyperlink has already been clicked by the user at least
146 Returns the colour used to print the label when the mouse is not over the
148 and the link has already been clicked before (i.e. the link has been @e
151 wxColour
GetVisitedColour();
154 Sets the colour used to print the label of the hyperlink when the mouse is over
157 void SetHoverColour(const wxColour
& colour
);
160 Sets the colour used to print the label when the link has never been clicked
162 (i.e. the link has not been @e visited) and the mouse is not over the control.
164 void SetNormalColour(const wxColour
& colour
);
167 Sets the URL associated with the hyperlink.
169 #define void SetURL(const wxString & url) /* implementation is private */
172 Marks the hyperlink as visited (see wxHyperlinkCtrl::SetVisitedColour).
174 void SetVisited(bool visited
= @
true);
177 Sets the colour used to print the label when the mouse is not over the control
178 and the link has already been clicked before (i.e. the link has been @e
181 void SetVisitedColour(const wxColour
& colour
);
184 Constructor. See Create() for more info.
186 wxHyperLink(wxWindow
* parent
, wxWindowID id
,
187 const wxString
& label
,
188 const wxString
& url
,
189 const wxPoint
& pos
= wxDefaultPosition
,
190 const wxSize
& size
= wxDefaultSize
,
192 const wxString
& name
= "hyperlink");