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);
28 //---------------------------------------------------------------------------
32 MustHaveApp(wxHyperlinkCtrl);
34 DocStr( wxHyperlinkCtrl,
35 "A static text control that emulates a hyperlink. The link is displayed
36 in an appropriate text style, derived from the control's normal font.
37 When the mouse rolls over the link, the cursor changes to a hand and
38 the link's color changes to the active color.
40 Clicking on the link does not launch a web browser; instead, a
41 wx.HyperlinkEvent is fired. Use the wx.EVT_HYPERLINK to catch link
45 class wxHyperlinkCtrl : public wxControl
48 %pythonAppend wxHyperlinkCtrl "self._setOORInfo(self)"
49 %pythonAppend wxHyperlinkCtrl() ""
53 wxHyperlinkCtrl(wxWindow *parent,
55 const wxString& label, const wxString& url,
56 const wxPoint& pos = wxDefaultPosition,
57 const wxSize& size = wxDefaultSize,
58 long style = wxHL_DEFAULT_STYLE,
59 const wxString& name = wxPyHyperlinkCtrlNameStr);
60 %RenameCtor(PreHyperlinkCtrl, wxHyperlinkCtrl());
62 // Creation function (for two-step construction).
63 bool Create(wxWindow *parent,
65 const wxString& label, const wxString& url,
66 const wxPoint& pos = wxDefaultPosition,
67 const wxSize& size = wxDefaultSize,
68 long style = wxHL_DEFAULT_STYLE,
69 const wxString& name = wxPyHyperlinkCtrlNameStr);
72 wxColour GetHoverColour() const;
73 void SetHoverColour(const wxColour &colour);
75 wxColour GetNormalColour() const;
76 void SetNormalColour(const wxColour &colour);
78 wxColour GetVisitedColour() const;
79 void SetVisitedColour(const wxColour &colour);
81 wxString GetURL() const;
82 void SetURL (const wxString &url);
84 void SetVisited(bool visited = true);
85 bool GetVisited() const;
87 %property(HoverColour, GetHoverColour, SetHoverColour, doc="See `GetHoverColour` and `SetHoverColour`");
88 %property(NormalColour, GetNormalColour, SetNormalColour, doc="See `GetNormalColour` and `SetNormalColour`");
89 %property(URL, GetURL, SetURL, doc="See `GetURL` and `SetURL`");
90 %property(Visited, GetVisited, SetVisited, doc="See `GetVisited` and `SetVisited`");
91 %property(VisitedColour, GetVisitedColour, SetVisitedColour, doc="See `GetVisitedColour` and `SetVisitedColour`");
95 %constant wxEventType wxEVT_COMMAND_HYPERLINK;
99 // An event fired when the user clicks on the label in a hyperlink control.
100 // See HyperlinkControl for details.
102 class wxHyperlinkEvent : public wxCommandEvent
106 wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url);
108 // Returns the URL associated with the hyperlink control
109 // that the user clicked on.
110 wxString GetURL() const;
111 void SetURL(const wxString &url);
113 %property(URL, GetURL, SetURL, doc="See `GetURL` and `SetURL`");
118 EVT_HYPERLINK = wx.PyEventBinder( wxEVT_COMMAND_HYPERLINK, 1 )
123 //---------------------------------------------------------------------------
124 //---------------------------------------------------------------------------