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 ///////////////////////////////////////////////////////////////////////////////
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "tipwin.h"
23 #include "wx/popupwin.h"
25 #define wxTipWindowBase wxPopupTransientWindow
29 #define wxTipWindowBase wxFrame
31 #include "wx/arrstr.h"
33 class WXDLLEXPORT wxTipWindowView
;
35 // ----------------------------------------------------------------------------
37 // ----------------------------------------------------------------------------
39 class WXDLLEXPORT wxTipWindow
: public wxTipWindowBase
42 // the mandatory ctor parameters are: the parent window and the text to
45 // optionally you may also specify the length at which the lines are going
46 // to be broken in rows (100 pixels by default)
48 // windowPtr and rectBound are just passed to SetTipWindowPtr() and
49 // SetBoundingRect() - see below
50 wxTipWindow(wxWindow
*parent
,
52 wxCoord maxLength
= 100,
53 wxTipWindow
** windowPtr
= NULL
,
54 wxRect
*rectBound
= NULL
);
56 virtual ~wxTipWindow();
58 // If windowPtr is not NULL the given address will be NULLed when the
60 void SetTipWindowPtr(wxTipWindow
** windowPtr
) { m_windowPtr
= windowPtr
; }
62 // If rectBound is not NULL, the window will disappear automatically when
63 // the mouse leave the specified rect: note that rectBound should be in the
64 // screen coordinates!
65 void SetBoundingRect(const wxRect
& rectBound
);
67 // Hide and destroy the window
71 // called by wxTipWindowView only
72 bool CheckMouseInBounds(const wxPoint
& pos
);
75 void OnMouseClick(wxMouseEvent
& event
);
78 void OnActivate(wxActivateEvent
& event
);
79 void OnKillFocus(wxFocusEvent
& event
);
80 #else // wxUSE_POPUPWIN
81 virtual void OnDismiss();
82 #endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN
85 wxArrayString m_textLines
;
88 wxTipWindowView
*m_view
;
90 wxTipWindow
** m_windowPtr
;
95 friend class wxTipWindowView
;
97 DECLARE_NO_COPY_CLASS(wxTipWindow
)
100 #endif // wxUSE_TIPWINDOW
102 #endif // _WX_TIPWIN_H_