wx.lib.agw.advancedsplash.AdvancedSplash¶
AdvancedSplash tries to reproduce the behavior of SplashScreen, with
some enhancements.
This is the main class implementation.
Class Hierarchy¶
Control Appearance¶
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Returns a list of strings and a list of integers containing the styles. |
|
Returns the text displayed on |
|
Gets the colour for the text in |
|
Gets the font for the text in |
|
Returns the text position inside |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the timer expiration, and calls the Close() method. |
|
Handles the |
|
Sets |
|
Sets the text to be displayed on |
|
Sets the colour for the text in |
|
Sets the font for the text in |
|
Sets the text position inside |
|
Applies a mask on the bitmap accordingly to user input. |
Class API¶
- class AdvancedSplash(wx.Frame)¶
AdvancedSplashtries to reproduce the behavior ofSplashScreen, with some enhancements.This is the main class implementation.
Methods¶
- __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.
- 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.Framestyle;bitmap (
wx.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 theAdvancedSplashframe 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 yourwx.Bitmap.timeout (integer) – if you construct
AdvancedSplashusing the styleAS_TIMEOUT,AdvancedSplashwill be destroyed after timeout milliseconds;agwStyle (integer) – this value specifies the
AdvancedSplashstyles:Window Styles
Hex Value
Description
AS_TIMEOUT0x1
AdvancedSplashwill be destroyed after timeout milliseconds.AS_NOTIMEOUT0x2
AdvancedSplashcan be destroyed by clicking on it, pressing a key or by explicitly call the Close() method.AS_CENTER_ON_SCREEN0x4
AdvancedSplashwill be centered on screen.AS_CENTER_ON_PARENT0x8
AdvancedSplashwill be centered on parent.AS_NO_CENTER0x10
AdvancedSplashwill not be centered.AS_SHADOW_BITMAP0x20
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
AdvancedSplashwill be defined only by non-transparent (non-masked) pixels.shadowcolour (
wx.Colour) – if you constructAdvancedSplashusing the styleAS_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_TIMEOUTstyle is set but timeout is not a positive integer;The
AS_SHADOW_BITMAPstyle is set but shadowcolour is not a valid wxPython colour;The
AdvancedSplashbitmap is an invalidwx.Bitmap.
- GetSplashStyle(self)¶
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(self)¶
Returns the text displayed on
AdvancedSplash.- Returns:
A string representing the text drawn on top of the
AdvancedSplashbitmap.
- GetTextColour(self)¶
Gets the colour for the text in
AdvancedSplash.- Returns:
An instance of
wx.Colour.
- GetTextFont(self)¶
Gets the font for the text in
AdvancedSplash.
- GetTextPosition(self)¶
Returns the text position inside
AdvancedSplashframe.- Returns:
A tuple containing the text x and y position inside the
AdvancedSplashframe.
- OnCharEvents(self, event)¶
Handles the
wx.EVT_CHARevent forAdvancedSplash.- Parameters:
event – a
KeyEventto be processed.
Note
This reproduces the behavior of
SplashScreen.
- OnCloseWindow(self, event)¶
Handles the
wx.EVT_CLOSEevent forAdvancedSplash.- Parameters:
event – a
CloseEventto be processed.
Note
This reproduces the behavior of
SplashScreen.
- OnMouseEvents(self, event)¶
Handles the
wx.EVT_MOUSE_EVENTSevents forAdvancedSplash.- Parameters:
event – a
MouseEventto be processed.
Note
This reproduces the behavior of
SplashScreen.
- OnNotify(self, event)¶
Handles the timer expiration, and calls the Close() method.
- Parameters:
event – a
wx.TimerEventto be processed.
- OnPaint(self, event)¶
Handles the
wx.EVT_PAINTevent forAdvancedSplash.- Parameters:
event – a
PaintEventto be processed.
- SetSplashShape(self, event=None)¶
Sets
AdvancedSplashshape using the region created from the bitmap.- Parameters:
event – a
wx.WindowCreateEventevent (GTK only, as GTK supports setting the window shape only during window creation).
- SetText(self, text=None)¶
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 toNone, nothing will be drawn on top of the bitmap.
- SetTextColour(self, colour=None)¶
Sets the colour for the text in
AdvancedSplash.- Parameters:
colour (
wx.ColourorNone) – the text colour to use while drawing the text on top of our bitmap. If colour isNone, thenwx.BLACKis used.
- SetTextFont(self, font=None)¶
Sets the font for the text in
AdvancedSplash.- Parameters:
font (
wx.FontorNone) – the font to use while drawing the text on top of our bitmap. If font isNone, a simple generic font is generated.
- SetTextPosition(self, position=None)¶
Sets the text position inside
AdvancedSplashframe.- Parameters:
position (tuple or
None) – the text position inside our bitmap. If position isNone, the text will be placed at the top-left corner.
- ShadowBitmap(self, bmp, shadowcolour)¶
Applies a mask on the bitmap accordingly to user input.