| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module ScrolledList :: Class ScrolledList |
|
object--+ |INotifyable--+ |BaseObject--+ |object--+ | | |Sprite--+ |BaseWidget--+ |Bin--+ |ScrolledWindow--+ | ScrolledList
FileList
ScrolledList (width, height, collection=None) -> ScrolledList
A widget class, that populates elements in a list-style manner.
The ScrolledList displays data in a listed form and allows to browse
through it using horizontal and vertical scrolling. Single or
multiple items of the list can be selected or - dependant on the
ListItem object - be edited, etc.
The ScrolledList's child is a ListViewPort object, which takes care
of drawing the attached list items. You can supply your own
ListViewPort object through the 'child' attribute as described in
the Bin class documentation.
To set or reset an already created collection of items, the 'items'
attribute and set_items() method can be used. The collection to set
needs to be a ListItemCollection object.
myitems = ListItemCollection()
myitems.append (TextListItem ('First')
scrolledlist.items = myitems
scrolledlist.set_items (myitems)
The ScrolledList allows different types of selections by modifying
the 'selectionmode' attribute. Dependant on the set selection mode,
you can then select multiple items at once (SELECTION_MULTIPLE),
only one item at a time (SELECTION_SINGLE) or nothing at all
(SELECTION_NONE). Modifying the selection mode does not have any
effect on a currently made selection. See the selection constants
section in the Constants documentation for more details.
scrolledlist.selectionmode = SELECTION_NONE
scrolledlist.set_selectionmode (SELECTION_SINGLE)
To improve the appearance and selection behaviour of the single list
items, the ScrolledList support additional spacing to place between
them. It can be read and set through the 'spacing' attribute and
set_spacing() method.
scrolledlist.spacing = 4
scrolledlist.set_spacing (0)
Default action (invoked by activate()):
See the ScrolledWindow class.
Mnemonic action (invoked by activate_mnemonic()):
None
Signals:
SIG_SELECTCHANGED - Invoked, when the item selection changed.
SIG_LISTCHANGED - Invoked, when the underlying item list changed.
Attributes:
items - Item list of the ScrolledList.
selectionmode - The selection mode for the ScrolledList. Default is
SELECTION_MULTIPLE.
spacing - Spacing to place between the list items. Default is 0.
cursor - The currently focused item.
| Method Summary | |
|---|---|
__init__(self,
width,
height,
collection)
| |
S.deselect (...) -> None | |
S.get_selected () -> list | |
S.notify (...) -> None | |
S.select (...) -> None | |
S.select_all () -> None | |
S.set_cursor (...) -> None | |
S.set_focus (...) -> bool | |
S.set_items (...) -> None | |
S.set_selectionmode (...) -> None | |
S.set_spacing (...) -> None | |
S.__deselect (..:) -> None | |
S.__select (...) -> None | |
S._click (...) -> None | |
S._cursor_next () -> None | |
S._cursor_prev () -> None | |
S._item_has_changed (...) -> None | |
S._list_has_changed (...) -> None | |
S._navigate (key) -> None | |
S._scroll_to_cursor () -> None | |
| Inherited from ScrolledWindow | |
S.activate () -> None | |
W.draw () -> None | |
S.draw_bg () -> Surface | |
B.set_child (...) -> None | |
S.set_scrolling (...) -> None | |
S._scroll_child () -> None | |
S._update_scrollbars (...) -> bool, bool | |
| Inherited from Bin | |
B.destroy () -> None | |
B.set_depth (...) -> None | |
B.set_event_manager (...) -> None | |
B.set_indexable (...) -> None | |
B.set_padding (...) -> None | |
B.set_sensitive (...) -> None | |
B.update (...) -> None | |
| Inherited from BaseWidget | |
W.activate_mnemonic (...) -> bool | |
W.check_sizes (...) -> int, int | |
W.create_style () -> WidgetStyle | |
For debugging usage only | |
W.get_style () -> WidgetStyle | |
B.initclass () -> None (Class method) | |
W.lock () -> None | |
W.rect_to_client (...) -> pygame.Rect | |
W.set_dirty (...) -> None | |
W.set_entered (...) -> None | |
W.set_event_area (...) -> None | |
W.set_index (...) -> None | |
W.set_maximum_size (...) -> None | |
W.set_minimum_size (...) -> None | |
W.set_opacity (...) -> None | |
W.set_position (...) -> None | |
W.set_size (...) -> None | |
W.set_state (...) -> None | |
W.set_style (...) -> None | |
W.set_tooltip (...) -> None | |
W.unlock () -> None | |
W._get_rect () -> pygame.Rect | |
W._get_rect_attr (...) -> var | |
W._set_rect_attr (...) -> None | |
| Inherited from BaseObject | |
B.connect_signal (...) -> EventCallback | |
B.disconnect_signal (...) -> None | |
B.emit (...) -> bool | |
B.run_signal_handlers (...) -> None | |
| Inherited from Sprite | |
| |
add(group or list of of groups, ...) add a sprite to container | |
| |
alive() -> bool check to see if the sprite is in any groups | |
groups() -> list of groups list used sprite containers | |
kill() remove this sprite from all groups | |
remove(group or list of groups, ...) remove a sprite from container | |
| |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Property Summary | |
|---|---|
cursor: The item, which is currently focused. | |
items: The item collection of the ScrolledList. | |
selectionmode: The selection mode for the ScrolledList. | |
spacing: Additional spacing to place between the items. | |
| Inherited from ScrolledWindow | |
hscrollbar: The herizontal scrollbar. | |
scrolling: The scrolling behaviour for the ScrolledWindow. | |
vscrollbar: The vertical scrollbar. | |
| Inherited from Bin | |
child: The widget hold by the Bin. | |
padding: Additional padding between child and borders. | |
| Inherited from BaseWidget | |
bottom | |
bottomleft | |
bottomright | |
center | |
centerx | |
centery | |
controls: Widgets associated with the widget. | |
depth: The z-axis layer depth of the widget. | |
dirty: Indicates, whether the widget need to be redrawn. | |
entered: Indicates, whether the widget is entered. | |
eventarea: The area, which gets the events. | |
focus: The focus of the widget. | |
h | |
height | |
image: The visible surface of the widget. | |
index: The tab index position of the widget. | |
indexable: The IIndexable, the widget is attached to. | |
left | |
locked: Indicates, whether the widget is locked. | |
maxsize: The maximum size to occupy by the widget. | |
midbottom | |
midleft | |
midright | |
midtop | |
minsize: The guaranteed size of the widget. | |
opacity: The opacity of the widget. | |
position: The position of the topleft corner. | |
rect: The area occupied by the widget. | |
right | |
sensitive: The sensitivity of the widget. | |
size | |
state: The current state of the widget. | |
style: The style of the widget. | |
tooltip: The tool tip text to display for the widget. | |
top | |
topleft | |
topright | |
w | |
width | |
x | |
y | |
| Inherited from BaseObject | |
manager: The event manager to use by the object. | |
| Instance Method Details |
|---|
deselect(self, *items)S.deselect (...) -> None Deselects the specified items in the ScrolledList. The method causes the SIG_SELECTCHANGED event to be emitted, when the selection changes. Raises a LookupError, if the passed argument could not be found in the items attribute. |
get_selected(self)S.get_selected () -> list Returns a list cotaining the selected items. |
notify(self, event)S.notify (...) -> None Notifies the ScrolledList about an event. |
select(self, *items)S.select (...) -> None Selects one or more specific items of the ScrolledList. Dependant on the set selection mode selecting an item has specific side effects. If the selection mode is set to SELECTION_SINGLE, selecting an item causes any other item to become deselected. As a counterpart SELECTION_MULTIPLE causes the items to get selected while leaving any other item untouched. The method causes the SIG_SELECTCHANGED event to be emitted, whenever the selection changes. Raises a LookupError, if the passed argument could not be found in the items attribute. |
select_all(self)S.select_all () -> None Selects all items of the ScrolledList. Selects all items of the ScrolledList, if the selection mode is set to SELECTION_MULTIPLE |
set_cursor(self, item, selected)S.set_cursor (...) -> None Sets the cursor index to the desired item. |
set_focus(self, focus=True)S.set_focus (...) -> bool Sets the input and action focus of the ScrolledList. Sets the input and action focus of the ScrolledList and returns True upon success or False, if the focus could not be set. |
set_items(self, items)S.set_items (...) -> None Sets a collection of items to display. |
set_selectionmode(self, mode)S.set_selectionmode (...) -> None Sets the selection mode for the ScrolledList. The selection mode can be one of the SELECTION_TYPES list. SELECTION_NONE disables selecting any list item, SELECTION_SINGLE allows to select only one item from the list and SELECTION_MULTIPLE allows to select multiple items from the list. Raises a ValueError, if the passed argument is not a value of the SELECTION_TYPES tuple. |
set_spacing(self, spacing)S.set_spacing (...) -> None Sets the spacing to place between the list items of the ScrolledList. The spacing value is the amount of pixels to place between the items of the ScrolledList. Raises a TypeError, if the passed argument is not a positive integer. |
__deselect(self, *items)S.__deselect (..:) -> None Deselects the specified items in the ScrolledList |
__select(self, *items)S.__select (...) -> None Selects one or more specific items of the ScrolledList. |
_click(self, position)S._click (...) -> None Deals with mouse clicks. |
_cursor_next(self, selected)S._cursor_next () -> None Advances the cursor to the next item in the list. |
_cursor_prev(self, selected)S._cursor_prev () -> None Advances the cursor to the previous item in the list. |
_item_has_changed(self, item)S._item_has_changed (...) -> None Update method for item_changed() notifications. |
_list_has_changed(self, collection)S._list_has_changed (...) -> None Update method for list_changed () notifications. |
_navigate(self, key, mod)S._navigate (key) -> None Deals with keyboard navigation. |
_scroll_to_cursor(self)S._scroll_to_cursor () -> None Scrolls the list to the cursor. |
| Property Details |
|---|
cursorThe item, which is currently focused.
|
itemsThe item collection of the ScrolledList.
|
selectionmodeThe selection mode for the ScrolledList.
|
spacingAdditional spacing to place between the items.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:43 2008 | http://epydoc.sf.net |