File: wx.lib.throbber.Throbber.txt

package info (click to toggle)
wxpython4.0 4.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 211,112 kB
  • sloc: cpp: 888,355; python: 223,130; makefile: 52,087; ansic: 45,780; sh: 3,012; xml: 1,534; perl: 264
file content (287 lines) | stat: -rw-r--r-- 11,462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. currentmodule:: wx.lib.throbber

.. highlight:: python



.. _wx.lib.throbber.Throbber:

==========================================================================================================================================
|phoenix_title|  **wx.lib.throbber.Throbber**
==========================================================================================================================================

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.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>Throbber</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.lib.throbber.Throbber_inheritance.png" alt="Inheritance diagram of Throbber" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Panel.html" title="wx.Panel" alt="" coords="75,315,151,344"/> <area shape="rect" id="node7" href="wx.lib.throbber.Throbber.html" title="wx.lib.throbber.Throbber" alt="" coords="26,392,200,421"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="69,237,157,267"/> <area shape="rect" id="node3" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="5,5,107,35"/> <area shape="rect" id="node4" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="57,83,168,112"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="53,160,173,189"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="131,5,212,35"/> </map> 
   </p>

|


|super_classes| Known Superclasses
==================================

:class:`wx.Panel`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.throbber.Throbber.__init__`                                       Default class constructor.
:meth:`~wx.lib.throbber.Throbber.Decrement`                                      Display previous image in sequence.
:meth:`~wx.lib.throbber.Throbber.DoGetBestSize`                                  Get the best size of the widget.
:meth:`~wx.lib.throbber.Throbber.Draw`                                           Draw the widget.
:meth:`~wx.lib.throbber.Throbber.Increment`                                      Display next image in sequence.
:meth:`~wx.lib.throbber.Throbber.Next`                                           Display next image in sequence according to direction.
:meth:`~wx.lib.throbber.Throbber.OnDestroyWindow`                                Handles the ``wx.EVT_WINDOW_DESTROY`` event for :class:`Throbber`.
:meth:`~wx.lib.throbber.Throbber.OnPaint`                                        Handles the ``wx.EVT_PAINT`` event for :class:`Throbber`.
:meth:`~wx.lib.throbber.Throbber.OnTimer`                                        Handles the ``wx.EVT_TIMER`` event for :class:`Throbber`.
:meth:`~wx.lib.throbber.Throbber.Previous`                                       Display previous image in sequence according to direction.
:meth:`~wx.lib.throbber.Throbber.Rest`                                           Stop the animation and return to frame 0.
:meth:`~wx.lib.throbber.Throbber.Reverse`                                        Change the direction of the animation.
:meth:`~wx.lib.throbber.Throbber.Running`                                        Returns ``True`` if the animation is running.
:meth:`~wx.lib.throbber.Throbber.SetCurrent`                                     Set current image.
:meth:`~wx.lib.throbber.Throbber.SetFont`                                        Set the font for the label.
:meth:`~wx.lib.throbber.Throbber.SetFrameDelay`                                  Delay between each frame.
:meth:`~wx.lib.throbber.Throbber.SetLabel`                                       Change the text of the label.
:meth:`~wx.lib.throbber.Throbber.SetRest`                                        Set rest image.
:meth:`~wx.lib.throbber.Throbber.SetSequence`                                    Order to display images in.
:meth:`~wx.lib.throbber.Throbber.Start`                                          Start the animation.
:meth:`~wx.lib.throbber.Throbber.Stop`                                           Stop the animation.
:meth:`~wx.lib.throbber.Throbber.ToggleLabel`                                    Toggle the label.
:meth:`~wx.lib.throbber.Throbber.ToggleOverlay`                                  Toggle the overlay image.
:meth:`~wx.lib.throbber.Throbber.Update`                                         Handles the ``EVT_UPDATE_THROBBER`` event for :class:`ResizeWidget`.
:meth:`~wx.lib.throbber.Throbber.Wrap`                                           Wrap the throbber around.
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: 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.

   .. method:: __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.
      
      :param `parent`: parent window, must not be ``None``
      :param integer `id`: window identifier. A value of -1 indicates a default value
      :param `bitmap`: a :class:`wx.Bitmap` to be used
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform
      :param `frameDelay`: time delay between frames
      :param `frames`: number of frames (only necessary for composite image)
      :param `frameWidth`: width of each frame (only necessary for composite image)
      :param string `label`: optional text to be displayed
      :param `overlay`: optional :class:`wx.Bitmap` to overlay on animation
      :param boolean `reverse`: reverse direction at end of animation
      :param integer `style`: the underlying :class:`wx.Control` style
      :param string `name`: the widget name.
      :param `rest`: the rest frame
      :param `current`: the current frame
      :param `direction`: 1 advances = -1 reverses
      :param `sequence`: sequence of frames, defaults to range(self.frames)


   .. method:: Decrement(self)

      Display previous image in sequence.


   .. method:: DoGetBestSize(self)

      Get the best size of the widget.
      
      :returns: the width and height


   .. method:: Draw(self, dc)

      Draw the widget.
      
      :param `dc`: the :class:`wx.DC` to draw on


   .. method:: Increment(self)

      Display next image in sequence.


   .. method:: Next(self)

      Display next image in sequence according to direction.


   .. method:: OnDestroyWindow(self, event)

      Handles the ``wx.EVT_WINDOW_DESTROY`` event for :class:`Throbber`.
      
      :param `event`: a :class:`wx.WindowDestroyEvent` event to be processed.


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`Throbber`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.


   .. method:: OnTimer(self, event)

      Handles the ``wx.EVT_TIMER`` event for :class:`Throbber`.
      
      :param `event`: a :class:`TimerEvent` event to be processed.


   .. method:: Previous(self)

      Display previous image in sequence according to direction.


   .. method:: Rest(self)

      Stop the animation and return to frame 0.


   .. method:: Reverse(self)

      Change the direction of the animation.


   .. method:: Running(self)

      Returns ``True`` if the animation is running.


   .. method:: SetCurrent(self, current)

      Set current image.
      
      :param int `current`: the index to the current image


   .. method:: SetFont(self, font)

      Set the font for the label.
      
      :param `font`: the :class:`wx.Font` to use


   .. method:: SetFrameDelay(self, frameDelay = 0.05)

      Delay between each frame.
      
      :param float `frameDelay`: the delay between frames.


   .. method:: SetLabel(self, label)

      Change the text of the label.
      
      :param string `label`: the label text.


   .. method:: SetRest(self, rest)

      Set rest image.
      
      :param int `rest`: the index for the rest frame.


   .. method:: SetSequence(self, sequence = None)

      Order to display images in.
      
      :param `sequence`: a sequence containing the order to display images in.


   .. method:: Start(self)

      Start the animation.


   .. method:: Stop(self)

      Stop the animation.


   .. method:: ToggleLabel(self, state = None)

      Toggle the label.
      
      :param boolean `state`: set the label state or if None toggle state.


   .. method:: ToggleOverlay(self, state = None)

      Toggle the overlay image.
      
      :param boolean `state`: set the overlay state or if None toggle state.


   .. method:: Update(self, event)

      Handles the ``EVT_UPDATE_THROBBER`` event for :class:`ResizeWidget`.
      
      :param `event`: a :class:`UpdateThrobberEvent` event to be processed.


   .. method:: Wrap(self)

      Wrap the throbber around.