tooltip.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/tooltip.h
  3. // Purpose: wxToolTip class - tooltip control
  4. // Author: Ryan Norton
  5. // Modified by:
  6. // Created: 31.01.99
  7. // Copyright: (c) Ryan Norton
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_COCOA_TOOLTIP_H_
  11. #define _WX_COCOA_TOOLTIP_H_
  12. #include "wx/object.h"
  13. class wxWindow;
  14. class 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;
  24. // the window we're associated with
  25. wxWindow *GetWindow() const;
  26. // controlling tooltip behaviour: globally change tooltip parameters
  27. // enable or disable the tooltips globally
  28. static void Enable(bool flag);
  29. // set the delay after which the tooltip appears
  30. static void SetDelay(long milliseconds);
  31. // set the delay after which the tooltip disappears or how long the tooltip remains visible
  32. static void SetAutoPop(long milliseconds);
  33. // set the delay between subsequent tooltips to appear
  34. static void SetReshow(long milliseconds);
  35. private:
  36. void SetWindow(wxWindow* window);
  37. friend class wxWindow;
  38. wxString m_text; // tooltip text
  39. wxWindow *m_window; // window we're associated with
  40. DECLARE_ABSTRACT_CLASS(wxToolTip)
  41. };
  42. #endif // _WX_COCOA_TOOLTIP_H_