xref: /haiku/docs/user/interface/ToolTip.dox (revision 4bd0c1066b227cec4b79883bdef697c7a27f2e90)
1/*
2 * Copyright 2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Adrien Destugues, pulkomandy@pulkomandy.ath.cx
7 *		Axel Dörfler, axeld@pinc-software.de
8 *		John Scipione, jscipione@gmail.com
9 *
10 * Corresponds to:
11 *		headers/private/interface/ToolTip.h	hrev48560
12 *		src/kits/interface/ToolTip.cpp	hrev48560
13 */
14
15
16/*!
17	\file ToolTip.h
18	\ingroup interface
19	\ingroup libbe
20	\brief Provides the BToolTip class.
21*/
22
23
24/*!
25	\class BToolTip
26	\ingroup interface
27	\ingroup libbe
28	\brief Displays help text on hover.
29
30	\attention Use at your own risk! This class is private and may change
31	           before release.
32
33	This class is for advanced uses of tool tips with custom contents or
34	behavior. The simple way to use tooltips is via BView::SetToolTip().
35
36	\since Haiku R1
37*/
38
39
40/*!
41	\fn BToolTip::BToolTip()
42	\brief Creates a new BToolTip object.
43
44	\since Haiku R1
45*/
46
47
48/*!
49	\fn BToolTip::BToolTip(BMessage* archive)
50	\brief Creates a BToolTip object from the passed in \a archive.
51
52	\since Haiku R1
53*/
54
55
56/*!
57	\fn BToolTip::~BToolTip()
58	\brief Frees the memory allocated and destroys the object.
59
60	\since Haiku R1
61*/
62
63
64/*!
65	\fn status_t BToolTip::Archive(BMessage* archive, bool deep) const
66	\brief Archives the object into the \a data message.
67
68	Saves the tool tip's sticky flag.
69
70	\param archive A pointer to the BMessage object to archive the object into.
71	\param deep Whether or not to archive child views as well.
72
73	\return A status code, \c B_OK if everything went well or an error code
74	        otherwise.
75	\retval B_OK The object was archived.
76	\retval B_NO_MEMORY Ran out of memory while archiving the object.
77
78	\since Haiku R1
79*/
80
81
82/*!
83	\fn void BToolTip::SetSticky(bool enable)
84	\brief Turns sticky flag on or off which determines whether or not the
85	       tool tip stays visible when the mouse moves.
86
87	\since Haiku R1
88*/
89
90
91/*!
92	\fn bool BToolTip::IsSticky() const
93	\brief Returns whether or not the sticky flag is set.
94
95	\since Haiku R1
96*/
97
98
99/*!
100	\fn void BToolTip::SetMouseRelativeLocation(BPoint location)
101	\brief Set the location of the tooltip relative to the current mouse position.
102
103	The position is relative to the mouse cursor location at the time the
104	tool tip is shown. It should be as close as possible to the mouse cursor
105	without hiding important parts of the UI near the cursor while the parent
106	view remains visible and reachable.
107
108	\since Haiku R1
109*/
110
111
112/*!
113	\fn BPoint BToolTip::MouseRelativeLocation() const
114	\brief Returns the tool tip's relative mouse location.
115
116	\since Haiku R1
117*/
118
119
120/*!
121	\fn void BToolTip::SetAlignment(BAlignment alignment)
122	\brief Set the alignment of the tool tip which determines where the tool
123	       tip should appear i.e. left or right from the current mouse cursor
124	       position, etc.
125
126	\since Haiku R1
127*/
128
129
130/*!
131	\fn BAlignment BToolTip::Alignment() const
132	\brief Returns the tool tip's alignment.
133
134	\since Haiku R1
135*/
136
137
138/*!
139	\fn bool BToolTip::Lock()
140	\brief Allows derived classes to lock the tool tip while modifying it.
141
142	\since Haiku R1
143*/
144
145
146/*!
147	\fn void BToolTip::Unlock()
148	\brief Allows derived classes to unlock the tool tip.
149
150	\since Haiku R1
151*/
152