BalloonTip
is a class that allows you to display tooltips in a balloon style
window.
This is the main class implementation.
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. |
BalloonTip
(object)¶BalloonTip
is a class that allows you to display tooltips in a balloon style
window.
This is the main class implementation.
__init__
(self, topicon=None, toptitle="", message="", shape=BT_ROUNDED, tipstyle=BT_LEAVE)¶Default class constructor.
topicon (wx.Bitmap
or None
) – an icon that will be displayed on the top-left part of the
BalloonTip
frame. If set to None
, no icon will be displayed;
toptitle (string) – a title that will be displayed on the top part of the
BalloonTip
frame. 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 BalloonTip
shape. It can be one of the following:
Shape Flag |
Hex Value |
Description |
---|---|---|
|
0x1 |
|
|
0x2 |
|
tipstyle (integer) – the BalloonTip
destruction behavior. It can be one of:
Tip Flag |
Hex Value |
Description |
---|---|---|
|
0x3 |
|
|
0x4 |
|
|
0x5 |
|
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 BalloonTip
frame.
event – a wx.TimerEvent
to be processed.
EnableTip
(self, enable=True)¶Enable/disable globally the BalloonTip
.
enable (bool) – True
to enable BalloonTip
, False
otherwise.
GetBalloonColour
(self)¶Returns the BalloonTip
background colour.
An instance of wx.Colour
.
GetBalloonIcon
(self)¶Returns the BalloonTip
top-left icon.
An instance of wx.Bitmap
.
GetBalloonMessage
(self)¶Returns the BalloonTip
tip message.
A string containing the main message.
GetBalloonShape
(self)¶Returns the BalloonTip
frame shape.
An integer, one of BT_ROUNDED
, BT_RECTANGLE
.
GetBalloonTipStyle
(self)¶Returns the BalloonTip
tipstyle parameter.
An integer representing the style.
See also
GetBalloonTitle
(self)¶Returns the BalloonTip
top title.
A string containing the top title.
GetEndDelay
(self)¶Returns the delay time after which the BalloonTip
is destroyed.
the delay time, in milliseconds.
GetStartDelay
(self)¶Returns the delay time after which the BalloonTip
is created.
the delay time, in milliseconds.
GetTarget
(self)¶Returns the target window for the BalloonTip
.
NotifyTimer
(self, event)¶The creation timer has expired. Creates the BalloonTip
frame.
event – a wx.TimerEvent
to be processed.
OnDestroy
(self, event)¶Handles the target destruction, specifically handling the wx.EVT_WINDOW_DESTROY
event.
event – a wx.WindowDestroyEvent
event to be processed.
OnTaskBarMove
(self, event)¶Handles the mouse motion inside the taskbar icon area.
event – a MouseEvent
event to be processed.
OnWidgetEnter
(self, event)¶Handles the wx.EVT_ENTER_WINDOW
for the target control/window and
starts the BalloonTip
timer for creation.
event – a MouseEvent
event to be processed.
OnWidgetLeave
(self, event)¶Handles the wx.EVT_LEAVE_WINDOW
for the target control/window.
event – a MouseEvent
event to be processed.
Note
If the BalloonTip tipstyle is set to BT_LEAVE
, the BalloonTip
is destroyed.
OnWidgetMotion
(self, event)¶Handle the mouse motion inside the target.
This prevents the annoying behavior of BalloonTip
to display when the
user does something else inside the window. The BalloonTip
window is
displayed only when the mouse does not move for the start delay time.
event – a MouseEvent
event to be processed.
SetBalloonColour
(self, colour=None)¶Sets the BalloonTip
background colour.
colour – a valid wx.Colour
instance.
SetBalloonIcon
(self, icon)¶Sets the BalloonTip
top-left icon.
SetBalloonMessage
(self, message)¶Sets the BalloonTip
tip message.
message (string) – a string identifying the main message body of BalloonTip
.
Exception if the message is an empty string.
Note
The BalloonTip
message should never be empty.
SetBalloonShape
(self, shape=BT_ROUNDED)¶Sets the BalloonTip
frame shape.
shape (integer) – should be one of BT_ROUNDED
or BT_RECTANGLE
.
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 BalloonTip
tipstyle parameter.
tipstyle (integer) – one of the following bit set:
Tip Style |
Hex Value |
Description |
---|---|---|
|
0x3 |
|
|
0x4 |
|
|
0x5 |
|
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 BalloonTip
top title.
title (string) – a string to use as a BalloonTip
title.
SetEndDelay
(self, delay=1e6)¶Sets the delay time after which the BalloonTip is destroyed.
delay (integer) – the number of milliseconds after which BalloonTip
is destroyed.
Exception if delay is less than 1
milliseconds.
SetMessageColour
(self, colour=None)¶Sets the colour for the tip message.
colour – a valid wx.Colour
instance.
SetMessageFont
(self, font=None)¶Sets the font for the tip message.
font – a valid wx.Font
instance.
SetStartDelay
(self, delay=1)¶Sets the delay time after which the BalloonTip
is created.
delay (integer) – the number of milliseconds after which BalloonTip
is created.
Exception if delay is less than 1
milliseconds.
SetTarget
(self, widget)¶Sets the target control/window for the BalloonTip
.
widget – any subclass of wx.Window
.
SetTitleColour
(self, colour=None)¶Sets the colour for the top title.
colour – a valid wx.Colour
instance.
SetTitleFont
(self, font=None)¶Sets the font for the top title.
font – a valid wx.Font
instance.
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 BalloonTip
style is
BT_LEAVE
, the BalloonTip
frame is destroyed.
event – a wx.TimerEvent
to be processed.