2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tooltip.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxToolTip
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxToolTip
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-08 16:46:34 -04:00
|
|
|
This class holds information about a tooltip associated with a window (see
|
|
|
|
wxWindow::SetToolTip()).
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-05-08 16:46:34 -04:00
|
|
|
The four static methods, wxToolTip::Enable(), wxToolTip::SetDelay()
|
|
|
|
wxToolTip::SetAutoPop() and wxToolTip::SetReshow() can be used to globally
|
2008-03-08 08:52:38 -05:00
|
|
|
alter tooltips behaviour.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{help}
|
|
|
|
*/
|
|
|
|
class wxToolTip : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxToolTip(const wxString& tip);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Enable or disable tooltips globally.
|
2008-05-08 16:46:34 -04:00
|
|
|
|
|
|
|
@note May not be supported on all platforms (eg. wxCocoa).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void Enable(bool flag);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Get the tooltip text.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxString GetTip() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the associated window.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxWindow* GetWindow() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-05-08 16:46:34 -04:00
|
|
|
Set the delay after which the tooltip disappears or how long a tooltip
|
|
|
|
remains visible.
|
|
|
|
|
|
|
|
@note May not be supported on all platforms (eg. wxCocoa, GTK, Palmos).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void SetAutoPop(long msecs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the delay after which the tooltip appears.
|
2008-05-08 16:46:34 -04:00
|
|
|
|
|
|
|
@note May not be supported on all platforms (eg. wxCocoa).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void SetDelay(long msecs);
|
|
|
|
|
2009-01-23 08:26:20 -05:00
|
|
|
/**
|
|
|
|
Set tooltip maximal width in pixels.
|
|
|
|
|
|
|
|
By default, tooltips are wrapped at a suitably chosen width. You can
|
|
|
|
pass -1 as @a width to disable wrapping them completely, 0 to restore
|
|
|
|
the default behaviour or an arbitrary positive value to wrap them at
|
|
|
|
the given width.
|
|
|
|
|
|
|
|
Notice that this function does not change the width of the tooltips
|
|
|
|
created before calling it.
|
|
|
|
|
|
|
|
@note Currently this function is wxMSW-only.
|
|
|
|
*/
|
2009-02-01 14:56:06 -05:00
|
|
|
static void SetMaxWidth(int width);
|
2009-01-23 08:26:20 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Set the delay between subsequent tooltips to appear.
|
2008-05-08 16:46:34 -04:00
|
|
|
|
|
|
|
@note May not be supported on all platforms (eg. wxCocoa, GTK, Palmos).
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
static void SetReshow(long msecs);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the tooltip text.
|
|
|
|
*/
|
|
|
|
void SetTip(const wxString& tip);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|