]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_hyperlink.i
Build fix for motif.
[wxWidgets.git] / wxPython / src / _hyperlink.i
CommitLineData
d0e2ede0
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _hyperlink.i
3// Purpose: SWIG interface defs for wxHyperlinkCtrl
4//
5// Author: Robin Dunn
6//
7// Created: 28-May-2006
8// RCS-ID: $Id$
9// Copyright: (c) 2006 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17
18%{
19#include <wx/hyperlink.h>
20%}
21
22MAKE_CONST_WXSTRING(HyperlinkCtrlNameStr);
23
24enum {
25 wxHL_CONTEXTMENU,
26 wxHL_DEFAULT_STYLE
27};
28
29//---------------------------------------------------------------------------
30%newgroup
31
32MustHaveApp(wxHyperlinkCtrl);
33
34
35DocStr( wxHyperlinkCtrl,
36"A static text control that emulates a hyperlink. The link is displayed
37in an appropriate text style, derived from the control's normal font.
38When the mouse rolls over the link, the cursor changes to a hand and
39the link's color changes to the active color.
40
41Clicking on the link does not launch a web browser; instead, a
42wx.HyperlinkEvent is fired. Use the wx.EVT_HYPERLINK to catch link
43events.
44", "");
45
46class wxHyperlinkCtrl : public wxControl
47{
48public:
49 %pythonAppend wxHyperlinkCtrl "self._setOORInfo(self)"
50 %pythonAppend wxHyperlinkCtrl() ""
51
52
53 // Constructor.
54 wxHyperlinkCtrl(wxWindow *parent,
55 wxWindowID id,
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());
62
63 // Creation function (for two-step construction).
64 bool Create(wxWindow *parent,
65 wxWindowID id,
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);
71
72 // get/set
73 wxColour GetHoverColour() const;
74 void SetHoverColour(const wxColour &colour);
75
76 wxColour GetNormalColour() const;
77 void SetNormalColour(const wxColour &colour);
78
79 wxColour GetVisitedColour() const;
80 void SetVisitedColour(const wxColour &colour);
81
82 wxString GetURL() const;
83 void SetURL (const wxString &url);
84
85 void SetVisited(bool visited = true);
86 bool GetVisited() const;
87
88};
89
90
91%constant wxEventType wxEVT_COMMAND_HYPERLINK;
92
93
94//
95// An event fired when the user clicks on the label in a hyperlink control.
96// See HyperlinkControl for details.
97//
98class wxHyperlinkEvent : public wxCommandEvent
99{
100public:
101
102 wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url);
103
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);
108};
109
110
111%pythoncode {
112 EVT_HYPERLINK = wx.PyEventBinder( wxEVT_COMMAND_HYPERLINK, 1 )
113}
114
115
116
117//---------------------------------------------------------------------------
118//---------------------------------------------------------------------------