.. 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.advancedsplash
.. highlight:: python
.. _wx.lib.agw.advancedsplash.AdvancedSplash:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.advancedsplash.AdvancedSplash**
==========================================================================================================================================
:class:`AdvancedSplash` tries to reproduce the behavior of :class:`~adv.SplashScreen`, with
some enhancements.
This is the main class implementation.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html

Inheritance diagram for class
AdvancedSplash:
|
|appearance| Control Appearance
===============================
|
.. container:: control-appearance-figures
.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.advancedsplash.advancedsplash.png
:alt: wxMSW
:figclass: appearance-figure
**wxMSW**
.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
:alt: wxMAC
:figclass: appearance-figure
**wxMAC**
.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.advancedsplash.advancedsplash.png
:alt: wxGTK
:figclass: appearance-figure
**wxGTK**
|
|super_classes| Known Superclasses
==================================
:class:`wx.Frame`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.__init__` Default class constructor.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.GetSplashStyle` Returns a list of strings and a list of integers containing the styles.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.GetText` Returns the text displayed on :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.GetTextColour` Gets the colour for the text in :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.GetTextFont` Gets the font for the text in :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.GetTextPosition` Returns the text position inside :class:`AdvancedSplash` frame.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.OnCharEvents` Handles the ``wx.EVT_CHAR`` event for :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.OnCloseWindow` Handles the ``wx.EVT_CLOSE`` event for :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.OnMouseEvents` Handles the ``wx.EVT_MOUSE_EVENTS`` events for :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.OnNotify` Handles the timer expiration, and calls the `Close()` method.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.OnPaint` Handles the ``wx.EVT_PAINT`` event for :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.SetSplashShape` Sets :class:`AdvancedSplash` shape using the region created from the bitmap.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.SetText` Sets the text to be displayed on :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.SetTextColour` Sets the colour for the text in :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.SetTextFont` Sets the font for the text in :class:`AdvancedSplash`.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.SetTextPosition` Sets the text position inside :class:`AdvancedSplash` frame.
:meth:`~wx.lib.agw.advancedsplash.AdvancedSplash.ShadowBitmap` Applies a mask on the bitmap accordingly to user input.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: AdvancedSplash(wx.Frame)
:class:`AdvancedSplash` tries to reproduce the behavior of :class:`~adv.SplashScreen`, with
some enhancements.
This is the main class implementation.
.. method:: __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.FRAME_NO_TASKBAR | wx.FRAME_SHAPED | wx.STAY_ON_TOP, bitmap=None, timeout=5000, agwStyle=AS_TIMEOUT | AS_CENTER_ON_SCREEN, shadowcolour=wx.NullColour)
Default class constructor.
:param `parent`: parent window;
:param integer `id`: window identifier. A value of -1 indicates a default value;
: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 integer `style`: the underlying :class:`wx.Frame` style;
:param `bitmap`: this must be a valid bitmap, that you may construct using
whatever image file format supported by wxPython. If the file you load
already supports mask/transparency (like png), the transparent areas
will not be drawn on screen, and the :class:`AdvancedSplash` frame will have
the shape defined only by *non-transparent* pixels.
If you use other file formats that does not supports transparency, you
can obtain the same effect as above by masking a specific colour in
your :class:`wx.Bitmap`.
:param integer `timeout`: if you construct :class:`AdvancedSplash` using the style ``AS_TIMEOUT``,
:class:`AdvancedSplash` will be destroyed after `timeout` milliseconds;
:param integer `agwStyle`: this value specifies the :class:`AdvancedSplash` styles:
======================= =========== ==================================================
Window Styles Hex Value Description
======================= =========== ==================================================
``AS_TIMEOUT`` 0x1 :class:`AdvancedSplash` will be destroyed after `timeout` milliseconds.
``AS_NOTIMEOUT`` 0x2 :class:`AdvancedSplash` can be destroyed by clicking on it, pressing a key or by explicitly call the `Close()` method.
``AS_CENTER_ON_SCREEN`` 0x4 :class:`AdvancedSplash` will be centered on screen.
``AS_CENTER_ON_PARENT`` 0x8 :class:`AdvancedSplash` will be centered on parent.
``AS_NO_CENTER`` 0x10 :class:`AdvancedSplash` will not be centered.
``AS_SHADOW_BITMAP`` 0x20 If the bitmap you pass as input has no transparency, you can choose one colour that will be masked in your bitmap. the final shape of :class:`AdvancedSplash` will be defined only by non-transparent (non-masked) pixels.
======================= =========== ==================================================
:param `shadowcolour`: if you construct :class:`AdvancedSplash` using the style
``AS_SHADOW_BITMAP``, here you can specify the colour that will be masked on
your input bitmap. This has to be a valid wxPython colour.
:type parent: :class:`wx.Window`
:type pos: tuple or :class:`wx.Point`
:type size: tuple or :class:`wx.Size`
:type bitmap: :class:`wx.Bitmap`
:type shadowcolour: :class:`wx.Colour`
:raise: `Exception` in the following cases:
- The ``AS_TIMEOUT`` style is set but `timeout` is not a positive integer;
- The ``AS_SHADOW_BITMAP`` style is set but `shadowcolour` is not a valid wxPython colour;
- The :class:`AdvancedSplash` bitmap is an invalid :class:`wx.Bitmap`.
.. method:: GetSplashStyle(self)
Returns a list of strings and a list of integers containing the styles.
:return: Two Python lists containing the style name and style values for :class:`AdvancedSplash`.
.. method:: GetText(self)
Returns the text displayed on :class:`AdvancedSplash`.
:return: A string representing the text drawn on top of the :class:`AdvancedSplash` bitmap.
.. method:: GetTextColour(self)
Gets the colour for the text in :class:`AdvancedSplash`.
:return: An instance of :class:`wx.Colour`.
.. method:: GetTextFont(self)
Gets the font for the text in :class:`AdvancedSplash`.
:return: An instance of :class:`wx.Font` to draw the text and a :class:`wx.Size` object containing
the text width an height, in pixels.
.. method:: GetTextPosition(self)
Returns the text position inside :class:`AdvancedSplash` frame.
:return: A tuple containing the text `x` and `y` position inside the :class:`AdvancedSplash` frame.
.. method:: OnCharEvents(self, event)
Handles the ``wx.EVT_CHAR`` event for :class:`AdvancedSplash`.
:param `event`: a :class:`KeyEvent` to be processed.
.. note:: This reproduces the behavior of :class:`~adv.SplashScreen`.
.. method:: OnCloseWindow(self, event)
Handles the ``wx.EVT_CLOSE`` event for :class:`AdvancedSplash`.
:param `event`: a :class:`CloseEvent` to be processed.
.. note:: This reproduces the behavior of :class:`~adv.SplashScreen`.
.. method:: OnMouseEvents(self, event)
Handles the ``wx.EVT_MOUSE_EVENTS`` events for :class:`AdvancedSplash`.
:param `event`: a :class:`MouseEvent` to be processed.
.. note:: This reproduces the behavior of :class:`~adv.SplashScreen`.
.. method:: OnNotify(self, event)
Handles the timer expiration, and calls the `Close()` method.
:param `event`: a :class:`wx.TimerEvent` to be processed.
.. method:: OnPaint(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`AdvancedSplash`.
:param `event`: a :class:`PaintEvent` to be processed.
.. method:: SetSplashShape(self, event=None)
Sets :class:`AdvancedSplash` shape using the region created from the bitmap.
:param `event`: a :class:`wx.WindowCreateEvent` event (GTK only, as GTK supports setting
the window shape only during window creation).
.. method:: SetText(self, text=None)
Sets the text to be displayed on :class:`AdvancedSplash`.
:param `text`: the text we want to display on top of the bitmap. If `text` is
set to ``None``, nothing will be drawn on top of the bitmap.
:type text: string or ``None``
.. method:: SetTextColour(self, colour=None)
Sets the colour for the text in :class:`AdvancedSplash`.
:param `colour`: the text colour to use while drawing the text on top of our
bitmap. If `colour` is ``None``, then ``wx.BLACK`` is used.
:type colour: :class:`wx.Colour` or ``None``
.. method:: SetTextFont(self, font=None)
Sets the font for the text in :class:`AdvancedSplash`.
:param `font`: the font to use while drawing the text on top of our bitmap. If `font`
is ``None``, a simple generic font is generated.
:type font: :class:`wx.Font` or ``None``
.. method:: SetTextPosition(self, position=None)
Sets the text position inside :class:`AdvancedSplash` frame.
:param `position`: the text position inside our bitmap. If `position` is ``None``,
the text will be placed at the top-left corner.
:type position: tuple or ``None``
.. method:: ShadowBitmap(self, bmp, shadowcolour)
Applies a mask on the bitmap accordingly to user input.
:param `bmp`: the bitmap to which we want to apply the mask colour `shadowcolour`;
:param `shadowcolour`: the mask colour for our bitmap.
:type bmp: :class:`wx.Bitmap`
:type shadowcolour: :class:`wx.Colour`
:return: A masked version of the input bitmap, an instance of :class:`wx.Bitmap`.