.. wxPython Phoenix documentation

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

   Copyright: (c) 2011-2020 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>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.agw.toasterbox.ToasterBoxWindow.html" title="wx.lib.agw.toasterbox.ToasterBoxWindow" alt="" coords="5,547,299,576"/> <area shape="rect" id="node2" href="wx.Frame.html" title="wx.Frame" alt="" coords="109,469,195,499"/> <area shape="rect" id="node3" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="75,392,229,421"/> <area shape="rect" id="node4" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="68,315,236,344"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="103,237,201,267"/> <area shape="rect" id="node6" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="87,160,217,189"/> <area shape="rect" id="node7" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="93,83,211,112"/> <area shape="rect" id="node8" href="wx.Object.html" title="wx.Object" alt="" coords="49,5,135,35"/> <area shape="rect" id="node9" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="160,5,267,35"/> </map> 
   </p>
   </div>

|


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


