2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tipwin.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxTipWindow
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxTipWindow
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-04 07:55:28 -04:00
|
|
|
Shows simple text in a popup tip window on creation.
|
|
|
|
This is used by wxSimpleHelpProvider to show popup help.
|
|
|
|
The window automatically destroys itself when the user clicks on it or it
|
|
|
|
loses the focus.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
You may also use this class to emulate the tooltips when you need finer
|
|
|
|
control over them than what the standard tooltips provide.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{managedwnd}
|
|
|
|
*/
|
|
|
|
class wxTipWindow : public wxWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor. The tip is shown immediately after the window is constructed.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
The parent window, must be non-@NULL
|
2008-03-08 09:43:31 -05:00
|
|
|
@param text
|
2008-03-09 08:33:59 -04:00
|
|
|
The text to show, may contain the new line characters
|
2008-03-08 09:43:31 -05:00
|
|
|
@param maxLength
|
2008-03-09 08:33:59 -04:00
|
|
|
The length of each line, in pixels. Set to a very large
|
|
|
|
value to avoid wrapping lines
|
2008-03-08 09:43:31 -05:00
|
|
|
@param windowPtr
|
2008-10-04 07:55:28 -04:00
|
|
|
Simply passed to SetTipWindowPtr() below, please see its
|
2008-03-09 08:33:59 -04:00
|
|
|
documentation for the description of this parameter
|
2008-03-08 09:43:31 -05:00
|
|
|
@param rectBounds
|
2008-10-04 07:55:28 -04:00
|
|
|
If non-@NULL, passed to SetBoundingRect() below, please see its
|
2008-03-09 08:33:59 -04:00
|
|
|
documentation for the description of this parameter
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
wxTipWindow(wxWindow* parent, const wxString& text,
|
|
|
|
wxCoord maxLength = 100,
|
2008-03-25 08:22:08 -04:00
|
|
|
wxTipWindow** windowPtr = NULL,
|
2008-03-09 08:33:59 -04:00
|
|
|
wxRect* rectBounds = NULL);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
By default, the tip window disappears when the user clicks the mouse or presses
|
|
|
|
a keyboard key or if it loses focus in any other way - for example because the
|
|
|
|
user switched to another application window.
|
2008-10-04 07:55:28 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
Additionally, if a non-empty @a rectBound is provided, the tip window will
|
2008-03-08 08:52:38 -05:00
|
|
|
also automatically close if the mouse leaves this area. This is useful to
|
|
|
|
dismiss the tip mouse when the mouse leaves the object it is associated with.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param rectBound
|
2008-03-09 08:33:59 -04:00
|
|
|
The bounding rectangle for the mouse in the screen coordinates
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void SetBoundingRect(const wxRect& rectBound);
|
|
|
|
|
|
|
|
/**
|
|
|
|
When the tip window closes itself (which may happen at any moment and
|
2008-03-08 09:43:31 -05:00
|
|
|
unexpectedly to the caller) it may @NULL out the pointer pointed to by
|
2008-10-04 07:55:28 -04:00
|
|
|
@a windowPtr. This is helpful to avoid dereferencing the tip window which
|
2008-03-08 08:52:38 -05:00
|
|
|
had been already closed and deleted.
|
|
|
|
*/
|
|
|
|
void SetTipWindowPtr(wxTipWindow** windowPtr);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|