1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTipWindow is a window like the one typically used for
4 // showing the tooltips
5 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
18 #include "wx/popupwin.h"
20 #define wxTipWindowBase wxPopupTransientWindow
24 #define wxTipWindowBase wxFrame
26 #include "wx/arrstr.h"
28 class WXDLLIMPEXP_FWD_CORE wxTipWindowView
;
30 // ----------------------------------------------------------------------------
32 // ----------------------------------------------------------------------------
34 class WXDLLIMPEXP_CORE wxTipWindow
: public wxTipWindowBase
37 // the mandatory ctor parameters are: the parent window and the text to
40 // optionally you may also specify the length at which the lines are going
41 // to be broken in rows (100 pixels by default)
43 // windowPtr and rectBound are just passed to SetTipWindowPtr() and
44 // SetBoundingRect() - see below
45 wxTipWindow(wxWindow
*parent
,
47 wxCoord maxLength
= 100,
48 wxTipWindow
** windowPtr
= NULL
,
49 wxRect
*rectBound
= NULL
);
51 virtual ~wxTipWindow();
53 // If windowPtr is not NULL the given address will be NULLed when the
55 void SetTipWindowPtr(wxTipWindow
** windowPtr
) { m_windowPtr
= windowPtr
; }
57 // If rectBound is not NULL, the window will disappear automatically when
58 // the mouse leave the specified rect: note that rectBound should be in the
59 // screen coordinates!
60 void SetBoundingRect(const wxRect
& rectBound
);
62 // Hide and destroy the window
66 // called by wxTipWindowView only
67 bool CheckMouseInBounds(const wxPoint
& pos
);
70 void OnMouseClick(wxMouseEvent
& event
);
73 void OnActivate(wxActivateEvent
& event
);
74 void OnKillFocus(wxFocusEvent
& event
);
75 #else // wxUSE_POPUPWIN
76 virtual void OnDismiss();
77 #endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN
80 wxArrayString m_textLines
;
83 wxTipWindowView
*m_view
;
85 wxTipWindow
** m_windowPtr
;
90 friend class wxTipWindowView
;
92 wxDECLARE_NO_COPY_CLASS(wxTipWindow
);
95 #endif // wxUSE_TIPWINDOW
97 #endif // _WX_TIPWIN_H_