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 license
11 ///////////////////////////////////////////////////////////////////////////////
16 #if defined(__GNUG__) && !defined(__APPLE__)
17 #pragma interface "tipwin.h"
23 #include "wx/popupwin.h"
25 #define wxTipWindowBase wxPopupTransientWindow
29 #define wxTipWindowBase wxFrame
32 class WXDLLEXPORT wxTipWindowView
;
34 // ----------------------------------------------------------------------------
36 // ----------------------------------------------------------------------------
38 class WXDLLEXPORT wxTipWindow
: public wxTipWindowBase
41 // the mandatory ctor parameters are: the parent window and the text to
44 // optionally you may also specify the length at which the lines are going
45 // to be broken in rows (100 pixels by default)
47 // windowPtr and rectBound are just passed to SetTipWindowPtr() and
48 // SetBoundingRect() - see below
49 wxTipWindow(wxWindow
*parent
,
51 wxCoord maxLength
= 100,
52 wxTipWindow
** windowPtr
= NULL
,
53 wxRect
*rectBound
= NULL
);
55 virtual ~wxTipWindow();
57 // If windowPtr is not NULL the given address will be NULLed when the
59 void SetTipWindowPtr(wxTipWindow
** windowPtr
) { m_windowPtr
= windowPtr
; }
61 // If rectBound is not NULL, the window will disappear automatically when
62 // the mouse leave the specified rect: note that rectBound should be in the
63 // screen coordinates!
64 void SetBoundingRect(const wxRect
& rectBound
);
66 // Hide and destroy the window
70 // called by wxTipWindowView only
71 bool CheckMouseInBounds(const wxPoint
& pos
);
74 void OnMouseClick(wxMouseEvent
& event
);
77 void OnActivate(wxActivateEvent
& event
);
78 void OnKillFocus(wxFocusEvent
& event
);
79 #else // wxUSE_POPUPWIN
80 virtual void OnDismiss();
81 #endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN
84 wxArrayString m_textLines
;
87 wxTipWindowView
*m_view
;
89 wxTipWindow
** m_windowPtr
;
94 friend class wxTipWindowView
;
96 DECLARE_NO_COPY_CLASS(wxTipWindow
)
99 #endif // wxUSE_TIPWINDOW
101 #endif // _WX_TIPWIN_H_