| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module Range :: Class Range |
|
object--+ |INotifyable--+ |BaseObject--+ |object--+ | | |Sprite--+ |BaseWidget--+ | Range
Range (minimum, maximum, step=1.0) -> Range
An abstract widget class for scale ranges and numerical adjustments.
The Range widget class is an abstract class suitable for widgets,
which need numerical adjustment support, scale ranges and similar
things. It supplies various attributes and methods to enable a
widget for numerical input and range limit checks.
A minimum range value (or lower limit) can be set using the
'minimum' attribute or set_minimum() method. It must not be greater
than the set maximum value of the Range and any integer or float
value are valid input for it.
range.minimum = 1.7
range.set_minimum (5)
In contrast of this, the 'maximum' attribute or set_maximum() method
set the upper limit (or maximum range value) of the Range. As well
as the 'minimum' attribute any integer or float are a valid value
and must not be smaller than the minimum value of the Range.
range.maximum = 123.45
range.set_maximum (100)
To in- or decrease the Range value easily (in loops for example),
the 'step' attribute or set_step() method can be used, which set the
step value for the increase() and decrease() method.
range.step = 0.5
range.set_step (10)
while x > 100:
range.increment ()
x -= 1
while y > 100:
range.decrement ()
y -= 1
The current set value of the Range widget can be set or retrieved
with the 'value' attribute or set_value() method.
range.value = 10.0
range.set_value (100)
Note: When you set the 'minimum' or 'maximum' attribute of the Range
widget, the 'value' attribute will be automatically reset to the
minimum or maximum value, if it is not within the range of the
widget.
Default action (invoked by activate()):
None
Mnemonic action (invoked by activate_mnemonic()):
None
Signals:
SIG_VALCHANGED - Invoked, when the value of the Range changed.
Attributes:
minimum - The minimum value of the Range.
maximum - The maximum value of the Range.
step - Step range to use for in- or decreasing the Range.
value - The current value of the Range.
| Method Summary | |
|---|---|
__init__(self,
minimum,
maximum,
step)
| |
R.decrease () -> None | |
R.increase () -> None | |
R.set_maximum (...) -> None | |
R.set_minimum (...) -> None | |
R.set_step (...) -> None | |
R.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.draw () -> None | |
W.draw_bg () -> Surface | |
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_focus (...) -> bool | |
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 | |
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 | |
|---|---|
maximum: The maximum value of the Range. | |
minimum: The minimum value of the Range. | |
step: The step range of the Range. | |
value: The current value of the Range. | |
| 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)R.decrease () -> None Decreases the current Range value by one step. |
increase(self)R.increase () -> None Increases the current Range value by one step. |
set_maximum(self, maximum)R.set_maximum (...) -> None Sets the maximum value of the Range. Raises a TypeError, if the passed argument is not a float or integer. Raises a ValueError, if the passed argument is smaller than the Range its minimum value. |
set_minimum(self, minimum)R.set_minimum (...) -> None Sets the minimum value of the Range. Raises a TypeError, if the passed argument is not a float or integer. Raises a ValueError, if the passed argument is greater than the Range its maximum value. |
set_step(self, step=1.0)R.set_step (...) -> None Sets the step range for in- or decreasing the Range value. Raises a TypeError, if the passed argument is not a float or integer. |
set_value(self, value)R.set_value (...) -> None Sets the current value of the Range. Sets the current value of the Range 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 range of the Range its maximum and minimum value. |
| Property Details |
|---|
maximumThe maximum value of the Range.
|
minimumThe minimum value of the Range.
|
stepThe step range of the Range.
|
valueThe current value of the Range.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:43 2008 | http://epydoc.sf.net |