1//--------------------------------------------------------------------------- 2// This file is generated by wxPython's SIP generator. Do not edit by hand. 3// 4// Copyright: (c) 2018 by Total Control Software 5// License: wxWindows License 6// 7// This file will be included by _adv.sip 8// 9//--------------------------------------------------------------------------- 10 11%ModuleHeaderCode 12#include <wx/hyperlink.h> 13%End 14 15 16//--------------------------------------------------------------------------- 17 18const int wxHL_CONTEXTMENU; 19const int wxHL_ALIGN_LEFT; 20const int wxHL_ALIGN_RIGHT; 21const int wxHL_ALIGN_CENTRE; 22const int wxHL_DEFAULT_STYLE; 23wxEventType wxEVT_HYPERLINK /PyName=wxEVT_HYPERLINK/; 24 25class wxHyperlinkEvent : wxCommandEvent 26{ 27 %Docstring 28 HyperlinkEvent(generator, id, url) 29 30 This event class is used for the events generated by wxHyperlinkCtrl. 31 %End 32 %TypeHeaderCode 33 #include <wx/hyperlink.h> 34 %End 35 36public: 37 wxHyperlinkEvent( 38 wxObject * generator, 39 int id, 40 const wxString & url 41 ); 42 43 wxString GetURL() const; 44 %Docstring 45 GetURL() -> String 46 47 Returns the URL of the hyperlink where the user has just clicked. 48 %End 49 50 void SetURL( 51 const wxString & url 52 ); 53 %Docstring 54 SetURL(url) 55 56 Sets the URL associated with the event. 57 %End 58 59 public: 60 virtual wxEvent* Clone() const /Factory/; 61 62 63 private: 64 wxHyperlinkEvent& operator=(const wxHyperlinkEvent&); 65 66 67 public: 68 69 70 %Property(name=URL, get=GetURL, set=SetURL) 71}; // end of class wxHyperlinkEvent 72 73 74const char* wxHyperlinkCtrlNameStr; 75 76class wxHyperlinkCtrl : wxControl 77{ 78 %Docstring 79 HyperlinkCtrl() 80 HyperlinkCtrl(parent, id=wx.ID_ANY, label=wx.EmptyString, url=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=HL_DEFAULT_STYLE, name=HyperlinkCtrlNameStr) 81 82 This class shows a static text element which links to an URL. 83 %End 84 %TypeHeaderCode 85 #include <wx/hyperlink.h> 86 %End 87 88public: 89 wxHyperlinkCtrl(); 90 %PreMethodCode 91 if (!wxPyCheckForApp()) return NULL; 92 %End 93 94 wxHyperlinkCtrl( 95 wxWindow * parent /TransferThis/, 96 wxWindowID id = wxID_ANY, 97 const wxString & label = wxEmptyString, 98 const wxString & url = wxEmptyString, 99 const wxPoint & pos = wxDefaultPosition, 100 const wxSize & size = wxDefaultSize, 101 long style = wxHL_DEFAULT_STYLE, 102 const wxString & name = wxHyperlinkCtrlNameStr 103 ); 104 %PreMethodCode 105 if (!wxPyCheckForApp()) return NULL; 106 %End 107 108 bool Create( 109 wxWindow * parent /TransferThis/, 110 wxWindowID id = wxID_ANY, 111 const wxString & label = wxEmptyString, 112 const wxString & url = wxEmptyString, 113 const wxPoint & pos = wxDefaultPosition, 114 const wxSize & size = wxDefaultSize, 115 long style = wxHL_DEFAULT_STYLE, 116 const wxString & name = wxHyperlinkCtrlNameStr 117 ); 118 %Docstring 119 Create(parent, id=wx.ID_ANY, label=wx.EmptyString, url=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=HL_DEFAULT_STYLE, name=HyperlinkCtrlNameStr) -> bool 120 121 Creates the hyperlink control. 122 %End 123 124 wxColour GetHoverColour() const; 125 %Docstring 126 GetHoverColour() -> wx.Colour 127 128 Returns the colour used to print the label of the hyperlink when the 129 mouse is over the control. 130 %End 131 132 wxColour GetNormalColour() const; 133 %Docstring 134 GetNormalColour() -> wx.Colour 135 136 Returns the colour used to print the label when the link has never 137 been clicked before (i.e. the link has not been visited) and the mouse 138 is not over the control. 139 %End 140 141 wxString GetURL() const; 142 %Docstring 143 GetURL() -> String 144 145 Returns the URL associated with the hyperlink. 146 %End 147 148 bool GetVisited() const; 149 %Docstring 150 GetVisited() -> bool 151 152 Returns true if the hyperlink has already been clicked by the user at 153 least one time. 154 %End 155 156 wxColour GetVisitedColour() const; 157 %Docstring 158 GetVisitedColour() -> wx.Colour 159 160 Returns the colour used to print the label when the mouse is not over 161 the control and the link has already been clicked before (i.e. the 162 link has been visited). 163 %End 164 165 void SetHoverColour( 166 const wxColour & colour 167 ); 168 %Docstring 169 SetHoverColour(colour) 170 171 Sets the colour used to print the label of the hyperlink when the 172 mouse is over the control. 173 %End 174 175 void SetNormalColour( 176 const wxColour & colour 177 ); 178 %Docstring 179 SetNormalColour(colour) 180 181 Sets the colour used to print the label when the link has never been 182 clicked before (i.e. the link has not been visited) and the mouse is 183 not over the control. 184 %End 185 186 void SetURL( 187 const wxString & url 188 ); 189 %Docstring 190 SetURL(url) 191 192 Sets the URL associated with the hyperlink. 193 %End 194 195 void SetVisited( 196 bool visited = true 197 ); 198 %Docstring 199 SetVisited(visited=True) 200 201 Marks the hyperlink as visited (see 202 wxHyperlinkCtrl::SetVisitedColour). 203 %End 204 205 void SetVisitedColour( 206 const wxColour & colour 207 ); 208 %Docstring 209 SetVisitedColour(colour) 210 211 Sets the colour used to print the label when the mouse is not over the 212 control and the link has already been clicked before (i.e. the link 213 has been visited). 214 %End 215 216 public: 217 virtual wxPoint GetClientAreaOrigin() const; 218 virtual bool Validate(); 219 virtual bool TransferDataToWindow(); 220 virtual bool TransferDataFromWindow(); 221 virtual void InitDialog(); 222 virtual bool AcceptsFocus() const; 223 virtual bool AcceptsFocusRecursively() const; 224 virtual bool AcceptsFocusFromKeyboard() const; 225 virtual void AddChild( wxWindowBase *child ); 226 virtual void RemoveChild( wxWindowBase *child ); 227 virtual void InheritAttributes(); 228 virtual bool ShouldInheritColours() const; 229 virtual void OnInternalIdle(); 230 virtual wxWindow *GetMainWindowOfCompositeControl(); 231 virtual bool InformFirstDirection(int direction, int size, int availableOtherDir); 232 virtual void SetCanFocus(bool canFocus); 233 virtual bool Destroy(); 234 virtual void SetValidator( const wxValidator &validator ); 235 virtual wxValidator* GetValidator(); 236 237 238 protected: 239 virtual bool ProcessEvent(wxEvent & event); 240 virtual void DoEnable(bool enable); 241 virtual void DoGetPosition(int *x, int *y) const; 242 virtual void DoGetSize(int *width, int *height) const; 243 virtual void DoGetClientSize(int *width, int *height) const; 244 virtual wxSize DoGetBestSize() const; 245 virtual wxSize DoGetBestClientSize() const; 246 virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags); 247 virtual void DoSetClientSize(int width, int height); 248 virtual void DoSetSizeHints( int minW, int minH, int maxW, int maxH, int incW, int incH ); 249 virtual wxSize DoGetBorderSize() const; 250 virtual void DoMoveWindow(int x, int y, int width, int height); 251 virtual void DoSetWindowVariant( wxWindowVariant variant); 252 virtual wxBorder GetDefaultBorder() const; 253 virtual wxBorder GetDefaultBorderForControl() const; 254 virtual void DoFreeze(); 255 virtual void DoThaw(); 256 virtual bool HasTransparentBackground(); 257 virtual bool TryBefore(wxEvent& event); 258 virtual bool TryAfter(wxEvent& event); 259 260 261 public: 262 263 264 static 265 wxVisualAttributes GetClassDefaultAttributes( 266 wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL 267 ); 268 %Docstring 269 GetClassDefaultAttributes(variant=wx.WINDOW_VARIANT_NORMAL) -> wx.VisualAttributes 270 %End 271 %PreMethodCode 272 if (!wxPyCheckForApp()) return NULL; 273 %End 274 275 public: 276 277 278 %Property(name=HoverColour, get=GetHoverColour, set=SetHoverColour) 279 %Property(name=NormalColour, get=GetNormalColour, set=SetNormalColour) 280 %Property(name=URL, get=GetURL, set=SetURL) 281 %Property(name=Visited, get=GetVisited, set=SetVisited) 282 %Property(name=VisitedColour, get=GetVisitedColour, set=SetVisitedColour) 283}; // end of class wxHyperlinkCtrl 284 285 286%Extract(id=pycode_adv) 287EVT_HYPERLINK = wx.PyEventBinder( wxEVT_HYPERLINK, 1 ) 288 289# deprecated wxEVT alias 290wxEVT_COMMAND_HYPERLINK = wxEVT_HYPERLINK 291 292%End 293 294 295//--------------------------------------------------------------------------- 296 297