Package ocempgui :: Package widgets :: Module ProgressBar :: Class ProgressBar
[show private | hide private]
[frames | no frames]

Type 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)
  decrease(self)
P.decrease () -> None
  draw(self)
P.draw () -> None
  draw_bg(self)
P.draw_bg () -> Surface
  increase(self)
P.increase () -> None
  set_focus(self, focus)
P.set_focus (focus=True) -> None
  set_step(self, step)
P.set_step (...) -> None
  set_text(self, text)
P.set_text (...) -> None
  set_value(self, value)
P.set_value (...) -> None
    Inherited from BaseWidget
  activate(self)
W.activate () -> None
  activate_mnemonic(self, mnemonic)
W.activate_mnemonic (...) -> bool
  check_sizes(self, width, height)
W.check_sizes (...) -> int, int
  create_style(self)
W.create_style () -> WidgetStyle
  debug_update(self)
For debugging usage only
  destroy(self)
W.destroy () -> None
  get_style(self)
W.get_style () -> WidgetStyle
  initclass(cls)
B.initclass () -> None (Class method)
  lock(self)
W.lock () -> None
  notify(self, event)
W.notify (...) -> None
  rect_to_client(self, rect)
W.rect_to_client (...) -> pygame.Rect
  set_depth(self, depth)
W.set_depth (...) -> None
  set_dirty(self, dirty, update)
W.set_dirty (...) -> None
  set_entered(self, entered)
W.set_entered (...) -> None
  set_event_area(self, area)
W.set_event_area (...) -> None
  set_event_manager(self, manager)
W.set_event_manager (...) -> None
  set_index(self, index)
W.set_index (...) -> None
  set_indexable(self, indexable)
W.set_indexable (...) -> None
  set_maximum_size(self, width, height)
W.set_maximum_size (...) -> None
  set_minimum_size(self, width, height)
W.set_minimum_size (...) -> None
  set_opacity(self, opacity)
W.set_opacity (...) -> None
  set_position(self, x, y)
W.set_position (...) -> None
  set_sensitive(self, sensitive)
W.set_sensitive (...) -> None
  set_size(self, width, height)
W.set_size (...) -> None
  set_state(self, state)
W.set_state (...) -> None
  set_style(self, style)
W.set_style (...) -> None
  set_tooltip(self, tooltip)
W.set_tooltip (...) -> None
  unlock(self)
W.unlock () -> None
  update(self, **kwargs)
W.update (...) -> None
    Inherited from BaseObject
  connect_signal(self, signal, callback, *data)
B.connect_signal (...) -> EventCallback
  disconnect_signal(self, event)
B.disconnect_signal (...) -> None
  emit(self, signal, data)
B.emit (...) -> bool
  run_signal_handlers(self, signal, *data)
B.run_signal_handlers (...) -> None
    Inherited from Sprite
  __repr__(self)
  add(self, *groups)
add(group or list of of groups, ...) add a sprite to container
  add_internal(self, group)
  alive(self)
alive() -> bool check to see if the sprite is in any groups
  groups(self)
groups() -> list of groups list used sprite containers
  kill(self)
kill() remove this sprite from all groups
  remove(self, *groups)
remove(group or list of groups, ...) remove a sprite from container
  remove_internal(self, group)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
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.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.draw

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.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.draw_bg

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.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.set_focus

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

step

The step range of the ProgressBar.
Get Method:
unknown-696388156(...)
Set Method:
unknown-696388212(...)

text

The text to display on the ProgressBar.
Get Method:
unknown-696388268(...)
Set Method:
unknown-696388324(...)

value

The current value.
Get Method:
unknown-696388044(...)
Set Method:
unknown-696388100(...)

Generated by Epydoc 2.1 on Thu Jan 10 10:18:44 2008 http://epydoc.sf.net