File: wx.lib.agw.toasterbox.ToasterBoxWindow.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 (365 lines) | stat: -rw-r--r-- 17,082 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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
.. 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.agw.toasterbox

.. highlight:: python



.. _wx.lib.agw.toasterbox.ToasterBoxWindow:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.toasterbox.ToasterBoxWindow**
==========================================================================================================================================

This class does all the job, by handling background images, text properties
and panel adding. Depending on the style you choose, :class:`ToasterBoxWindow` will
behave differently in order to handle widgets inside it.



|

|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>ToasterBoxWindow</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.agw.toasterbox.ToasterBoxWindow_inheritance.png" alt="Inheritance diagram of ToasterBoxWindow" 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.Trackable.html" title="wx.Trackable" alt="" coords="36,5,137,35"/> <area shape="rect" id="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="88,83,199,112"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="83,160,204,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="161,5,243,35"/> <area shape="rect" id="node4" href="wx.lib.agw.toasterbox.ToasterBoxWindow.html" title="wx.lib.agw.toasterbox.ToasterBoxWindow" alt="" coords="5,547,283,576"/> <area shape="rect" id="node5" href="wx.Frame.html" title="wx.Frame" alt="" coords="103,469,184,499"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="99,237,188,267"/> <area shape="rect" id="node9" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="65,315,223,344"/> <area shape="rect" id="node8" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="73,392,215,421"/> </map> 
   </p>

|


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

:class:`wx.Frame`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.__init__`                         Default class constructor.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.AddPanel`                         Adds a panel to the :class:`ToasterBox`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.AlphaCycle`                       Handles the ``wx.EVT_TIMER`` event for :class:`ToasterBoxWindow`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.DrawText`                         Draws the text label for a :class:`ToasterBox` with ``TB_SIMPLE`` style set.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.GetPopupText`                     Returns the :class:`ToasterBox` text.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.MakeWindowTransparent`            Makes the :class:`ToasterBoxWindow` window transparent.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.NotifyTimer`                      Hides gradually the :class:`ToasterBoxWindow`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.OnClose`                          Handles the ``wx.EVT_CLOSE`` event for :class:`ToasterBoxWindow`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.OnMouseDown`                      Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`ToasterBoxWindow`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.OnPaint`                          Handles the ``wx.EVT_PAINT`` event for :class:`ToasterBoxWindow`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.OnScrollTimer`                    Handles the ``wx.EVT_TIMER`` event for :class:`ToasterBoxWindow` scrolling up/down.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.Play`                             Creates the :class:`ToasterBoxWindow`, that does all the job.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.ScrollDown`                       Scrolls the :class:`ToasterBox` down, which means gradually hiding it.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.ScrollUp`                         Scrolls the :class:`ToasterBox` up, which means gradually showing it.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupBackgroundColour`         Sets the :class:`ToasterBox` background colour.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupBitmap`                   Sets the :class:`ToasterBox` background image.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupPauseTime`                Sets the time after which the :class:`ToasterBox` is destroyed (linger).
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupPosition`                 Sets the :class:`ToasterBox` position on screen.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupPositionByInt`            Sets the :class:`ToasterBox` position on screen, at one of the screen corners.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupScrollSpeed`              Sets the :class:`ToasterBox` scroll speed.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupSize`                     Sets the :class:`ToasterBox` size.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupText`                     Sets the :class:`ToasterBox` text label.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupTextColour`               Sets the :class:`ToasterBox` foreground colour.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetPopupTextFont`                 Sets the :class:`ToasterBox` text font.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetupPositions`                   Sets up the position, size and scrolling step for :class:`ToasterBoxWindow`.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.SetUseFocus`                      If `focus` is ``True``, Instructs :class:`ToasterBoxWindow` to steal the focus from the
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.TearDown`                         Scrolls the :class:`ToasterBox` down, which means gradually hiding it.
:meth:`~wx.lib.agw.toasterbox.ToasterBoxWindow.TearUp`                           Scrolls the :class:`ToasterBox` up, which means gradually showing it.
================================================================================ ================================================================================


|


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


.. class:: ToasterBoxWindow(wx.Frame)

   This class does all the job, by handling background images, text properties
   and panel adding. Depending on the style you choose, :class:`ToasterBoxWindow` will
   behave differently in order to handle widgets inside it.

   .. method:: __init__(self, parent, parent2, tbstyle, windowstyle, closingstyle, scrollType=TB_SCR_TYPE_DU)

      Default class constructor.
      Used internally. Do not call directly this class in your application!
      
      :param `parent`: the window parent;
      :param `parent2`: the :class:`ToasterBox` calling this window;
      :param `tbstyle`: the :class:`ToasterBoxWindow` main style. Can be one of the following
       bits:
      
       ====================== ======= ================================
       `ToasterBox` Style      Value  Description
       ====================== ======= ================================
       ``TB_SIMPLE``              0x1 A simple :class:`ToasterBox`, with background image and text customization can be created
       ``TB_COMPLEX``             0x2 `ToasterBoxes` with different degree of complexity can be created. You can add as many controls as you want, provided that you call the :meth:`~ToasterBoxWindow.AddPanel` method and pass to it a dummy frame and a :class:`Panel`.
       ====================== ======= ================================
      
      :param `windowstyle`: this parameter influences the visual appearance of
       :class:`ToasterBoxWindow`, and can be one of the following styles:
      
       ====================== ========== ================================
       Window Style           Hex Value  Description
       ====================== ========== ================================
       ``TB_DEFAULT_STYLE``   0x2008002  Default window style for :class:`ToasterBox`, with no caption nor close box.
       ``TB_CAPTION``         0x22009806 :class:`ToasterBox` will have a caption, with the possibility to set a title for the :class:`ToasterBox` frame, and a close box.
       ====================== ========== ================================
      
      :param `closingstyle`: the closing style for :class:`ToasterBoxWindow`. Can be one of the
       following bits:
      
       ==================== =========== ==================================================
       Closing Styles       Hex Value   Description
       ==================== =========== ==================================================
       ``TB_ONTIME``                0x1 :class:`ToasterBox` will close after a specified amount of time.
       ``TB_ONCLICK``               0x2 :class:`ToasterBox` can be closed by clicking anywhere on the :class:`ToasterBox` frame.
       ==================== =========== ==================================================
      
      :param `scrollType`: the scrolling direction for :class:`ToasterBoxWindow`. Can be one of the
       following bits:
      
       ==================== =========== ==================================================
       Scroll Styles        Hex Value   Description
       ==================== =========== ==================================================
       ``TB_SCR_TYPE_UD``           0x1 :class:`ToasterBox` will scroll from up to down
       ``TB_SCR_TYPE_DU``           0x2 :class:`ToasterBox` will scroll from down to up
       ``TB_SCR_TYPE_FADE``         0x4 :class:`ToasterBox` will fade in/out (without scrolling).
       ==================== =========== ==================================================


   .. method:: AddPanel(self, panel)

      Adds a panel to the :class:`ToasterBox`.
      
      :param `panel`: an instance of :class:`wx.Window`.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_COMPLEX`` style.


   .. method:: AlphaCycle(self, event)

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


   .. method:: DrawText(self, dc=None)

      Draws the text label for a :class:`ToasterBox` with ``TB_SIMPLE`` style set.
      
      :param `dc`: an instance of :class:`wx.DC`. If defaulted to ``None``, a :class:`ClientDC`
       will be created on the fly.


   .. method:: GetPopupText(self)

      Returns the :class:`ToasterBox` text.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style.


   .. method:: MakeWindowTransparent(self, amount)

      Makes the :class:`ToasterBoxWindow` window transparent.
      
      :param `amount`: the alpha channel value.


   .. method:: NotifyTimer(self, event)

      Hides gradually the :class:`ToasterBoxWindow`. 


   .. method:: OnClose(self, event)

      Handles the ``wx.EVT_CLOSE`` event for :class:`ToasterBoxWindow`.
      
      :param `event`: a :class:`CloseEvent` event to be processed.


   .. method:: OnMouseDown(self, event)

      Handles the ``wx.EVT_LEFT_DOWN`` event for :class:`ToasterBoxWindow`.
      
      :param `event`: a :class:`MouseEvent` event to be processed.


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`ToasterBoxWindow`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.
      
      :note: This event is handled and processed only if the style ``TB_SIMPLE`` is
       given to :class:`ToasterBox`.


   .. method:: OnScrollTimer(self, event)

      Handles the ``wx.EVT_TIMER`` event for :class:`ToasterBoxWindow` scrolling up/down.
      
      :param `event`: a :class:`TimerEvent` event to be processed.


   .. method:: Play(self)

      Creates the :class:`ToasterBoxWindow`, that does all the job. 


   .. method:: ScrollDown(self)

      Scrolls the :class:`ToasterBox` down, which means gradually hiding it. 


   .. method:: ScrollUp(self)

      Scrolls the :class:`ToasterBox` up, which means gradually showing it. 


   .. method:: SetPopupBackgroundColour(self, colour)

      Sets the :class:`ToasterBox` background colour.
      
      :param `colour`: a valid :class:`wx.Colour` object. If defaulted to ``None``, then
       the background colour will be white.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style.


   .. method:: SetPopupBitmap(self, bitmap=None)

      Sets the :class:`ToasterBox` background image.
      
      :param `bitmap`: a valid :class:`wx.Bitmap` object. If defaulted to ``None``, then
       no background bitmap is used.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style.


   .. method:: SetPopupPauseTime(self, pausetime)

      Sets the time after which the :class:`ToasterBox` is destroyed (linger).
      
      :param `pausetime`: the delay after which the control is destroyed, in seconds.


   .. method:: SetPopupPosition(self, pos)

      Sets the :class:`ToasterBox` position on screen.
      
      :param `pos`: the widget position, an instance of :class:`wx.Point`.


   .. method:: SetPopupPositionByInt(self, pos)

      Sets the :class:`ToasterBox` position on screen, at one of the screen corners.
      
      :param `pos`: an integer specifying the screen corner, namely:
      
       ============= ========================================
       Corner Number Position
       ============= ========================================
             0       Top left screen corner
             1       Top right screen corner
             2       Bottom left screen corner
             3       Bottom right screen corner
       ============= ========================================


   .. method:: SetPopupScrollSpeed(self, speed)

      Sets the :class:`ToasterBox` scroll speed.
      
      :param `speed`: it is the pause time (in milliseconds) for every step in the
       :meth:`~ToasterBoxWindow.ScrollUp` method.


   .. method:: SetPopupSize(self, size)

      Sets the :class:`ToasterBox` size.
      
      :param `size`: the new control size, an instance of :class:`wx.Size`.


   .. method:: SetPopupText(self, text)

      Sets the :class:`ToasterBox` text label.
      
      :param `text`: the widget label.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style.


   .. method:: SetPopupTextColour(self, colour)

      Sets the :class:`ToasterBox` foreground colour.
      
      :param `colour`: a valid :class:`wx.Colour` object. If defaulted to ``None``, then
       the background colour will be black.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style.


   .. method:: SetPopupTextFont(self, font)

      Sets the :class:`ToasterBox` text font.
      
      :param `colour`: a valid :class:`wx.Colour` object. If defaulted to ``None``, then
       a simple generic font will be generated.
      
      :note: Use this method only for a :class:`ToasterBox` created with the ``TB_SIMPLE`` style.


   .. method:: SetupPositions(self)

      Sets up the position, size and scrolling step for :class:`ToasterBoxWindow`. 


   .. method:: SetUseFocus(self, focus, originalfocus)

      If `focus` is ``True``, Instructs :class:`ToasterBoxWindow` to steal the focus from the
      parent application, otherwise it returns the focus to the original owner.
      
      :param `focus`: ``True`` to set the focus on :class:`ToasterBoxWindow`, ``False`` to
       return it to the original owner;
      :param `originalfocus`: an instance of :class:`wx.Window`, representing a pointer to
       the window which originally had the focus


   .. method:: TearDown(self)

      Scrolls the :class:`ToasterBox` down, which means gradually hiding it. 


   .. method:: TearUp(self)

      Scrolls the :class:`ToasterBox` up, which means gradually showing it.