]> git.saurik.com Git - wxWidgets.git/blob - include/wx/tipwin.h
ce4e3ec69a60a153837749549a0d9b2fec8dcecd
[wxWidgets.git] / include / wx / tipwin.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/tipwin.h
3 // Purpose: wxTipWindow is a window like the one typically used for
4 // showing the tooltips
5 // Author: Vadim Zeitlin
6 // Modified by:
7 // Created: 10.09.00
8 // RCS-ID: $Id$
9 // Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
10 // Licence: wxWindows license
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_TIPWIN_H_
14 #define _WX_TIPWIN_H_
15
16 #ifdef __GNUG__
17 #pragma interface "tipwin.h"
18 #endif
19
20 #include "wx/popupwin.h"
21
22 #if wxUSE_POPUPWIN
23 // ----------------------------------------------------------------------------
24 // wxTipWindow
25 // ----------------------------------------------------------------------------
26
27 class WXDLLEXPORT wxTipWindow : public wxPopupTransientWindow
28 {
29 public:
30 // Supply windowPtr for it to null the given address
31 // when the window has closed.
32 wxTipWindow(wxWindow *parent,
33 const wxString& text,
34 wxCoord maxLength = 100, wxTipWindow** windowPtr = NULL);
35 ~wxTipWindow();
36
37 void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }
38
39 // calculate the client rect we need to display the text
40 void Adjust(const wxString& text, wxCoord maxLength);
41
42 void Close();
43
44 protected:
45 // event handlers
46 void OnMouseClick(wxMouseEvent& event);
47 void OnPaint(wxPaintEvent& event);
48
49 private:
50 wxArrayString m_textLines;
51 wxCoord m_heightLine;
52 wxTipWindow** m_windowPtr;
53
54 DECLARE_EVENT_TABLE()
55 };
56
57 #endif // wxUSE_POPUPWIN
58 #endif // _WX_TIPWIN_H_