com :: Viewer :: Viewer :: Class Viewer
[hide private]
[frames] | no frames]

Class Viewer

       object --+        
                |        
Mediator.Mediator --+    
                    |    
  Component.Component --+
                        |
     ui.Widget.Widget --+
                        |
                       Viewer

Base class for viewer components. Components derived from this class appear with an icon in the viewer menu and can be selected by the user.

Example:

 from com import Viewer, msgs
 from theme import theme
 
 class MyViewer(Viewer):
 
     ICON = theme.myviewer_icon
     PRIORITY = 500
 
     def __init__(self):
     
         Viewer.__init__(self)
         
     def handle_message(self, msg, *args):
     
         ...
Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
set_toolbar(self, widgets)
Sets the toolbar from the given widgets.
 
set_title(self, title)
Sets the viewer title to the given text.
 
set_info(self, info)
Sets the viewer info text to the given text.
 
set_strip(self, collection)
Sets the collection of media items that is shown in the side strip.
 
hilight_strip_item(self, idx)
Hilights the given item in the side strip.
 
select_strip_item(self, idx)
Selects the given item in the side strip.
 
show_strip_item(self, idx)
Scrolls to the given item in the side strip.
 
show(self)
This method gets called when the viewer becomes visible.
 
hide(self)
This method gets called when the viewer gets hidden.
 
is_active(self)
Returns whether this viewer is currently the active viewer.
 
__repr__(self)
Returns a string representation of this component. (Inherited from com.Mediator.Mediator)
 
_attach_to_message_bus(self) (Inherited from com.Mediator.Mediator)
 
call_service(self, svc, *args)
Calls the given service and returns the return value of the service. (Inherited from com.Mediator.Mediator)
 
drop_event(self) (Inherited from com.Mediator.Mediator)
 
emit_event(self, event, *args)
Emits the given message. (Inherited from com.Mediator.Mediator)
 
emit_message(self, msg, *args)
Emits the given message. (Inherited from com.Mediator.Mediator)
 
get_pass_type(self) (Inherited from com.Mediator.Mediator)
 
handle_message(self, msg, *args)
Gets invoked when a message arrives on the message bus. (Inherited from com.Mediator.Mediator)
 
pass_on_event(self) (Inherited from com.Mediator.Mediator)
 
set_pass_type(self, ptype) (Inherited from com.Mediator.Mediator)

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

Class Variables [hide private]
  PRIORITY = 0
The priority determines the position of the icon in the viewer menu.
  ICON = None
The specified icon is used for representing the viewer in the viewer menu.
  PASS_TYPE_DROP = 1 (Inherited from com.Mediator.Mediator)
  PASS_TYPE_INVALID = 0 (Inherited from com.Mediator.Mediator)
  PASS_TYPE_PASS_ON = 2 (Inherited from com.Mediator.Mediator)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

set_toolbar(self, widgets)

 

Sets the toolbar from the given widgets.

Parameters:
  • widgets - list of widgets

set_title(self, title)

 

Sets the viewer title to the given text.

Parameters:
  • title - title string

set_info(self, info)

 

Sets the viewer info text to the given text.

Parameters:
  • info - info string

set_strip(self, collection)

 

Sets the collection of media items that is shown in the side strip.

Parameters:
  • collection - list of items (derived from ui.StripItem)

hilight_strip_item(self, idx)

 

Hilights the given item in the side strip.

Parameters:
  • idx - index of the item to hilight

select_strip_item(self, idx)

 

Selects the given item in the side strip.

Parameters:
  • idx - index of the item to select

show_strip_item(self, idx)

 

Scrolls to the given item in the side strip.

Parameters:
  • idx - index of the item to scroll to

show(self)

 

This method gets called when the viewer becomes visible. If you need to take action at this point, you may override this method but do not forget to call this method on the super class as well.

hide(self)

 

This method gets called when the viewer gets hidden. If you need to take action at this point, you may override this method but do not forget to call this method on the super class as well.

is_active(self)

 

Returns whether this viewer is currently the active viewer. There is only one viewer active at a time.

Returns:
whether this viewer is active

Class Variable Details [hide private]

PRIORITY

The priority determines the position of the icon in the viewer menu. All viewers are sorted by priority.

Value:
0