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;
84 %property(HoverColour, GetHoverColour, SetHoverColour, doc="See `GetHoverColour` and `SetHoverColour`");
85 %property(NormalColour, GetNormalColour, SetNormalColour, doc="See `GetNormalColour` and `SetNormalColour`");
86 %property(URL, GetURL, SetURL, doc="See `GetURL` and `SetURL`");
87 %property(Visited, GetVisited, SetVisited, doc="See `GetVisited` and `SetVisited`");
88 %property(VisitedColour, GetVisitedColour, SetVisitedColour, doc="See `GetVisitedColour` and `SetVisitedColour`");
92 %constant wxEventType wxEVT_COMMAND_HYPERLINK;
96 // An event fired when the user clicks on the label in a hyperlink control.
97 // See HyperlinkControl for details.
99 class wxHyperlinkEvent : public wxCommandEvent
103 wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url);
105 // Returns the URL associated with the hyperlink control
106 // that the user clicked on.
107 wxString GetURL() const;
108 void SetURL(const wxString &url);
110 %property(URL, GetURL, SetURL, doc="See `GetURL` and `SetURL`");
115 EVT_HYPERLINK = wx.PyEventBinder( wxEVT_COMMAND_HYPERLINK, 1 )
120 //---------------------------------------------------------------------------
121 //---------------------------------------------------------------------------