tipwin.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: tipwin.h
  3. // Purpose: interface of wxTipWindow
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. @class wxTipWindow
  9. Shows simple text in a popup tip window on creation.
  10. This is used by wxSimpleHelpProvider to show popup help.
  11. The window automatically destroys itself when the user clicks on it or it
  12. loses the focus.
  13. You may also use this class to emulate the tooltips when you need finer
  14. control over them than what the standard tooltips provide.
  15. @library{wxcore}
  16. @category{managedwnd}
  17. */
  18. class wxTipWindow : public wxWindow
  19. {
  20. public:
  21. /**
  22. Constructor. The tip is shown immediately after the window is constructed.
  23. @param parent
  24. The parent window, must be non-@NULL
  25. @param text
  26. The text to show, may contain the new line characters
  27. @param maxLength
  28. The length of each line, in pixels. Set to a very large
  29. value to avoid wrapping lines
  30. @param windowPtr
  31. Simply passed to SetTipWindowPtr() below, please see its
  32. documentation for the description of this parameter
  33. @param rectBounds
  34. If non-@NULL, passed to SetBoundingRect() below, please see its
  35. documentation for the description of this parameter
  36. */
  37. wxTipWindow(wxWindow* parent, const wxString& text,
  38. wxCoord maxLength = 100,
  39. wxTipWindow** windowPtr = NULL,
  40. wxRect* rectBounds = NULL);
  41. /**
  42. By default, the tip window disappears when the user clicks the mouse or presses
  43. a keyboard key or if it loses focus in any other way - for example because the
  44. user switched to another application window.
  45. Additionally, if a non-empty @a rectBound is provided, the tip window will
  46. also automatically close if the mouse leaves this area. This is useful to
  47. dismiss the tip mouse when the mouse leaves the object it is associated with.
  48. @param rectBound
  49. The bounding rectangle for the mouse in the screen coordinates
  50. */
  51. void SetBoundingRect(const wxRect& rectBound);
  52. /**
  53. When the tip window closes itself (which may happen at any moment and
  54. unexpectedly to the caller) it may @NULL out the pointer pointed to by
  55. @a windowPtr. This is helpful to avoid dereferencing the tip window which
  56. had been already closed and deleted.
  57. */
  58. void SetTipWindowPtr(wxTipWindow** windowPtr);
  59. };