1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/tooltip.h
3 // Purpose: wxToolTip class - tooltip control
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1999 Robert Roebling, Vadim Zeitlin
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_MSW_TOOLTIP_H_
13 #define _WX_MSW_TOOLTIP_H_
15 #include "wx/object.h"
17 class WXDLLIMPEXP_CORE wxWindow
;
19 class WXDLLEXPORT wxToolTip
: public wxObject
23 wxToolTip(const wxString
&tip
);
28 void SetTip(const wxString
& tip
);
29 const wxString
& GetTip() const { return m_text
; }
31 // the window we're associated with
32 void SetWindow(wxWindow
*win
);
33 wxWindow
*GetWindow() const { return m_window
; }
35 // controlling tooltip behaviour: globally change tooltip parameters
36 // enable or disable the tooltips globally
37 static void Enable(bool flag
);
38 // set the delay after which the tooltip appears
39 static void SetDelay(long milliseconds
);
41 // implementation only from now on
42 // -------------------------------
44 // should be called in responde to WM_MOUSEMOVE
45 static void RelayEvent(WXMSG
*msg
);
47 // add a window to the tooltip control
48 void Add(WXHWND hwnd
);
50 // remove any tooltip from the window
51 static void Remove(WXHWND hwnd
);
54 // the one and only one tooltip control we use - never access it directly
55 // but use GetToolTipCtrl() which will create it when needed
56 static WXHWND ms_hwndTT
;
58 // create the tooltip ctrl if it doesn't exist yet and return its HWND
59 static WXHWND
GetToolTipCtrl();
61 // remove this tooltip from the tooltip control
64 wxString m_text
; // tooltip text
65 wxWindow
*m_window
; // window we're associated with
67 DECLARE_ABSTRACT_CLASS(wxToolTip
)
68 DECLARE_NO_COPY_CLASS(wxToolTip
)
71 #endif // _WX_MSW_TOOLTIP_H_