tooltip.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/tooltip.h
  3. // Purpose: wxToolTip class - tooltip control
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 31.01.99
  7. // Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin, Stefan Csomor
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_MAC_TOOLTIP_H_
  11. #define _WX_MAC_TOOLTIP_H_
  12. #include "wx/string.h"
  13. #include "wx/event.h"
  14. class WXDLLIMPEXP_CORE wxToolTip : public wxObject
  15. {
  16. public:
  17. // ctor & dtor
  18. wxToolTip(const wxString &tip);
  19. virtual ~wxToolTip();
  20. // accessors
  21. // tip text
  22. void SetTip(const wxString& tip);
  23. const wxString& GetTip() const { return m_text; }
  24. // the window we're associated with
  25. void SetWindow(wxWindow *win);
  26. wxWindow *GetWindow() const { return m_window; }
  27. // controlling tooltip behaviour: globally change tooltip parameters
  28. // enable or disable the tooltips globally
  29. static void Enable(bool flag);
  30. // set the delay after which the tooltip appears
  31. static void SetDelay(long milliseconds);
  32. // set the delay after which the tooltip disappears or how long the tooltip remains visible
  33. static void SetAutoPop(long milliseconds);
  34. // set the delay between subsequent tooltips to appear
  35. static void SetReshow(long milliseconds);
  36. static void NotifyWindowDelete( WXHWND win ) ;
  37. // implementation only from now on
  38. // -------------------------------
  39. // should be called in response to mouse events
  40. static void RelayEvent(wxWindow *win , wxMouseEvent &event);
  41. static void RemoveToolTips();
  42. private:
  43. wxString m_text; // tooltip text
  44. wxWindow *m_window; // window we're associated with
  45. DECLARE_ABSTRACT_CLASS(wxToolTip)
  46. };
  47. #endif // _WX_MAC_TOOLTIP_H_