]>
Commit | Line | Data |
---|---|---|
3a19e16d VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: msw/tooltip.h | |
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 | ||
6f4968e2 | 15 | class WXDLLEXPORT wxToolTip : public wxObject |
3a19e16d VZ |
16 | { |
17 | public: | |
18 | // ctor & dtor | |
19 | wxToolTip(const wxString &tip); | |
20 | virtual ~wxToolTip(); | |
21 | ||
22 | // accessors | |
23 | // tip text | |
24 | void SetTip(const wxString& tip); | |
25 | const wxString& GetTip() const { return m_text; } | |
26 | ||
27 | // the window we're associated with | |
28 | void SetWindow(wxWindow *win); | |
29 | wxWindow *GetWindow() const { return m_window; } | |
30 | ||
16f6dfd8 | 31 | // controlling tooltip behaviour: globally change tooltip parameters |
3a19e16d | 32 | // enable or disable the tooltips globally |
16f6dfd8 | 33 | static void Enable(bool flag); |
3a19e16d | 34 | // set the delay after which the tooltip appears |
16f6dfd8 | 35 | static void SetDelay(long milliseconds); |
3a19e16d | 36 | |
8614c467 VZ |
37 | // implementation only from now on |
38 | // ------------------------------- | |
39 | ||
40 | // should be called in responde to WM_MOUSEMOVE | |
3a19e16d VZ |
41 | void RelayEvent(WXMSG *msg); |
42 | ||
1306e7d6 VZ |
43 | // add a window to the tooltip control |
44 | void Add(WXHWND hwnd); | |
45 | ||
3a19e16d | 46 | private: |
8614c467 VZ |
47 | // the one and only one tooltip control we use - never access it directly |
48 | // but use GetToolTipCtrl() which will create it when needed | |
f048e32f VZ |
49 | static WXHWND ms_hwndTT; |
50 | ||
51 | // create the tooltip ctrl if it doesn't exist yet and return its HWND | |
8614c467 | 52 | static WXHWND GetToolTipCtrl(); |
3a19e16d VZ |
53 | |
54 | // remove this tooltip from the tooltip control | |
55 | void Remove(); | |
56 | ||
57 | wxString m_text; // tooltip text | |
58 | wxWindow *m_window; // window we're associated with | |
b342f8f0 RD |
59 | |
60 | DECLARE_ABSTRACT_CLASS(wxToolTip) | |
22f3361e | 61 | DECLARE_NO_COPY_CLASS(wxToolTip) |
3a19e16d | 62 | }; |
d098a357 | 63 | |
20ceebaa | 64 | #endif // _WX_MSW_TOOLTIP_H_ |