The first argument is either the name of a file that will be split into frames (a composite image) or a list of strings of image names that will be treated as individual frames. If a single (composite) image is given, then additional information must be provided: the number of frames in the image and the width of each frame. The first frame is treated as the “at rest” frame (it is not shown during animation, but only when Throbber.Rest() is called. A second, single image may be optionally specified to overlay on top of the animation. A label may also be specified to show on top of the animation.
Default class constructor. |
|
Display previous image in sequence. |
|
Get the best size of the widget. |
|
Draw the widget. |
|
Display next image in sequence. |
|
Display next image in sequence according to direction. |
|
Handles the |
|
Handles the |
|
Handles the |
|
Display previous image in sequence according to direction. |
|
Stop the animation and return to frame 0. |
|
Change the direction of the animation. |
|
Returns |
|
Set current image. |
|
Set the font for the label. |
|
Delay between each frame. |
|
Change the text of the label. |
|
Set rest image. |
|
Order to display images in. |
|
Start the animation. |
|
Stop the animation. |
|
Toggle the label. |
|
Toggle the overlay image. |
|
Handles the |
|
Wrap the throbber around. |
Throbber
(wx.Panel)¶The first argument is either the name of a file that will be split into frames (a composite image) or a list of strings of image names that will be treated as individual frames. If a single (composite) image is given, then additional information must be provided: the number of frames in the image and the width of each frame. The first frame is treated as the “at rest” frame (it is not shown during animation, but only when Throbber.Rest() is called. A second, single image may be optionally specified to overlay on top of the animation. A label may also be specified to show on top of the animation.
__init__
(self, parent, id, bitmap, pos = wx.DefaultPosition, size = wx.DefaultSize, frameDelay = 0.1, frames = 0, frameWidth = 0, label = None, overlay = None, reverse = 0, style = 0, name = "throbber", rest = 0, current = 0, direction = 1, sequence = None)¶Default class constructor.
parent – parent window, must not be None
id (integer) – window identifier. A value of -1 indicates a default value
bitmap – a wx.Bitmap
to be used
pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform
size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform
frameDelay – time delay between frames
frames – number of frames (only necessary for composite image)
frameWidth – width of each frame (only necessary for composite image)
label (string) – optional text to be displayed
overlay – optional wx.Bitmap
to overlay on animation
reverse (boolean) – reverse direction at end of animation
style (integer) – the underlying wx.Control
style
name (string) – the widget name.
rest – the rest frame
current – the current frame
direction – 1 advances = -1 reverses
sequence – sequence of frames, defaults to range(self.frames)
Decrement
(self)¶Display previous image in sequence.
DoGetBestSize
(self)¶Get the best size of the widget.
the width and height
Increment
(self)¶Display next image in sequence.
Next
(self)¶Display next image in sequence according to direction.
OnDestroyWindow
(self, event)¶Handles the wx.EVT_WINDOW_DESTROY
event for Throbber
.
event – a wx.WindowDestroyEvent
event to be processed.
OnPaint
(self, event)¶Handles the wx.EVT_PAINT
event for Throbber
.
event – a PaintEvent
event to be processed.
OnTimer
(self, event)¶Handles the wx.EVT_TIMER
event for Throbber
.
event – a TimerEvent
event to be processed.
Previous
(self)¶Display previous image in sequence according to direction.
Rest
(self)¶Stop the animation and return to frame 0.
Reverse
(self)¶Change the direction of the animation.
Running
(self)¶Returns True
if the animation is running.
SetCurrent
(self, current)¶Set current image.
current (int) – the index to the current image
SetFrameDelay
(self, frameDelay = 0.05)¶Delay between each frame.
frameDelay (float) – the delay between frames.
SetLabel
(self, label)¶Change the text of the label.
label (string) – the label text.
SetRest
(self, rest)¶Set rest image.
rest (int) – the index for the rest frame.
SetSequence
(self, sequence = None)¶Order to display images in.
sequence – a sequence containing the order to display images in.
Start
(self)¶Start the animation.
Stop
(self)¶Stop the animation.
ToggleLabel
(self, state = None)¶Toggle the label.
state (boolean) – set the label state or if None toggle state.
ToggleOverlay
(self, state = None)¶Toggle the overlay image.
state (boolean) – set the overlay state or if None toggle state.
Update
(self, event)¶Handles the EVT_UPDATE_THROBBER
event for ResizeWidget
.
event – a UpdateThrobberEvent
event to be processed.
Wrap
(self)¶Wrap the throbber around.