AGW Logo

agw_title AdvancedSplash

AdvancedSplash tries to reproduce the behavior of wx.SplashScreen, with some enhancements.

This is the main class implementation.

hierarchy Inheritance Diagram

Inheritance diagram for: AdvancedSplash

Inheritance diagram of AdvancedSplash


appearance Control Appearance


AdvancedSplash

AdvancedSplash


method_summary Methods Summary

__init__Default class constructor.
GetSplashStyleReturns a list of strings and a list of integers containing the styles.
GetTextReturns the text displayed on AdvancedSplash.
GetTextColourGets the colour for the text in AdvancedSplash.
GetTextFontGets the font for the text in AdvancedSplash.
GetTextPositionReturns the text position inside AdvancedSplash frame.
OnCharEventsHandles the wx.EVT_CHAR event for AdvancedSplash.
OnCloseWindowHandles the wx.EVT_CLOSE event for AdvancedSplash.
OnMouseEventsHandles the wx.EVT_MOUSE_EVENTS events for AdvancedSplash.
OnNotifyHandles the timer expiration, and calls the Close() method.
OnPaintHandles the wx.EVT_PAINT event for AdvancedSplash.
SetSplashShapeSets AdvancedSplash shape using the region created from the bitmap.
SetTextSets the text to be displayed on AdvancedSplash.
SetTextColourSets the colour for the text in AdvancedSplash.
SetTextFontSets the font for the text in AdvancedSplash.
SetTextPositionSets the text position inside AdvancedSplash frame.
ShadowBitmapApplies a mask on the bitmap accordingly to user input.

API Class API

class AdvancedSplash(wx.Frame)[source]

AdvancedSplash tries to reproduce the behavior of wx.SplashScreen, with some enhancements.

This is the main class implementation.



__init__(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)[source]

Default class constructor.

Parameters:
  • parent (wx.Window) – parent window;
  • id (integer) – window identifier. A value of -1 indicates a default value;
  • pos (tuple or wx.Point) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size (tuple or wx.Size) – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;
  • style (integer) – the underlying wx.Frame style;
  • 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 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 wx.Bitmap.
  • timeout (integer) – if you construct AdvancedSplash using the style AS_TIMEOUT, AdvancedSplash will be destroyed after timeout milliseconds;
  • agwStyle (integer) – this value specifies the AdvancedSplash styles:


    integer parameter settings
    Window Styles Hex Value Description
    AS_TIMEOUT 0x1 AdvancedSplash will be destroyed after timeout milliseconds.
    AS_NOTIMEOUT 0x2 AdvancedSplash can be destroyed by clicking on it, pressing a key or by explicitly call the Close() method.
    AS_CENTER_ON_SCREEN 0x4 AdvancedSplash will be centered on screen.
    AS_CENTER_ON_PARENT 0x8 AdvancedSplash will be centered on parent.
    AS_NO_CENTER 0x10 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 AdvancedSplash will be defined only by non-transparent (non-masked) pixels.
  • shadowcolour (wx.Colour) – if you construct 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.
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 AdvancedSplash bitmap is an invalid wx.Bitmap.


GetSplashStyle()[source]

Returns a list of strings and a list of integers containing the styles.

Returns:Two Python lists containing the style name and style values for AdvancedSplash.


GetText()[source]

Returns the text displayed on AdvancedSplash.

Returns:A string representing the text drawn on top of the AdvancedSplash bitmap.


GetTextColour()[source]

Gets the colour for the text in AdvancedSplash.

Returns:An instance of wx.Colour.


GetTextFont()[source]

Gets the font for the text in AdvancedSplash.

Returns:An instance of wx.Font to draw the text and a wx.Size object containing the text width an height, in pixels.


GetTextPosition()[source]

Returns the text position inside AdvancedSplash frame.

Returns:A tuple containing the text x and y position inside the AdvancedSplash frame.


OnCharEvents(event)[source]

Handles the wx.EVT_CHAR event for AdvancedSplash.

Parameters:event – a wx.KeyEvent to be processed.

Note

This reproduces the behavior of wx.SplashScreen.



OnCloseWindow(event)[source]

Handles the wx.EVT_CLOSE event for AdvancedSplash.

Parameters:event – a wx.CloseEvent to be processed.

Note

This reproduces the behavior of wx.SplashScreen.



OnMouseEvents(event)[source]

Handles the wx.EVT_MOUSE_EVENTS events for AdvancedSplash.

Parameters:event – a wx.MouseEvent to be processed.

Note

This reproduces the behavior of wx.SplashScreen.



OnNotify()[source]

Handles the timer expiration, and calls the Close() method.



OnPaint(event)[source]

Handles the wx.EVT_PAINT event for AdvancedSplash.

Parameters:event – a wx.PaintEvent to be processed.


SetSplashShape(event=None)[source]

Sets AdvancedSplash shape using the region created from the bitmap.

Parameters:event – a wx.WindowCreateEvent event (GTK only, as GTK supports setting the window shape only during window creation).


SetText(text=None)[source]

Sets the text to be displayed on AdvancedSplash.

Parameters:text (string or None) – 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.


SetTextColour(colour=None)[source]

Sets the colour for the text in AdvancedSplash.

Parameters:colour – the text colour to use while drawing the text on top of our bitmap. If colour is None, then wx.BLACK is used.


SetTextFont(font=None)[source]

Sets the font for the text in AdvancedSplash.

Parameters:font (wx.Font or None) – the font to use while drawing the text on top of our bitmap. If font is None, a simple generic font is generated.


SetTextPosition(position=None)[source]

Sets the text position inside AdvancedSplash frame.

Parameters:position (tuple or None) – the text position inside our bitmap. If position is None, the text will be placed at the top-left corner.


ShadowBitmap(bmp, shadowcolour)[source]

Applies a mask on the bitmap accordingly to user input.

Parameters:
  • bmp – the bitmap to which we want to apply the mask colour shadowcolour;
  • shadowcolour – the mask colour for our bitmap.
Returns:

A masked version of the input bitmap, an instance of wx.Bitmap.

Tree

Table Of Contents

Previous topic

advancedsplash

Next topic

SVN Revision 68362 For advancedsplash