Module eagle :: Class RichText
[hide private]
[frames] | no frames]

Class RichText
source code

object --+        
         |        
 _EGObject --+    
             |    
     _EGWidget --+
                 |
                RichText

A Rich Text viewer

Display text with basic formatting instructions. Formatting is done using a HTML subset.

Nested Classes [hide private]
Renderer Specialized TextView to render formatted texts.
Parser HTML subset parser
Formatter HTML subset formatter

Instance Methods [hide private]
  __init__(self, id, text="", label=None, link_color="blue", fgcolor=None, bgcolor=None, callback=None, img_provider=None, expand_policy=None)
RichText constructor.
  __setup_gui__(self)
  __setup_parser__(self)
  __setup_connections__(self)
  set_text(self, text)
Replace current text
  get_text(self)
Return current text, with formatting tags
  append(self, text)
  set_label(self, label)
  get_label(self)
  __str__(self)
str(x)
  __repr__(self)
str(x)

Inherited from _EGWidget: __configure_orientation__, __get_widgets__, hide, set_active, set_inactive, show

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__


Class Variables [hide private]
bgcolor  
fgcolor  
link_color  
padding  
text  
label  

Inherited from _EGWidget: ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL, app

Inherited from _EGObject: id

Inherited from object: __class__


Method Details [hide private]

__init__(self, id, text="", label=None, link_color="blue", fgcolor=None, bgcolor=None, callback=None, img_provider=None, expand_policy=None)
(Constructor)

source code 
RichText constructor.

@param id: unique identifier.
@param text: text to use in this viewer.
@param label: label to display in the widget frame around the viewer.
       If None, no label or frame will be shown.
@param link_color: color to use for links.
@param fgcolor: color to use for foreground (text)
@param bgcolor: color to use for background.
@param callback: function (or list of functions) to call when
       user clicks a link. Links to anchor will automatically make
       the anchor/mark visible and then callback. Function will get
       as parameters:
        - App reference
        - RichText reference
        - href contents (string)
        - offset from buffer begin (integer)
@param img_provider: if images could not be resolved, call this
       function. It should get an address (string) and return an
       eagle.Image. Eagle already provides a handle to addresses
       prefixed with "eagle://", the following part should be an
       eagle.Image id, and the image should be live (not garbage
       collected) when displaying it, so remember to keep a
       reference to it! You may use img_provider to download
       files from webservers and stuff like that.
       Function signature:
          def img_provider( filename ):
              return eagle.Image( ... )
@param expand_policy: how this widget should fit space, see
       L{ExpandPolicy.Policy.Rule}.

Overrides: _EGWidget.__init__

__setup_gui__(self)

source code 

__setup_parser__(self)

source code 

__setup_connections__(self)

source code 

set_text(self, text)

source code 
Replace current text

get_text(self)

source code 
Return current text, with formatting tags

append(self, text)

source code 

set_label(self, label)

source code 

get_label(self)

source code 

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: _EGObject.__str__

__repr__(self)
(Representation operator)

source code 
str(x)
Overrides: _EGObject.__str__

Class Variable Details [hide private]

bgcolor

Value:
_gen_ro_property("bgcolor")                                            
      

fgcolor

Value:
_gen_ro_property("fgcolor")                                            
      

link_color

Value:
_gen_ro_property("link_color")                                         
      

padding

Value:
5                                                                      
      

text

Value:
property(get_text,set_text)                                            
      

label

Value:
property(get_label,set_label)