| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module StatusBar :: Class 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)
| |
S.calculate_size () -> int, int. | |
S.dispose_widgets (...) -> None | |
S.draw () -> None | |
S.draw_bg () -> Surface | |
S.get_current_tip () -> string or unicode | |
S.notify (...) -> None | |
S.pop_tip () -> None | |
S.push_tip (...) -> None | |
S.set_date_format (...) -> None | |
S.set_date_width (...) -> None | |
S.set_focus (focus=True) -> None | |
S.set_tip_width (...) -> None | |
S.show_date (...) -> None | |
S.show_tips (...) -> None | |
| Inherited from Container | |
C.add_child (...) -> None | |
C.destroy () -> None | |
C.insert_child (...) -> None | |
C.remove_child (...) -> None | |
C.set_children (...) -> None | |
C.set_depth (...) -> None | |
C.set_event_manager (...) -> None | |
C.set_indexable (...) -> None | |
C.set_padding (...) -> None | |
C.set_sensitive (...) -> None | |
C.set_spacing (...) -> None | |
C.update (...) -> 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.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 | |
| 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 | |
|---|---|
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. |
dispose_widgets(self)S.dispose_widgets (...) -> None Moves the children of the StatusBar to their correct positions. |
draw(self)S.draw () -> None Draws the StatusBar surface and places its children on it.
|
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. |
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. |
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. |
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_dateThe current date to display.
|
current_tipThe current tooltip to display.
|
dateIndicates, whether the date should be shown.
|
date_formatSets the display format of the date.
|
date_widthThe width of the date area.
|
tip_widthThe width of the tip area.
|
tipsIndicates, whether the tooltips should be shown.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:44 2008 | http://epydoc.sf.net |