]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: tipwin.h | |
3 | // Purpose: interface of wxTipWindow | |
4 | // Author: wxWidgets team | |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxTipWindow | |
11 | ||
12 | Shows simple text in a popup tip window on creation. This is used by | |
13 | wxSimpleHelpProvider to show popup help. The | |
14 | window automatically destroys itself when the user clicks on it or it loses the | |
15 | focus. | |
16 | ||
17 | You may also use this class to emulate the tooltips when you need finer | |
18 | control over them than what the standard tooltips provide. | |
19 | ||
20 | @library{wxcore} | |
21 | @category{managedwnd} | |
22 | */ | |
23 | class wxTipWindow : public wxWindow | |
24 | { | |
25 | public: | |
26 | /** | |
27 | Constructor. The tip is shown immediately after the window is constructed. | |
28 | ||
29 | @param parent | |
30 | The parent window, must be non-@NULL | |
31 | @param text | |
32 | The text to show, may contain the new line characters | |
33 | @param maxLength | |
34 | The length of each line, in pixels. Set to a very large | |
35 | value to avoid wrapping lines | |
36 | @param windowPtr | |
37 | Simply passed to | |
38 | SetTipWindowPtr below, please see its | |
39 | documentation for the description of this parameter | |
40 | @param rectBounds | |
41 | If non-@NULL, passed to | |
42 | SetBoundingRect below, please see its | |
43 | documentation for the description of this parameter | |
44 | */ | |
45 | wxTipWindow(wxWindow* parent, const wxString& text, | |
46 | wxCoord maxLength = 100, | |
47 | wxTipWindow** windowPtr = NULL, | |
48 | wxRect* rectBounds = NULL); | |
49 | ||
50 | /** | |
51 | By default, the tip window disappears when the user clicks the mouse or presses | |
52 | a keyboard key or if it loses focus in any other way - for example because the | |
53 | user switched to another application window. | |
54 | Additionally, if a non-empty @a rectBound is provided, the tip window will | |
55 | also automatically close if the mouse leaves this area. This is useful to | |
56 | dismiss the tip mouse when the mouse leaves the object it is associated with. | |
57 | ||
58 | @param rectBound | |
59 | The bounding rectangle for the mouse in the screen coordinates | |
60 | */ | |
61 | void SetBoundingRect(const wxRect& rectBound); | |
62 | ||
63 | /** | |
64 | When the tip window closes itself (which may happen at any moment and | |
65 | unexpectedly to the caller) it may @NULL out the pointer pointed to by | |
66 | @e it windowPtr. This is helpful to avoid dereferencing the tip window which | |
67 | had been already closed and deleted. | |
68 | */ | |
69 | void SetTipWindowPtr(wxTipWindow** windowPtr); | |
70 | }; | |
71 |