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 //---------------------------------------------------------------------------
18 MAKE_CONST_WXSTRING(HyperlinkCtrlNameStr);
25 //---------------------------------------------------------------------------
28 MustHaveApp(wxHyperlinkCtrl);
31 DocStr( wxHyperlinkCtrl,
32 "A static text control that emulates a hyperlink. The link is displayed
33 in an appropriate text style, derived from the control's normal font.
34 When the mouse rolls over the link, the cursor changes to a hand and
35 the link's color changes to the active color.
37 Clicking on the link does not launch a web browser; instead, a
38 wx.HyperlinkEvent is fired. Use the wx.EVT_HYPERLINK to catch link
42 class wxHyperlinkCtrl : public wxControl
45 %pythonAppend wxHyperlinkCtrl "self._setOORInfo(self)"
46 %pythonAppend wxHyperlinkCtrl() ""
50 wxHyperlinkCtrl(wxWindow *parent,
52 const wxString& label, const wxString& url,
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize,
55 long style = wxHL_DEFAULT_STYLE,
56 const wxString& name = wxPyHyperlinkCtrlNameStr);
57 %RenameCtor(PreHyperlinkCtrl, wxHyperlinkCtrl());
59 // Creation function (for two-step construction).
60 bool Create(wxWindow *parent,
62 const wxString& label, const wxString& url,
63 const wxPoint& pos = wxDefaultPosition,
64 const wxSize& size = wxDefaultSize,
65 long style = wxHL_DEFAULT_STYLE,
66 const wxString& name = wxPyHyperlinkCtrlNameStr);
69 wxColour GetHoverColour() const;
70 void SetHoverColour(const wxColour &colour);
72 wxColour GetNormalColour() const;
73 void SetNormalColour(const wxColour &colour);
75 wxColour GetVisitedColour() const;
76 void SetVisitedColour(const wxColour &colour);
78 wxString GetURL() const;
79 void SetURL (const wxString &url);
81 void SetVisited(bool visited = true);
82 bool GetVisited() const;
87 %constant wxEventType wxEVT_COMMAND_HYPERLINK;
91 // An event fired when the user clicks on the label in a hyperlink control.
92 // See HyperlinkControl for details.
94 class wxHyperlinkEvent : public wxCommandEvent
98 wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url);
100 // Returns the URL associated with the hyperlink control
101 // that the user clicked on.
102 wxString GetURL() const;
103 void SetURL(const wxString &url);
108 EVT_HYPERLINK = wx.PyEventBinder( wxEVT_COMMAND_HYPERLINK, 1 )
113 //---------------------------------------------------------------------------
114 //---------------------------------------------------------------------------