1999-01-25 08:57:06 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: tooltip.h
|
1999-02-01 09:40:53 -05:00
|
|
|
// Purpose: wxToolTip class
|
1999-01-25 08:57:06 -05:00
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-01-25 08:57:06 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKTOOLTIPH__
|
|
|
|
#define __GTKTOOLTIPH__
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
1999-02-01 09:40:53 -05:00
|
|
|
#include "wx/string.h"
|
1999-01-25 08:57:06 -05:00
|
|
|
#include "wx/object.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
1999-02-01 09:40:53 -05:00
|
|
|
// forward declarations
|
1999-01-25 08:57:06 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxToolTip;
|
|
|
|
class WXDLLIMPEXP_CORE wxWindow;
|
1999-01-25 08:57:06 -05:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxToolTip
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
|
1999-01-25 08:57:06 -05:00
|
|
|
{
|
|
|
|
public:
|
2006-05-04 19:34:10 -04:00
|
|
|
wxToolTip( const wxString &tip );
|
|
|
|
|
1999-02-01 09:40:53 -05:00
|
|
|
// globally change the tooltip parameters
|
1999-02-01 01:44:35 -05:00
|
|
|
static void Enable( bool flag );
|
|
|
|
static void SetDelay( long msecs );
|
1999-01-25 08:57:06 -05:00
|
|
|
|
1999-02-01 09:40:53 -05:00
|
|
|
// get/set the tooltip text
|
|
|
|
void SetTip( const wxString &tip );
|
|
|
|
wxString GetTip() const { return m_text; }
|
|
|
|
|
|
|
|
wxWindow *GetWindow() const { return m_window; }
|
|
|
|
bool IsOk() const { return m_window != NULL; }
|
|
|
|
|
2006-05-04 19:34:10 -04:00
|
|
|
|
|
|
|
// wxGTK-only from now on
|
|
|
|
|
|
|
|
// this forwards back to wxWindow::ApplyToolTip()
|
1999-02-01 09:40:53 -05:00
|
|
|
void Apply( wxWindow *win );
|
|
|
|
|
2006-05-04 19:34:10 -04:00
|
|
|
// this just sets the given tooltip for the specified widget
|
|
|
|
//
|
|
|
|
// tip must be already UTF-8 encoded
|
|
|
|
static void Apply(GtkWidget *w, const wxCharBuffer& tip);
|
|
|
|
|
1999-02-01 09:40:53 -05:00
|
|
|
private:
|
1999-01-27 12:15:34 -05:00
|
|
|
wxString m_text;
|
1999-02-01 01:44:35 -05:00
|
|
|
wxWindow *m_window;
|
2001-07-13 23:23:30 -04:00
|
|
|
|
|
|
|
DECLARE_ABSTRACT_CLASS(wxToolTip)
|
1999-01-25 08:57:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKTOOLTIPH__
|