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