Package wx :: Package lib :: Module hyperlink :: Class HyperLinkCtrl
[frames | no frames]

Type HyperLinkCtrl

object --+                        
         |                        
    Object --+                    
             |                    
    EvtHandler --+                
                 |                
            Window --+            
                     |            
               Control --+        
                         |        
                 PyControl --+    
                             |    
                 GenStaticText --+
                                 |
                                HyperLinkCtrl


HyperLinkCtrl is a control for wxPython that acts like a hyper link in a typical browser. Latest features include the ability to capture your own Left, Middle, and Right click events to perform your own custom event handling and ability to open link in a new or current browser window.

Events

EVT_HYPERLINK_LEFT Sent when the left mouse button is clicked, but only if AutoBrowse is set to False.
EVT_HYPERLINK_MIDDLE Sent when the middle mouse button is clicked.
EVT_HYPERLINK_RIGHT Sent when the right mouse button is clicked, but only if DoPopup is set to False.

Method Summary
  __init__(self, parent, id, label, pos, size, style, name, URL)
Default class constructor.
  AutoBrowse(self, AutoBrowse)
Automatically browse to URL when clicked.
  DisplayError(self, ErrorMessage, ReportErrors)
Displays an error message (according to ReportErrors variable) in a MessageBox.
  DoPopup(self, DoPopup)
Sets whether to show popup menu on right click or not.
  EnableRollover(self, EnableRollover)
Enable/disable rollover.
  GetBold(self)
Returns whether the HyperLink has text in bold or not.
  GetColours(self)
Gets the colours for the link, the visited link and the mouse rollover.
  GetLinkCursor(self)
Gets the link cursor.
  GetUnderlines(self)
Returns if link is underlined, if the mouse rollover is underlined and if the visited link is underlined.
  GetURL(self)
Retrieve the URL associated to the HyperLink.
  GetVisited(self)
Returns whether a link has been visited or not.
  GotoURL(self, URL, ReportErrors, NotSameWinIfPossible)
Goto The Specified URL.
  OnMouseEvent(self, event)
Captures mouse events for cursor, link colors and underlines.
  OnPopUpCopy(self, event)
Copy data from the HyperLink to the clipboard.
  OpenInSameWindow(self, NotSameWinIfPossible)
Open multiple URL in the same window (if possible).
  ReportErrors(self, ReportErrors)
Set whether to report browser errors or not.
  SetBold(self, Bold)
Sets the HyperLink in bold text.
  SetColours(self, link, visited, rollover)
Sets the colours for the link, the visited link and the mouse rollover.
  SetLinkCursor(self, cur)
Sets link cursor properties.
  SetUnderlines(self, link, visited, rollover)
Underlines Properties.
  SetURL(self, URL)
Sets the HyperLink text to the specified URL.
  SetVisited(self, Visited)
Sets a link as visited.
  UpdateLink(self, OnRefresh)
Updates the link.

Property Summary

Class Variable Summary

Instance Method Details

__init__(self, parent, id=-1, label='', pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=0, name='staticText', URL='')
(Constructor)

Default class constructor.

Pass URL == "" to use the label as the url link to navigate to

Overrides:
wx.lib.stattext.GenStaticText.__init__

AutoBrowse(self, AutoBrowse=True)

Automatically browse to URL when clicked. set to False to receive EVT_HYPERLINK_LEFT event.

DisplayError(self, ErrorMessage, ReportErrors=True)

Displays an error message (according to ReportErrors variable) in a MessageBox.

DoPopup(self, DoPopup=True)

Sets whether to show popup menu on right click or not.

EnableRollover(self, EnableRollover=False)

Enable/disable rollover.

GetBold(self)

Returns whether the HyperLink has text in bold or not.

GetColours(self)

Gets the colours for the link, the visited link and the mouse rollover.

GetLinkCursor(self)

Gets the link cursor.

GetUnderlines(self)

Returns if link is underlined, if the mouse rollover is underlined and if the visited link is underlined.

GetURL(self)

Retrieve the URL associated to the HyperLink.

GetVisited(self)

Returns whether a link has been visited or not.

GotoURL(self, URL, ReportErrors=True, NotSameWinIfPossible=False)

Goto The Specified URL.

Parameters:
ReportErrors - Use True to display error dialog if an error occurrs navigating to the URL.

NotSameWinIfPossible - Use True to attempt to open the URL in new browser window.

OnMouseEvent(self, event)

Captures mouse events for cursor, link colors and underlines.

OnPopUpCopy(self, event)

Copy data from the HyperLink to the clipboard.

OpenInSameWindow(self, NotSameWinIfPossible=False)

Open multiple URL in the same window (if possible).

ReportErrors(self, ReportErrors=True)

Set whether to report browser errors or not.

SetBold(self, Bold=False)

Sets the HyperLink in bold text.

SetColours(self, link=wx.Colour(0, 0, 255, 255), visited=wx.Colour(79, 47, 79, 255), rollover=wx.Colour(0, 0, 255, 255))

Sets the colours for the link, the visited link and the mouse rollover.

Defaults Are:
  • New Link: RED
  • Visited Link: VIOLET
  • Rollover: BLUE

SetLinkCursor(self, cur=6)

Sets link cursor properties.

SetUnderlines(self, link=True, visited=True, rollover=True)

Underlines Properties.

SetURL(self, URL)

Sets the HyperLink text to the specified URL.

SetVisited(self, Visited=False)

Sets a link as visited.

UpdateLink(self, OnRefresh=True)

Updates the link.

Changing text properties if:
  • User Specific Setting
  • Link Visited
  • New Link

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:08:07 2007 http://epydoc.sf.net