Package wx :: Package lib :: Package agw :: Module balloontip
[frames | no frames]

Module wx.lib.agw.balloontip

Description:

BalloonTip is a class that allows you to display tooltips in a balloon style
window (actually a frame), similarly to the windows xp balloon help. There is
also an arrow that points to the center of the control designed as a "target"
for the BalloonTip.

What it can do:

- Set the balloon shape as a rectangle or a rounded rectangle;
- Set an icon to the top-left of the BalloonTip frame;
- Set a title at the top of the BalloonTip frame;
- Automatic "best" placement of BalloonTip frame depending on the target
  control/window position;
- Runtime customization of title/tip fonts and foreground colours;
- Runtime change of BalloonTip frame shape;
- Set the balloon background colour;
- Possibility to set the delay after which the BalloonTip is displayed;
- Possibility to set the delay after which the BalloonTip is destroyed;
- Three different behaviors for the BalloonTip window (regardless the delay
  destruction time set):
  a) Destroy by leave: the BalloonTip is destroyed when the mouse leaves the
     target control/window;
  b) Destroy by click: the BalloonTip is destroyed when you click on any area
     of the target control/window;
  c) Destroy by button: the BalloonTip is destroyed when you click on the
     top-right close button;
- Possibility to enable/disable globally the BalloonTip on you application.
- Set the BalloonTip also for the taskbaricon (revised 7 september 2005)


Usage example:

# let's suppose that in your application you have a wx.TextCtrl defined as:

mytextctrl = wx.TextCtrl(panel, -1, "i am a textctrl")

# you can define your BalloonTip as follows:

tipballoon = BalloonTip(topicon=None, toptitle="textctrl",
                        message="this is a textctrl",
                        shape=BT_ROUNDED,
                        tipstyle=BT_LEAVE)

# set the BalloonTip target
tipballoon.SetTarget(mytextctrl)
# set the BalloonTip background colour
tipballoon.SetBalloonColour(wx.white)
# set the font for the balloon title
tipballoon.SetTitleFont(wx.Font(9, wx.SWISS, wx.NORMAL, wx.BOLD, False))
# set the colour for the balloon title
tipballoon.SetTitleColour(wx.BLACK)
# leave the message font as default
tipballoon.SetMessageFont()
# set the message (tip) foreground colour
tipballoon.SetMessageColour(wx.LIGHT_GREY)
# set the start delay for the BalloonTip
tipballoon.SetStartDelay(1000)
# set the time after which the BalloonTip is destroyed
tipballoon.SetEndDelay(3000)


BalloonTip is freeware and distributed under the wxPython license.

Latest revision: Andrea Gavana @ 15 Oct 2008, 10.00 GMT
Version 0.1

Classes
BalloonFrame  
BalloonTip  

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:55:02 2009 http://epydoc.sf.net