1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface defs for wxHyperlinkCtrl
7 // Created: 28-May-2006
9 // Copyright: (c) 2006 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 #include <wx/hyperlink.h>
22 MAKE_CONST_WXSTRING(HyperlinkCtrlNameStr);
29 //---------------------------------------------------------------------------
32 MustHaveApp(wxHyperlinkCtrl);
35 DocStr( wxHyperlinkCtrl,
36 "A static text control that emulates a hyperlink. The link is displayed
37 in an appropriate text style, derived from the control's normal font.
38 When the mouse rolls over the link, the cursor changes to a hand and
39 the link's color changes to the active color.
41 Clicking on the link does not launch a web browser; instead, a
42 wx.HyperlinkEvent is fired. Use the wx.EVT_HYPERLINK to catch link
46 class wxHyperlinkCtrl : public wxControl
49 %pythonAppend wxHyperlinkCtrl "self._setOORInfo(self)"
50 %pythonAppend wxHyperlinkCtrl() ""
54 wxHyperlinkCtrl(wxWindow *parent,
56 const wxString& label, const wxString& url,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize,
59 long style = wxHL_DEFAULT_STYLE,
60 const wxString& name = wxPyHyperlinkCtrlNameStr);
61 %RenameCtor(PreHyperlinkCtrl, wxHyperlinkCtrl());
63 // Creation function (for two-step construction).
64 bool Create(wxWindow *parent,
66 const wxString& label, const wxString& url,
67 const wxPoint& pos = wxDefaultPosition,
68 const wxSize& size = wxDefaultSize,
69 long style = wxHL_DEFAULT_STYLE,
70 const wxString& name = wxPyHyperlinkCtrlNameStr);
73 wxColour GetHoverColour() const;
74 void SetHoverColour(const wxColour &colour);
76 wxColour GetNormalColour() const;
77 void SetNormalColour(const wxColour &colour);
79 wxColour GetVisitedColour() const;
80 void SetVisitedColour(const wxColour &colour);
82 wxString GetURL() const;
83 void SetURL (const wxString &url);
85 void SetVisited(bool visited = true);
86 bool GetVisited() const;
91 %constant wxEventType wxEVT_COMMAND_HYPERLINK;
95 // An event fired when the user clicks on the label in a hyperlink control.
96 // See HyperlinkControl for details.
98 class wxHyperlinkEvent : public wxCommandEvent
102 wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url);
104 // Returns the URL associated with the hyperlink control
105 // that the user clicked on.
106 wxString GetURL() const;
107 void SetURL(const wxString &url);
112 EVT_HYPERLINK = wx.PyEventBinder( wxEVT_COMMAND_HYPERLINK, 1 )
117 //---------------------------------------------------------------------------
118 //---------------------------------------------------------------------------