1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTipWindow is a window like the one typically used for
4 // showing the tooltips
5 // Author: Vadim Zeitlin
9 // Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
19 #include "wx/popupwin.h"
21 #define wxTipWindowBase wxPopupTransientWindow
25 #define wxTipWindowBase wxFrame
27 #include "wx/arrstr.h"
29 class WXDLLIMPEXP_FWD_CORE wxTipWindowView
;
31 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
35 class WXDLLIMPEXP_CORE wxTipWindow
: public wxTipWindowBase
38 // the mandatory ctor parameters are: the parent window and the text to
41 // optionally you may also specify the length at which the lines are going
42 // to be broken in rows (100 pixels by default)
44 // windowPtr and rectBound are just passed to SetTipWindowPtr() and
45 // SetBoundingRect() - see below
46 wxTipWindow(wxWindow
*parent
,
48 wxCoord maxLength
= 100,
49 wxTipWindow
** windowPtr
= NULL
,
50 wxRect
*rectBound
= NULL
);
52 virtual ~wxTipWindow();
54 // If windowPtr is not NULL the given address will be NULLed when the
56 void SetTipWindowPtr(wxTipWindow
** windowPtr
) { m_windowPtr
= windowPtr
; }
58 // If rectBound is not NULL, the window will disappear automatically when
59 // the mouse leave the specified rect: note that rectBound should be in the
60 // screen coordinates!
61 void SetBoundingRect(const wxRect
& rectBound
);
63 // Hide and destroy the window
67 // called by wxTipWindowView only
68 bool CheckMouseInBounds(const wxPoint
& pos
);
71 void OnMouseClick(wxMouseEvent
& event
);
74 void OnActivate(wxActivateEvent
& event
);
75 void OnKillFocus(wxFocusEvent
& event
);
76 #else // wxUSE_POPUPWIN
77 virtual void OnDismiss();
78 #endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN
81 wxArrayString m_textLines
;
84 wxTipWindowView
*m_view
;
86 wxTipWindow
** m_windowPtr
;
91 friend class wxTipWindowView
;
93 wxDECLARE_NO_COPY_CLASS(wxTipWindow
);
96 #endif // wxUSE_TIPWINDOW
98 #endif // _WX_TIPWIN_H_