tooltip.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/tooltip.h
  3. // Purpose: wxToolTip class
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKTOOLTIPH__
  9. #define __GTKTOOLTIPH__
  10. #include "wx/defs.h"
  11. #include "wx/string.h"
  12. #include "wx/object.h"
  13. //-----------------------------------------------------------------------------
  14. // forward declarations
  15. //-----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_FWD_CORE wxToolTip;
  17. class WXDLLIMPEXP_FWD_CORE wxWindow;
  18. //-----------------------------------------------------------------------------
  19. // wxToolTip
  20. //-----------------------------------------------------------------------------
  21. class WXDLLIMPEXP_CORE wxToolTip : public wxObject
  22. {
  23. public:
  24. // globally change the tooltip parameters
  25. static void Enable( bool flag );
  26. static void SetDelay( long msecs );
  27. // set the delay after which the tooltip disappears or how long the tooltip remains visible
  28. static void SetAutoPop(long msecs);
  29. // set the delay between subsequent tooltips to appear
  30. static void SetReshow(long msecs);
  31. wxToolTip( const wxString &tip );
  32. // get/set the tooltip text
  33. void SetTip( const wxString &tip );
  34. wxString GetTip() const { return m_text; }
  35. wxWindow *GetWindow() const { return m_window; }
  36. bool IsOk() const { return m_window != NULL; }
  37. // implementation
  38. void Apply( wxWindow *win );
  39. private:
  40. wxString m_text;
  41. wxWindow *m_window;
  42. DECLARE_ABSTRACT_CLASS(wxToolTip)
  43. };
  44. #endif // __GTKTOOLTIPH__