| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module ProgressBar :: Class ProgressBar |
|
object--+ |INotifyable--+ |BaseObject--+ |object--+ | | |Sprite--+ |BaseWidget--+ | ProgressBar
ProgressBar () -> ProgressBar
A widget class, which can display a progress state.
The Progressbar widget is a graphical state indicator, which can interactively show the effort of an operation by a filling bar. Its value ranges from 0 to 100 (percent) and can increase or decrease. To allow high interactivity, each value changing method of the ProgressBar will raise a SIG_VALCHANGED event.
The increment of the ProgressBar can be set with the 'step' attribute or set_step() method. To allow a high resolution for long running tasks and operations, which should be visualized using the ProgressBar, the increment accepts floating point values.
progressbar.step = 0.1 progressbar.set_step (10)
The 'value' attribte and set_value() method allow setting the ProgressBar value directly without calling the respective increment or decerement methods.
progressbar.value = 50.0 progressbar.set_value (3)
The ProgressBar value can be in- or decreased using the increase() and decrease() methods. Those will in- or decrease the current value by the value of the 'step' attribute until either 100 or 0 is reached.
progressbar.increase() progressbar.decrease()
Dependant on the width of the ProgressBar the filled range per in- or decreasement can differ. The complete width is always used as the maximum value of 100, thus longer progressBar widgets allow better visible changes, if a finer grained increment is given. The ProgressBar uses a default size for itself by setting the 'size' attribute to a width of 104 pixels and a height of 24 pixels.
Default action (invoked by activate()): None
Mnemonic action (invoked by activate_mnemonic()): None
Signals: SIG_VALCHANGED - Invoked, when the value of the ProgressBar changed.
Attributes: step - Step range. value - Current value. text - The text to display on the ProgressBar.| Method Summary | |
|---|---|
__init__(self)
| |
P.decrease () -> None | |
P.draw () -> None | |
P.draw_bg () -> Surface | |
P.increase () -> None | |
P.set_focus (focus=True) -> None | |
P.set_step (...) -> None | |
P.set_text (...) -> None | |
P.set_value (...) -> None | |
| Inherited from BaseWidget | |
W.activate () -> None | |
W.activate_mnemonic (...) -> bool | |
W.check_sizes (...) -> int, int | |
W.create_style () -> WidgetStyle | |
For debugging usage only | |
W.destroy () -> None | |
W.get_style () -> WidgetStyle | |
B.initclass () -> None (Class method) | |
W.lock () -> None | |
W.notify (...) -> None | |
W.rect_to_client (...) -> pygame.Rect | |
W.set_depth (...) -> None | |
W.set_dirty (...) -> None | |
W.set_entered (...) -> None | |
W.set_event_area (...) -> None | |
W.set_event_manager (...) -> None | |
W.set_index (...) -> None | |
W.set_indexable (...) -> None | |
W.set_maximum_size (...) -> None | |
W.set_minimum_size (...) -> None | |
W.set_opacity (...) -> None | |
W.set_position (...) -> None | |
W.set_sensitive (...) -> None | |
W.set_size (...) -> None | |
W.set_state (...) -> None | |
W.set_style (...) -> None | |
W.set_tooltip (...) -> None | |
W.unlock () -> None | |
W.update (...) -> 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 | |
|---|---|
step: The step range of the ProgressBar. | |
text: The text to display on the ProgressBar. | |
value: The current value. | |
| 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 |
|---|
decrease(self)P.decrease () -> None Decreases the current value by one step. |
draw(self)P.draw () -> None Draws the ProgressBar surface and places its text on it.
|
draw_bg(self)P.draw_bg () -> Surface Draws the ProgressBar background surface and returns it. Creates the visible surface of the ProgressBar and returns it to the caller. |
increase(self)P.increase () -> None Increases the current value by one step. |
set_focus(self, focus=True)P.set_focus (focus=True) -> None Overrides the set_focus() behaviour for the ProgressBar. The ProgressBar class is not focusable by default. It is an information displaying class only, so it does not need to get the input focus and thus it will return false without doing anything. |
set_step(self, step=0.10000000000000001)P.set_step (...) -> None Sets the step range for in- or decreasing the ProgressBar value. The step range is the value used by the increase and decrease methods of the ProgressBar. Raises a TypeError, if the passed argument is not a float or integer. |
set_text(self, text)P.set_text (...) -> None Sets the text to display on the ProgressBar. Sets the text text to display on the ProgressBar. The text will be centered on it. Raises a TypeError, if the passed argument is not a string or unicode. |
set_value(self, value)P.set_value (...) -> None Sets the current value of the ProgressBar. Sets the current value of the ProgressBar and raises a SIG_VALCHANGED event, if the new value differs from the old one. Raises a TypeError, if the passed argument is not a float or integer. Raises a ValueError, if the passed argument, is not within the allowed range of 0.0 to 100.0. |
| Property Details |
|---|
stepThe step range of the ProgressBar.
|
textThe text to display on the ProgressBar.
|
valueThe current value.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:44 2008 | http://epydoc.sf.net |