]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tooltip.h
1 ///////////////////////////////////////////////////////////////////////////////
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 WXDLLEXPORT wxToolTip
: public wxObject
21 wxToolTip(const wxString
&tip
);
26 void SetTip(const wxString
& tip
);
27 const wxString
& GetTip() const { return m_text
; }
29 // the window we're associated with
30 void SetWindow(wxWindow
*win
);
31 wxWindow
*GetWindow() const { return m_window
; }
33 // controlling tooltip behaviour: globally change tooltip parameters
34 // enable or disable the tooltips globally
35 static void Enable(bool flag
);
36 // set the delay after which the tooltip appears
37 static void SetDelay(long milliseconds
);
39 // implementation only from now on
40 // -------------------------------
42 // should be called in responde to WM_MOUSEMOVE
43 static void RelayEvent(WXMSG
*msg
);
45 // add a window to the tooltip control
46 void Add(WXHWND hwnd
);
48 // remove any tooltip from the window
49 static void Remove(WXHWND hwnd
);
52 // the one and only one tooltip control we use - never access it directly
53 // but use GetToolTipCtrl() which will create it when needed
54 static WXHWND ms_hwndTT
;
56 // create the tooltip ctrl if it doesn't exist yet and return its HWND
57 static WXHWND
GetToolTipCtrl();
59 // remove this tooltip from the tooltip control
62 wxString m_text
; // tooltip text
63 wxWindow
*m_window
; // window we're associated with
65 DECLARE_ABSTRACT_CLASS(wxToolTip
)
66 DECLARE_NO_COPY_CLASS(wxToolTip
)
69 #endif // _WX_MSW_TOOLTIP_H_