]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/tooltip.h
Final and global PRIOR/NEXT change: keep consistency using only PAGE versions, deprec...
[wxWidgets.git] / include / wx / msw / tooltip.h
... / ...
CommitLineData
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
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_MSW_TOOLTIP_H_
13#define _WX_MSW_TOOLTIP_H_
14
15#include "wx/object.h"
16
17class WXDLLEXPORT wxToolTip : public wxObject
18{
19public:
20 // ctor & dtor
21 wxToolTip(const wxString &tip);
22 virtual ~wxToolTip();
23
24 // accessors
25 // tip text
26 void SetTip(const wxString& tip);
27 const wxString& GetTip() const { return m_text; }
28
29 // the window we're associated with
30 void SetWindow(wxWindow *win);
31 wxWindow *GetWindow() const { return m_window; }
32
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);
38
39 // implementation only from now on
40 // -------------------------------
41
42 // should be called in responde to WM_MOUSEMOVE
43 void RelayEvent(WXMSG *msg);
44
45 // add a window to the tooltip control
46 void Add(WXHWND hwnd);
47
48private:
49 // the one and only one tooltip control we use - never access it directly
50 // but use GetToolTipCtrl() which will create it when needed
51 static WXHWND ms_hwndTT;
52
53 // create the tooltip ctrl if it doesn't exist yet and return its HWND
54 static WXHWND GetToolTipCtrl();
55
56 // remove this tooltip from the tooltip control
57 void Remove();
58
59 wxString m_text; // tooltip text
60 wxWindow *m_window; // window we're associated with
61
62 DECLARE_ABSTRACT_CLASS(wxToolTip)
63 DECLARE_NO_COPY_CLASS(wxToolTip)
64};
65
66#endif // _WX_MSW_TOOLTIP_H_