Class e.p.p.w.l.List(Widget):

Part of elisa.plugins.pigment.widgets.list View In Hierarchy

Known subclasses: elisa.plugins.pigment.widgets.list_carrousel.ListCarrousel, elisa.plugins.pigment.widgets.list_horizontal.ListHorizontal, elisa.plugins.pigment.widgets.list_vertical.ListVertical, elisa.plugins.poblesec.base.coverflow.CoverflowList, elisa.plugins.poblesec.player_slideshow.ListFading

Abstract list widget. It displays data stored in the L{model} list. Items
of L{model} are rendered into widgets instances of the widget class passed
to the constructor using the specified L{renderer} function.

Usage example for a list of strings rendered in Text drawables:

    l = List(Text)

    def renderer(item, widget):
        widget.label = str(item)
        widget.bg_a = 0

    model = range(100)

    l.set_renderer(renderer)
    l.set_model(model)


Emit the signals:
  - item-clicked: when an item of the list is clicked
  - selected-item-changed: when the selected item in the list changes

@ivar selected_item_index:    index of the currently selected item in the
                              L{model}
@type selected_item_index:    int
@ivar visible_range_size:     number of rendered items
@type visible_range_size:     float
@ivar model:                  list of data items that is rendered by the
                              list widget
@type model:                  list
@ivar drag_motion_resolution: minimum time between 2 drag events in milliseconds
@type drag_motion_resolution: int
@ivar drag_threshold:         amount of movement needed to activate dragging
                              in canvas coordinates
@type drag_threshold:         float
@ivar animated:               True if the list is animated, False otherwise
@type animated:               bool
@ivar preloaded:              number of items that are prerendered before
                              they become visible
@type preloaded:              int
@ivar focus_on_click:         whether the button will grab focus when clicked
@type focus_on_click:         boolean
Line # Kind Name Docs
91 Method __init__
139 Method set_model Set the list of items that are rendered by the list widget. Further
163 Method set_renderer Function used by the list widget to render an item of the model. It
177 Method set_selector Undocumented
311 Method visible_range_start__get Undocumented
314 Method visible_range_start__set Undocumented
333 Method visible_range_size__get Undocumented
336 Method visible_range_size__set Undocumented
372 Method selected_item_index__get Undocumented
375 Method selected_item_index__set Undocumented
485 Method compute_height Undocumented
488 Method compute_width Undocumented
491 Method compute_x Undocumented
494 Method compute_y Undocumented
497 Method compute_z Undocumented
500 Method compute_opacity Undocumented
536 Method visible__set Undocumented
545 Method do_focus Undocumented
548 Method do_released Undocumented
553 Method do_scrolled Undocumented
562 Method do_drag_begin Undocumented
577 Method do_drag_end Undocumented
588 Method do_item_clicked Undocumented
594 Method do_selected_item_changed Undocumented
675 Method clean Undocumented
204 Method _connect_widget Undocumented
209 Method _connect_widget_signal_to_own_with_model
221 Method _emit_item_clicked Undocumented
229 Method _on_items_changed Undocumented
235 Method _on_items_deleted Undocumented
248 Method _on_items_inserted Undocumented
274 Method _on_items_reordered Undocumented
277 Method _move_widgets_from_beginning_to_end Undocumented
282 Method _move_widgets_from_end_to_beginning Undocumented
287 Method _item_index_from_widget_index Undocumented
291 Method _widget_index_from_item_index Undocumented
295 Method _render_widgets Undocumented
308 Method _render_all Undocumented
358 Method _create_widgets Undocumented
408 Method _selected_to_range_start Undocumented
418 Method _range_start_to_selected Undocumented
425 Method _layout_widget Undocumented
428 Method _prepare_all_widgets Undocumented
432 Method _prepare_widget Undocumented
435 Method _prepare_selector Undocumented
438 Method _layout_all_widgets Undocumented
450 Method _layout_selector Undocumented
465 Method _set_selector_opacity Undocumented
474 Method _set_selector_visibility Undocumented
601 Method _decelerate Undocumented
628 Method _stop_deceleration Undocumented
635 Class Method _demo_widget Meant to be overidden by inheriting widgets for widget creation and

Inherited from Widget:

Line # Kind Name Docs
135 Method state__get The present state of the widget
139 Method state__set Set the state of the widget and emit the "state-changed" signal if
156 Method do_state_changed Default 'state-changed' handler
163 Method style__get The present style
167 Method style__set Set the present style, after binding it to the widget and subscribing
187 Method do_style_set Default 'style-set' signal handler
209 Method get_parent Get the parent, if exists.
217 Method get_children Get the list of direct children.
225 Method get_root Get the root of the widget's tree hierarchy
236 Method get_descendants Get the list of nodes in the subtree
250 Method focus__get Whether the widget has focus
254 Method focus__set Set or unset the focus on the widget and emit the 'focus' signal.
282 Method focus_child__get Get the child with focus
290 Method do_key_press_event Default 'key-press-event' signal handler.
353 Class Method demo Create a demo widget, put it on a canvas and show it in a viewport.
92 Method _init_styles Undocumented
183 Method _style_property_changed Undocumented
192 Method _update_style_properties Update the widget's appearence basing on the properties set.
302 Method _do_real_key_press_event Undocumented
306 Class Method _demo_create_viewport Undocumented
313 Class Method _on_demo_delete Undocumented
332 Class Method _set_demo_widget_defaults Undocumented

Inherited from Group (via Widget):

Line # Kind Name Docs
82 Method canvas__set Undocumented
102 Method canvas__get Undocumented
107 Method layer__set Undocumented
120 Method layer__get Undocumented
128 Method add Undocumented
162 Method remove Undocumented
176 Method empty Undocumented
186 Method __len__ Undocumented
189 Method __iter__ Undocumented
192 Method update_absolute_x Undocumented
199 Method update_absolute_y Undocumented
206 Method update_absolute_z Undocumented
213 Method update_absolute_position Undocumented
220 Method update_absolute_width Undocumented
229 Method update_absolute_height Undocumented
238 Method update_absolute_size Undocumented
247 Method update_absolute_visible Undocumented
252 Method update_absolute_opacity Undocumented
258 Method regenerate Undocumented
262 Method absolute_width__get Undocumented
265 Method absolute_width__set Undocumented
270 Method absolute_height__get Undocumented
273 Method absolute_height__set Undocumented
278 Method absolute_x__get Undocumented
281 Method absolute_x__set Undocumented
287 Method absolute_y__get Undocumented
290 Method absolute_y__set Undocumented
296 Method absolute_z__get Undocumented
299 Method absolute_z__set Undocumented
150 Method _proxy_child_signal_scrolled Undocumented
154 Method _proxy_child_signal Undocumented
158 Method _proxy_child_signal_with_pressure Undocumented

Inherited from Node (via Widget, Group):

Line # Kind Name Docs
37 Method parent__set Undocumented
57 Method parent__get Undocumented
62 Method x__get Undocumented
68 Method x__set Undocumented
84 Method y__get Undocumented
90 Method y__set Undocumented
107 Method z__get Undocumented
113 Method z__set Undocumented
130 Method position__get Undocumented
136 Method position__set Undocumented
160 Method width__get Undocumented
166 Method width__set Undocumented
184 Method height__get Undocumented
190 Method height__set Undocumented
210 Method size__get Undocumented
216 Method size__set Undocumented
236 Method visible__get Undocumented
260 Method opacity__get Undocumented
266 Method opacity__set Undocumented
def __init__(self, widget_class, visible_range_size=7):
Parameterswidget_classwidget type used to render the items of the model (type: type inheriting from elisa.plugins.pigment.widgets.widget.Widget )
visible_range_sizeDOCME (type: int )
def set_model(self, model):
Set the list of items that are rendered by the list widget. Further updates to the model are automatically picked up by the list widget.
Parametersmodellist of items that should be rendered by the list widget (type: list )
def set_renderer(self, renderer):
Function used by the list widget to render an item of the model. It takes an item of the model as the first argument and an instance of the widget class passed to the constructor of the list widget as the second argument.
Parametersrendererfunction called to render an item of the model to the widget used for rendering (type: callable )
def set_selector(self, selector):
Undocumented
def _connect_widget(self, widget):
Undocumented
def _connect_widget_signal_to_own_with_model(self, widget, widget_signal, local_signal):
Parameterswidgetthe widget to connect to (type: elisa.plugins.pigment.widgets.widget.Widget )
widget_signalthe name of the signal of the widget (type: str )
local_signalthe name of the signal of the list (type: str )
def _emit_item_clicked(self, widget, *args):
Undocumented
def _on_items_changed(self, notifier, index, items):
Undocumented
def _on_items_deleted(self, notifier, index, items):
Undocumented
def _on_items_inserted(self, notifier, index, items):
Undocumented
def _on_items_reordered(self, notifier):
Undocumented
def _move_widgets_from_beginning_to_end(self, number):
Undocumented
def _move_widgets_from_end_to_beginning(self, number):
Undocumented
def _item_index_from_widget_index(self, widget_index):
Undocumented
def _widget_index_from_item_index(self, item_index):
Undocumented
def _render_widgets(self, start, end):
Undocumented
def _render_all(self):
Undocumented
def visible_range_start__get(self):
Undocumented
def visible_range_start__set(self, visible_range_start):
Undocumented
def visible_range_size__get(self):
Undocumented
def visible_range_size__set(self, visible_range_size):
Undocumented
def _create_widgets(self):
Undocumented
def selected_item_index__get(self):
Undocumented
def selected_item_index__set(self, index):
Undocumented
def _selected_to_range_start(self, selected):
Undocumented
def _range_start_to_selected(self, range_start):
Undocumented
def _layout_widget(self, widget, position):
Undocumented
def _prepare_all_widgets(self):
Undocumented
def _prepare_widget(self, widget):
Undocumented
def _prepare_selector(self):
Undocumented
def _layout_all_widgets(self):
Undocumented
def _layout_selector(self):
Undocumented
def _set_selector_opacity(self):
Undocumented
def _set_selector_visibility(self):
Undocumented
def compute_height(self, index):
Undocumented
def compute_width(self, index):
Undocumented
def compute_x(self, index):
Undocumented
def compute_y(self, index):
Undocumented
def compute_z(self, index):
Undocumented
def compute_opacity(self, index):
Undocumented
def visible__set(self, value):
Undocumented
def do_focus(self, focus):
Undocumented
def do_released(self, x, y, z, button, time):
Undocumented
def do_scrolled(self, x, y, z, direction, time):
Undocumented
def do_drag_begin(self, x, y, z, button, time, pressure):
Undocumented
def do_drag_end(self, x, y, z, button, time):
Undocumented
def do_item_clicked(self, item):
Undocumented
def do_selected_item_changed(self, item, prev_item):
Undocumented
def _decelerate(self):
Undocumented
def _stop_deceleration(self):
Undocumented
@classmethod
def _demo_widget(cls, *args, **kwargs):
Meant to be overidden by inheriting widgets for widget creation and setup at demo time.
Returnselisa.plugins.pigment.widgets.Widget
def clean(self):
Undocumented
API Documentation for Elisa Media Center, generated by pydoctor at 2008-10-13 19:16:17.