wx.lib.agw.balloontip.BalloonTip¶
BalloonTip is a class that allows you to display tooltips in a balloon style
window.
This is the main class implementation.
Class Hierarchy¶
Control Appearance¶
Methods Summary¶
Default class constructor. |
|
The destruction timer has expired. Destroys the |
|
Enable/disable globally the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the |
|
Returns the delay time after which the |
|
Returns the colour for the tip message. |
|
Returns the font for the tip message. |
|
Returns the delay time after which the |
|
Returns the target window for the |
|
Returns the colour for the top title. |
|
Returns the font for the top title. |
|
The creation timer has expired. Creates the |
|
Handles the target destruction, specifically handling the |
|
Handles the mouse motion inside the taskbar icon area. |
|
Handles the |
|
Handles the |
|
Handle the mouse motion inside the target. |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the |
|
Sets the delay time after which the BalloonTip is destroyed. |
|
Sets the colour for the tip message. |
|
Sets the font for the tip message. |
|
Sets the delay time after which the |
|
Sets the target control/window for the |
|
Sets the colour for the top title. |
|
Sets the font for the top title. |
|
This timer check periodically the mouse position. |
Class API¶
- class BalloonTip(object)¶
BalloonTipis a class that allows you to display tooltips in a balloon style window.This is the main class implementation.
Methods¶
- __init__(self, topicon=None, toptitle='', message='', shape=BT_ROUNDED, tipstyle=BT_LEAVE)¶
Default class constructor.
- Parameters:
topicon (
wx.BitmaporNone) – an icon that will be displayed on the top-left part of theBalloonTipframe. If set toNone, no icon will be displayed;toptitle (string) – a title that will be displayed on the top part of the
BalloonTipframe. If set to an empty string, no title will be displayed;message (string) – the tip message that will be displayed. It can not be set to an empty string;
shape (integer) – the
BalloonTipshape. It can be one of the following:Shape Flag
Hex Value
Description
BT_ROUNDED0x1
BalloonTipwill have a rounded rectangular shape.BT_RECTANGLE0x2
BalloonTipwill have a rectangular shape.tipstyle (integer) – the
BalloonTipdestruction behavior. It can be one of:Tip Flag
Hex Value
Description
BT_LEAVE0x3
BalloonTipwill be destroyed when the user moves the mouse outside the target window.BT_CLICK0x4
BalloonTipwill be destroyed when the user click onBalloonTip.BT_BUTTON0x5
BalloonTipwill be destroyed when the user click on the close button.
- Raise:
Exception in the following cases:
The message parameter is an empty string;
The shape parameter has an invalid value (i.e., it’s not one of
BT_ROUNDED,BT_RECTANGLE);The tipstyle parameter has an invalid value (i.e., it’s not one of
BT_LEAVE,BT_CLICK,BT_BUTTON).
- DestroyTimer(self, event)¶
The destruction timer has expired. Destroys the
BalloonTipframe.- Parameters:
event – a
wx.TimerEventto be processed.
- EnableTip(self, enable=True)¶
Enable/disable globally the
BalloonTip.- Parameters:
enable (bool) –
Trueto enableBalloonTip,Falseotherwise.
- GetBalloonColour(self)¶
Returns the
BalloonTipbackground colour.- Returns:
An instance of
wx.Colour.
- GetBalloonIcon(self)¶
Returns the
BalloonTiptop-left icon.- Returns:
An instance of
wx.Bitmap.
- GetBalloonMessage(self)¶
Returns the
BalloonTiptip message.- Returns:
A string containing the main message.
- GetBalloonShape(self)¶
Returns the
BalloonTipframe shape.- Returns:
An integer, one of
BT_ROUNDED,BT_RECTANGLE.
- GetBalloonTipStyle(self)¶
Returns the
BalloonTiptipstyle parameter.- Returns:
An integer representing the style.
See also
- GetBalloonTitle(self)¶
Returns the
BalloonTiptop title.- Returns:
A string containing the top title.
- GetEndDelay(self)¶
Returns the delay time after which the
BalloonTipis destroyed.- Returns:
the delay time, in milliseconds.
- GetStartDelay(self)¶
Returns the delay time after which the
BalloonTipis created.- Returns:
the delay time, in milliseconds.
- GetTarget(self)¶
Returns the target window for the
BalloonTip.
- NotifyTimer(self, event)¶
The creation timer has expired. Creates the
BalloonTipframe.- Parameters:
event – a
wx.TimerEventto be processed.
- OnDestroy(self, event)¶
Handles the target destruction, specifically handling the
wx.EVT_WINDOW_DESTROYevent.- Parameters:
event – a
wx.WindowDestroyEventevent to be processed.
- OnTaskBarMove(self, event)¶
Handles the mouse motion inside the taskbar icon area.
- Parameters:
event – a
MouseEventevent to be processed.
- OnWidgetEnter(self, event)¶
Handles the
wx.EVT_ENTER_WINDOWfor the target control/window and starts theBalloonTiptimer for creation.- Parameters:
event – a
MouseEventevent to be processed.
- OnWidgetLeave(self, event)¶
Handles the
wx.EVT_LEAVE_WINDOWfor the target control/window.- Parameters:
event – a
MouseEventevent to be processed.
Note
If the BalloonTip tipstyle is set to
BT_LEAVE, theBalloonTipis destroyed.
- OnWidgetMotion(self, event)¶
Handle the mouse motion inside the target.
This prevents the annoying behavior of
BalloonTipto display when the user does something else inside the window. TheBalloonTipwindow is displayed only when the mouse does not move for the start delay time.- Parameters:
event – a
MouseEventevent to be processed.
- SetBalloonColour(self, colour=None)¶
Sets the
BalloonTipbackground colour.- Parameters:
colour – a valid
wx.Colourinstance.
- SetBalloonIcon(self, icon)¶
Sets the
BalloonTiptop-left icon.
- SetBalloonMessage(self, message)¶
Sets the
BalloonTiptip message.- Parameters:
message (string) – a string identifying the main message body of
BalloonTip.- Raise:
Exception if the message is an empty string.
Note
The
BalloonTipmessage should never be empty.
- SetBalloonShape(self, shape=BT_ROUNDED)¶
Sets the
BalloonTipframe shape.- Parameters:
shape (integer) – should be one of
BT_ROUNDEDorBT_RECTANGLE.- Raise:
Exception if the shape parameter is not a valid value (i.e., it’s not one of
BT_ROUNDED,BT_RECTANGLE);
- SetBalloonTipStyle(self, tipstyle=BT_LEAVE)¶
Sets the
BalloonTiptipstyle parameter.- Parameters:
tipstyle (integer) – one of the following bit set:
Tip Style
Hex Value
Description
BT_LEAVE0x3
BalloonTipwill be destroyed when the user moves the mouse outside the target window.BT_CLICK0x4
BalloonTipwill be destroyed when the user click onBalloonTip.BT_BUTTON0x5
BalloonTipwill be destroyed when the user click on the close button.- Raise:
Exception if the tipstyle parameter has an invalid value (i.e., it’s not one of
BT_LEAVE,BT_CLICK,BT_BUTTON).
- SetBalloonTitle(self, title='')¶
Sets the
BalloonTiptop title.- Parameters:
title (string) – a string to use as a
BalloonTiptitle.
- SetEndDelay(self, delay=1e6)¶
Sets the delay time after which the BalloonTip is destroyed.
- Parameters:
delay (integer) – the number of milliseconds after which
BalloonTipis destroyed.- Raise:
Exception if delay is less than
1milliseconds.
- SetMessageColour(self, colour=None)¶
Sets the colour for the tip message.
- Parameters:
colour – a valid
wx.Colourinstance.
- SetMessageFont(self, font=None)¶
Sets the font for the tip message.
- Parameters:
font – a valid
wx.Fontinstance.
- SetStartDelay(self, delay=1)¶
Sets the delay time after which the
BalloonTipis created.- Parameters:
delay (integer) – the number of milliseconds after which
BalloonTipis created.- Raise:
Exception if delay is less than
1milliseconds.
- SetTarget(self, widget)¶
Sets the target control/window for the
BalloonTip.- Parameters:
widget – any subclass of
wx.Window.
- SetTitleColour(self, colour=None)¶
Sets the colour for the top title.
- Parameters:
colour – a valid
wx.Colourinstance.
- SetTitleFont(self, font=None)¶
Sets the font for the top title.
- Parameters:
font – a valid
wx.Fontinstance.
- TaskBarTimer(self, event)¶
This timer check periodically the mouse position.
If the current mouse position is sufficiently far from the coordinates it had when entered the taskbar icon and the
BalloonTipstyle isBT_LEAVE, theBalloonTipframe is destroyed.- Parameters:
event – a
wx.TimerEventto be processed.