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, ToasterBoxWindow will
behave differently in order to handle widgets inside it.
Class Hierarchy¶
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Adds a panel to the |
|
Handles the |
|
Draws the text label for a |
|
Returns the |
|
Makes the |
|
Hides gradually the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Handles the |
|
Creates the |
|
Scrolls the |
|
Scrolls the |
|
Sets the |
|
Sets the |
|
Sets the time after which the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets up the position, size and scrolling step for |
|
If focus is |
|
Scrolls the |
|
Scrolls the |
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,
ToasterBoxWindowwill behave differently in order to handle widgets inside it.
Methods¶
- __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!
- Parameters:
parent – the window parent;
parent2 – the
ToasterBoxcalling this window;tbstyle –
the
ToasterBoxWindowmain style. Can be one of the following bits:ToasterBoxStyleValue
Description
TB_SIMPLE0x1
A simple
ToasterBox, with background image and text customization can be createdTB_COMPLEX0x2
ToasterBoxes with different degree of complexity can be created. You can add as many controls as you want, provided that you call the
AddPanelmethod and pass to it a dummy frame and aPanel.windowstyle –
this parameter influences the visual appearance of
ToasterBoxWindow, and can be one of the following styles:Window Style
Hex Value
Description
TB_DEFAULT_STYLE0x2008002
Default window style for
ToasterBox, with no caption nor close box.TB_CAPTION0x22009806
ToasterBoxwill have a caption, with the possibility to set a title for theToasterBoxframe, and a close box.closingstyle –
the closing style for
ToasterBoxWindow. Can be one of the following bits:Closing Styles
Hex Value
Description
TB_ONTIME0x1
ToasterBoxwill close after a specified amount of time.TB_ONCLICK0x2
ToasterBoxcan be closed by clicking anywhere on theToasterBoxframe.scrollType –
the scrolling direction for
ToasterBoxWindow. Can be one of the following bits:Scroll Styles
Hex Value
Description
TB_SCR_TYPE_UD0x1
ToasterBoxwill scroll from up to downTB_SCR_TYPE_DU0x2
ToasterBoxwill scroll from down to upTB_SCR_TYPE_FADE0x4
ToasterBoxwill fade in/out (without scrolling).
- AddPanel(self, panel)¶
Adds a panel to the
ToasterBox.- Parameters:
panel – an instance of
wx.Window.
Note
Use this method only for a
ToasterBoxcreated with theTB_COMPLEXstyle.
- AlphaCycle(self, event)¶
Handles the
wx.EVT_TIMERevent forToasterBoxWindow.- Parameters:
event – a
TimerEventevent to be processed.
- DrawText(self, dc=None)¶
Draws the text label for a
ToasterBoxwithTB_SIMPLEstyle set.- Parameters:
dc – an instance of
wx.DC. If defaulted toNone, aClientDCwill be created on the fly.
- GetPopupText(self)¶
Returns the
ToasterBoxtext.Note
Use this method only for a
ToasterBoxcreated with theTB_SIMPLEstyle.
- MakeWindowTransparent(self, amount)¶
Makes the
ToasterBoxWindowwindow transparent.- Parameters:
amount – the alpha channel value.
- NotifyTimer(self, event)¶
Hides gradually the
ToasterBoxWindow.
- OnClose(self, event)¶
Handles the
wx.EVT_CLOSEevent forToasterBoxWindow.- Parameters:
event – a
CloseEventevent to be processed.
- OnMouseDown(self, event)¶
Handles the
wx.EVT_LEFT_DOWNevent forToasterBoxWindow.- Parameters:
event – a
MouseEventevent to be processed.
- OnPaint(self, event)¶
Handles the
wx.EVT_PAINTevent forToasterBoxWindow.- Parameters:
event – a
PaintEventevent to be processed.
Note
This event is handled and processed only if the style
TB_SIMPLEis given toToasterBox.
- OnScrollTimer(self, event)¶
Handles the
wx.EVT_TIMERevent forToasterBoxWindowscrolling up/down.- Parameters:
event – a
TimerEventevent to be processed.
- Play(self)¶
Creates the
ToasterBoxWindow, that does all the job.
- ScrollDown(self)¶
Scrolls the
ToasterBoxdown, which means gradually hiding it.
- ScrollUp(self)¶
Scrolls the
ToasterBoxup, which means gradually showing it.
- SetPopupBackgroundColour(self, colour)¶
Sets the
ToasterBoxbackground colour.- Parameters:
colour – a valid
wx.Colourobject. If defaulted toNone, then the background colour will be white.
Note
Use this method only for a
ToasterBoxcreated with theTB_SIMPLEstyle.
- SetPopupBitmap(self, bitmap=None)¶
Sets the
ToasterBoxbackground image.- Parameters:
bitmap – a valid
wx.Bitmapobject. If defaulted toNone, then no background bitmap is used.
Note
Use this method only for a
ToasterBoxcreated with theTB_SIMPLEstyle.
- SetPopupPauseTime(self, pausetime)¶
Sets the time after which the
ToasterBoxis destroyed (linger).- Parameters:
pausetime – the delay after which the control is destroyed, in seconds.
- SetPopupPosition(self, pos)¶
Sets the
ToasterBoxposition on screen.- Parameters:
pos – the widget position, an instance of
wx.Point.
- SetPopupPositionByInt(self, pos)¶
Sets the
ToasterBoxposition on screen, at one of the screen corners.- Parameters:
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
- SetPopupScrollSpeed(self, speed)¶
Sets the
ToasterBoxscroll speed.- Parameters:
speed – it is the pause time (in milliseconds) for every step in the
ScrollUpmethod.
- SetPopupSize(self, size)¶
Sets the
ToasterBoxsize.- Parameters:
size – the new control size, an instance of
wx.Size.
- SetPopupText(self, text)¶
Sets the
ToasterBoxtext label.- Parameters:
text – the widget label.
Note
Use this method only for a
ToasterBoxcreated with theTB_SIMPLEstyle.
- SetPopupTextColour(self, colour)¶
Sets the
ToasterBoxforeground colour.- Parameters:
colour – a valid
wx.Colourobject. If defaulted toNone, then the background colour will be black.
Note
Use this method only for a
ToasterBoxcreated with theTB_SIMPLEstyle.
- SetPopupTextFont(self, font)¶
Sets the
ToasterBoxtext font.- Parameters:
colour – a valid
wx.Colourobject. If defaulted toNone, then a simple generic font will be generated.
Note
Use this method only for a
ToasterBoxcreated with theTB_SIMPLEstyle.
- SetupPositions(self)¶
Sets up the position, size and scrolling step for
ToasterBoxWindow.
- SetUseFocus(self, focus, originalfocus)¶
If focus is
True, InstructsToasterBoxWindowto steal the focus from the parent application, otherwise it returns the focus to the original owner.- Parameters:
focus –
Trueto set the focus onToasterBoxWindow,Falseto return it to the original owner;originalfocus – an instance of
wx.Window, representing a pointer to the window which originally had the focus
- TearDown(self)¶
Scrolls the
ToasterBoxdown, which means gradually hiding it.
- TearUp(self)¶
Scrolls the
ToasterBoxup, which means gradually showing it.