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