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

Type StatusBar

 object --+                
          |                
INotifyable --+            
              |            
     BaseObject --+        
                  |        
     object --+   |        
              |   |        
         Sprite --+        
                  |        
         BaseWidget --+    
                      |    
              Container --+
                          |
                         StatusBar


StatusBar () -> StatusBar

A widget class, which can display information using a stack.

The StatusBar widget class can display the current date and info messages using a message stack.

Info messages can be enabled or disabled using the 'tips' attribute or show_tips() method. If the tips are enabled, only the topmost (at last added) tip will be displayed.

statusbar.tips = True statusbar.show_tips (False)

The push_tip() method will put the message on the top of the stack, while the pop_tip() method will remove the topmost message. If there are several messages on the stack, pop_tip() will reveal previously added messages, which will be displayed then.

statusbar.push_tip ('This is a message') # 'This is a message' is shown statusbar.push_tip ('Another message') # 'Another message' is shown statusbar.pop_tip () # 'This is a message' is shown

To get the currently displayed message, the 'current_tip' attribute or get_current_tip() method can be used.

current = statusbar.current_tip current = statusbar.get_current_tip ()

The width of the area, that displays the tips can be adjusted using the 'tip_width' attribute or set_tip_width () method. If the rendered text exceeds the width of the area, it will be cut down to its width.

statusbar.tip_width = 50 statusbar.set_tip_width (50)

Displaying the actual date can be enabled or disabled with the 'date' attribute or show_date() method.

statusbar.date = True statusbar.show_date (False)

The display format of it can be adjusted through the 'date_format' attribute or set_date_format() method. The format has to be a string in a format, which can be understood by the strftime() method.

statusbar.date_format = '%x' statusbar.set_date_format ('%H: %M')

The current date (which can differ from the displayed one) can be fetched through the 'current_date' attribute. Usually the update resolution for the date is set to one second. Due to the internal drawing and update code it can happen that the the displayed and current date differ by one second.

The width of the area, that displays the date can be adjusted using the 'date_width' attribute or set_date_width () method. If the rendered date exceeds the width of the area, it will be cut down to its width.

statusbar.date_width = 50 statusbar.set_date_width (50)

Additionally you are able to place widgets on the StatusBar through the usual Container methods. The widgets will be placed between the info message text and the date.

Note: The StatusBar updates itself every 500 ms. Thus you will not have a real time clock in the date display, which updates itself correctly every second.

Default action (invoked by activate()): None

Mnemonic action (invoked by activate_mnemonic()): None

Attributes: tips - Indicates, whether the info messages should be shown. current_tip - The current tooltip to display. tip_width - The width of the tip area. Default is 80. date - Indicates, whether the date should be shown. current_date - The current date to display. date_format - The display format of the date. Default is '%x %H:%M' date_width - The width of the date area. Default is 90.
Method Summary
  __init__(self)
  calculate_size(self)
S.calculate_size () -> int, int.
  dispose_widgets(self)
S.dispose_widgets (...) -> None
  draw(self)
S.draw () -> None
  draw_bg(self)
S.draw_bg () -> Surface
  get_current_tip(self)
S.get_current_tip () -> string or unicode
  notify(self, event)
S.notify (...) -> None
  pop_tip(self)
S.pop_tip () -> None
  push_tip(self, tip)
S.push_tip (...) -> None
  set_date_format(self, format)
S.set_date_format (...) -> None
  set_date_width(self, width)
S.set_date_width (...) -> None
  set_focus(self, focus)
S.set_focus (focus=True) -> None
  set_tip_width(self, width)
S.set_tip_width (...) -> None
  show_date(self, show)
S.show_date (...) -> None
  show_tips(self, show)
S.show_tips (...) -> None
    Inherited from Container
  add_child(self, *children)
C.add_child (...) -> None
  destroy(self)
C.destroy () -> None
  insert_child(self, pos, *children)
C.insert_child (...) -> None
  remove_child(self, child)
C.remove_child (...) -> None
  set_children(self, children)
C.set_children (...) -> None
  set_depth(self, depth)
C.set_depth (...) -> None
  set_event_manager(self, manager)
C.set_event_manager (...) -> None
  set_indexable(self, indexable)
C.set_indexable (...) -> None
  set_padding(self, padding)
C.set_padding (...) -> None
  set_sensitive(self, sensitive)
C.set_sensitive (...) -> None
  set_spacing(self, spacing)
C.set_spacing (...) -> None
  update(self, **kwargs)
C.update (...) -> None
  _add(self, **kwargs)
C._add (...) -> 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
  get_style(self)
W.get_style () -> WidgetStyle
  initclass(cls)
B.initclass () -> None (Class method)
  lock(self)
W.lock () -> None
  rect_to_client(self, rect)
W.rect_to_client (...) -> pygame.Rect
  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_index(self, index)
W.set_index (...) -> 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_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
  _get_rect(self)
W._get_rect () -> pygame.Rect
  _get_rect_attr(self, attr)
W._get_rect_attr (...) -> var
  _set_rect_attr(self, attr, value)
W._set_rect_attr (...) -> 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
  current_date: The current date to display.
  current_tip: The current tooltip to display.
  date: Indicates, whether the date should be shown.
  date_format: Sets the display format of the date.
  date_width: The width of the date area.
  tip_width: The width of the tip area.
  tips: Indicates, whether the tooltips should be shown.
    Inherited from Container
  children: List of the children for the Container.
  padding: The additional padding for the Container.
  spacing: The spacing between the children.
    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

calculate_size(self)

S.calculate_size () -> int, int.

Calculates the size needed by the children.

Calculates the size needed by the children and returns the resulting width and height.
Overrides:
ocempgui.widgets.Container.Container.calculate_size

dispose_widgets(self)

S.dispose_widgets (...) -> None

Moves the children of the StatusBar to their correct positions.
Overrides:
ocempgui.widgets.Container.Container.dispose_widgets

draw(self)

S.draw () -> None

Draws the StatusBar surface and places its children on it.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.draw

draw_bg(self)

S.draw_bg () -> Surface

Draws the background surface of the StatusBar and returns it.

Creates the visible surface of the StatusBar and returns it to the caller.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.draw_bg

get_current_tip(self)

S.get_current_tip () -> string or unicode

Gets the current info message to display.

notify(self, event)

S.notify (...) -> None

Notifies the StatusBar about an event.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.notify

pop_tip(self)

S.pop_tip () -> None

Removes the last info message from the StatusBar queue.

push_tip(self, tip)

S.push_tip (...) -> None

Puts a info message on the queue of the StatusBar.

Raises a TypeError, if the passed argument is not a string or unicode.

set_date_format(self, format)

S.set_date_format (...) -> None

Sets the display format for the date.

The passed format string has to be in a format, which can be understood by the strftime() method.

set_date_width(self, width)

S.set_date_width (...) -> None

Sets the width of the date area.

Raises a TypeError, if the passed argument is not a positive integer.

set_focus(self, focus=True)

S.set_focus (focus=True) -> None

Overrides the set_focus() behaviour for the StatusBar.

The StatusBar class is not focusable by default.
Overrides:
ocempgui.widgets.BaseWidget.BaseWidget.set_focus

set_tip_width(self, width)

S.set_tip_width (...) -> None

Sets the width of the tip area.

Raises a TypeError, if the passed argument is not a positive integer.

show_date(self, show)

S.show_date (...) -> None

Shows or hides the date display of the StatusBar.

show_tips(self, show)

S.show_tips (...) -> None

Shows or hides the info message display of the StatusBar.

Property Details

current_date

The current date to display.
Get Method:
unknown-696695132(...)

current_tip

The current tooltip to display.
Get Method:
unknown-696695076(...)

date

Indicates, whether the date should be shown.
Get Method:
unknown-696694852(...)
Set Method:
unknown-696694908(...)

date_format

Sets the display format of the date.
Get Method:
unknown-696695188(...)
Set Method:
unknown-696695244(...)

date_width

The width of the date area.
Get Method:
unknown-696694964(...)
Set Method:
unknown-696695020(...)

tip_width

The width of the tip area.
Get Method:
unknown-696694740(...)
Set Method:
unknown-696694796(...)

tips

Indicates, whether the tooltips should be shown.
Get Method:
unknown-696694628(...)
Set Method:
unknown-696694684(...)

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