]>
Commit | Line | Data |
---|---|---|
3a19e16d | 1 | /////////////////////////////////////////////////////////////////////////////// |
623d5f80 | 2 | // Name: wx/msw/tooltip.h |
3a19e16d VZ |
3 | // Purpose: wxToolTip class - tooltip control |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 31.01.99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin | |
65571936 | 9 | // Licence: wxWindows licence |
3a19e16d VZ |
10 | /////////////////////////////////////////////////////////////////////////////// |
11 | ||
20ceebaa MW |
12 | #ifndef _WX_MSW_TOOLTIP_H_ |
13 | #define _WX_MSW_TOOLTIP_H_ | |
14 | ||
4a6b1d28 VZ |
15 | #include "wx/object.h" |
16 | ||
b5dbe15d | 17 | class WXDLLIMPEXP_FWD_CORE wxWindow; |
623d5f80 | 18 | |
6f4968e2 | 19 | class WXDLLEXPORT wxToolTip : public wxObject |
3a19e16d VZ |
20 | { |
21 | public: | |
22 | // ctor & dtor | |
23 | wxToolTip(const wxString &tip); | |
24 | virtual ~wxToolTip(); | |
25 | ||
26 | // accessors | |
27 | // tip text | |
28 | void SetTip(const wxString& tip); | |
29 | const wxString& GetTip() const { return m_text; } | |
30 | ||
31 | // the window we're associated with | |
32 | void SetWindow(wxWindow *win); | |
33 | wxWindow *GetWindow() const { return m_window; } | |
34 | ||
16f6dfd8 | 35 | // controlling tooltip behaviour: globally change tooltip parameters |
3a19e16d | 36 | // enable or disable the tooltips globally |
16f6dfd8 | 37 | static void Enable(bool flag); |
3a19e16d | 38 | // set the delay after which the tooltip appears |
16f6dfd8 | 39 | static void SetDelay(long milliseconds); |
3a19e16d | 40 | |
8614c467 VZ |
41 | // implementation only from now on |
42 | // ------------------------------- | |
43 | ||
44 | // should be called in responde to WM_MOUSEMOVE | |
4453b38d | 45 | static void RelayEvent(WXMSG *msg); |
3a19e16d | 46 | |
1306e7d6 VZ |
47 | // add a window to the tooltip control |
48 | void Add(WXHWND hwnd); | |
49 | ||
0c5405b7 VZ |
50 | // remove any tooltip from the window |
51 | static void Remove(WXHWND hwnd); | |
52 | ||
3a19e16d | 53 | private: |
8614c467 VZ |
54 | // the one and only one tooltip control we use - never access it directly |
55 | // but use GetToolTipCtrl() which will create it when needed | |
f048e32f VZ |
56 | static WXHWND ms_hwndTT; |
57 | ||
58 | // create the tooltip ctrl if it doesn't exist yet and return its HWND | |
8614c467 | 59 | static WXHWND GetToolTipCtrl(); |
3a19e16d VZ |
60 | |
61 | // remove this tooltip from the tooltip control | |
62 | void Remove(); | |
63 | ||
64 | wxString m_text; // tooltip text | |
65 | wxWindow *m_window; // window we're associated with | |
b342f8f0 RD |
66 | |
67 | DECLARE_ABSTRACT_CLASS(wxToolTip) | |
22f3361e | 68 | DECLARE_NO_COPY_CLASS(wxToolTip) |
3a19e16d | 69 | }; |
d098a357 | 70 | |
20ceebaa | 71 | #endif // _WX_MSW_TOOLTIP_H_ |