]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: tooltip.h | |
e54c96f1 | 3 | // Purpose: interface of wxToolTip |
23324ae1 | 4 | // Author: wxWidgets team |
526954c5 | 5 | // Licence: wxWindows licence |
23324ae1 FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
8 | /** | |
9 | @class wxToolTip | |
7c913512 | 10 | |
f992f2ae BP |
11 | This class holds information about a tooltip associated with a window (see |
12 | wxWindow::SetToolTip()). | |
7c913512 | 13 | |
f992f2ae BP |
14 | The four static methods, wxToolTip::Enable(), wxToolTip::SetDelay() |
15 | wxToolTip::SetAutoPop() and wxToolTip::SetReshow() can be used to globally | |
23324ae1 | 16 | alter tooltips behaviour. |
7c913512 | 17 | |
23324ae1 FM |
18 | @library{wxcore} |
19 | @category{help} | |
20 | */ | |
21 | class wxToolTip : public wxObject | |
22 | { | |
23 | public: | |
24 | /** | |
25 | Constructor. | |
26 | */ | |
27 | wxToolTip(const wxString& tip); | |
28 | ||
29 | /** | |
30 | Enable or disable tooltips globally. | |
f992f2ae BP |
31 | |
32 | @note May not be supported on all platforms (eg. wxCocoa). | |
23324ae1 FM |
33 | */ |
34 | static void Enable(bool flag); | |
35 | ||
36 | /** | |
37 | Get the tooltip text. | |
38 | */ | |
328f5751 | 39 | wxString GetTip() const; |
23324ae1 FM |
40 | |
41 | /** | |
42 | Get the associated window. | |
43 | */ | |
328f5751 | 44 | wxWindow* GetWindow() const; |
23324ae1 FM |
45 | |
46 | /** | |
f992f2ae BP |
47 | Set the delay after which the tooltip disappears or how long a tooltip |
48 | remains visible. | |
49 | ||
bd362275 | 50 | @note May not be supported on all platforms (eg. wxCocoa, GTK). |
23324ae1 FM |
51 | */ |
52 | static void SetAutoPop(long msecs); | |
53 | ||
54 | /** | |
55 | Set the delay after which the tooltip appears. | |
f992f2ae BP |
56 | |
57 | @note May not be supported on all platforms (eg. wxCocoa). | |
23324ae1 FM |
58 | */ |
59 | static void SetDelay(long msecs); | |
60 | ||
be8b4385 VZ |
61 | /** |
62 | Set tooltip maximal width in pixels. | |
63 | ||
64 | By default, tooltips are wrapped at a suitably chosen width. You can | |
65 | pass -1 as @a width to disable wrapping them completely, 0 to restore | |
66 | the default behaviour or an arbitrary positive value to wrap them at | |
67 | the given width. | |
68 | ||
69 | Notice that this function does not change the width of the tooltips | |
70 | created before calling it. | |
71 | ||
72 | @note Currently this function is wxMSW-only. | |
73 | */ | |
413eac73 | 74 | static void SetMaxWidth(int width); |
be8b4385 | 75 | |
23324ae1 FM |
76 | /** |
77 | Set the delay between subsequent tooltips to appear. | |
f992f2ae | 78 | |
bd362275 | 79 | @note May not be supported on all platforms (eg. wxCocoa, GTK). |
23324ae1 FM |
80 | */ |
81 | static void SetReshow(long msecs); | |
82 | ||
83 | /** | |
84 | Set the tooltip text. | |
85 | */ | |
86 | void SetTip(const wxString& tip); | |
87 | }; | |
e54c96f1 | 88 |