xref: /haiku/docs/user/interface/Box.dox (revision 47852bff02be873c48ec9399e7cc119502bb8c67)
16ec25bbaSAdrien Destugues/*
2819863d8SJohn Scipione * Copyright 2011 Haiku, Inc. All rights reserved.
3820dca4dSJohn Scipione * Distributed under the terms of the MIT License.
46ec25bbaSAdrien Destugues *
5820dca4dSJohn Scipione * Authors:
66ec25bbaSAdrien Destugues *		Clark Gaeble
76ec25bbaSAdrien Destugues *		Adrien Destugues <pulkomandy@pulkomandy.ath.cx>
8a33f8fbdSAdrien Destugues *		John Scipione <jscipione@gmail.com>
9820dca4dSJohn Scipione *
106ec25bbaSAdrien Destugues * Corresponds to:
11131261d2SJohn Scipione *		headers/os/interface/Box.h	 rev 42274
12131261d2SJohn Scipione *		src/kits/interface/Box.cpp	 rev 42274
13a33f8fbdSAdrien Destugues
146ec25bbaSAdrien Destugues
156ec25bbaSAdrien Destugues/*!
166ec25bbaSAdrien Destugues	\file Box.h
17820dca4dSJohn Scipione	\ingroup interface
18820dca4dSJohn Scipione	\ingroup libbe
196ec25bbaSAdrien Destugues	\brief Defines the BBox class
206ec25bbaSAdrien Destugues*/
216ec25bbaSAdrien Destugues
22a33f8fbdSAdrien Destugues
23a33f8fbdSAdrien Destugues/*!
24a33f8fbdSAdrien Destugues	\class BBox
256ec25bbaSAdrien Destugues	\ingroup interface
26820dca4dSJohn Scipione	\ingroup libbe
276ac7032dSJohn Scipione	\brief A rectangular view with a border and an optional label to group
286ac7032dSJohn Scipione		related subviews visually.
296ec25bbaSAdrien Destugues
306ac7032dSJohn Scipione	A basic BBox looks like this:
31a33f8fbdSAdrien Destugues	\image html B_FANCY_BORDER.png
32a33f8fbdSAdrien Destugues
336ac7032dSJohn Scipione	A box's label can either be composed of text or it can be a view such
34a33f8fbdSAdrien Destugues	as a checkbox or dropdown box. See SetLabel() for more details on setting
356ac7032dSJohn Scipione	the box's label.
36*47852bffSJohn Scipione
37*47852bffSJohn Scipione	\since BeOS R3
386ec25bbaSAdrien Destugues*/
396ec25bbaSAdrien Destugues
406ec25bbaSAdrien Destugues
41a33f8fbdSAdrien Destugues/*!
42a33f8fbdSAdrien Destugues	\fn BBox::BBox(BRect frame, const char *name = NULL,
43a33f8fbdSAdrien Destugues		uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
44a33f8fbdSAdrien Destugues		uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
45a33f8fbdSAdrien Destugues		border_style border = B_FANCY_BORDER)
466ac7032dSJohn Scipione	\brief Constructs a named BBox object from a set of dimensions.
476ec25bbaSAdrien Destugues
486ac7032dSJohn Scipione	\note This is the only constructor that can be used if the box is to be
49a33f8fbdSAdrien Destugues		inserted in a window that doesn't use the layout system.
50a33f8fbdSAdrien Destugues
516ac7032dSJohn Scipione	\param frame The bounds of the box.
526ac7032dSJohn Scipione	\param name The name of the box.
536ac7032dSJohn Scipione	\param resizingMode Defines the behavior of the box as the parent view
546ac7032dSJohn Scipione	       resizes. See BView for details.
556ac7032dSJohn Scipione	\param flags Behavior flags for the box. See BView for details.
566ac7032dSJohn Scipione	\param border The border_style of the box.
57*47852bffSJohn Scipione
58*47852bffSJohn Scipione	\since BeOS R3
596ec25bbaSAdrien Destugues*/
606ec25bbaSAdrien Destugues
616ec25bbaSAdrien Destugues
62a33f8fbdSAdrien Destugues/*!
63a33f8fbdSAdrien Destugues	\fn BBox::BBox(const char* name,
64a33f8fbdSAdrien Destugues		uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
65a33f8fbdSAdrien Destugues		border_style border = B_FANCY_BORDER, BView* child = NULL)
666ac7032dSJohn Scipione	\brief Constructs a named BBox object with its dimensions defined
676ac7032dSJohn Scipione		automatically by the Layout API.
686ec25bbaSAdrien Destugues
696ac7032dSJohn Scipione	\param name The name of the box.
706ac7032dSJohn Scipione	\param flags Behavior flags for the box. See BView for details.
716ac7032dSJohn Scipione	\param border The border_style of the box.
726ac7032dSJohn Scipione	\param child Adds an initial child to the Box object. See the Layout
736ac7032dSJohn Scipione		API for details.
74*47852bffSJohn Scipione
75*47852bffSJohn Scipione	\since Haiku R1
766ec25bbaSAdrien Destugues*/
776ec25bbaSAdrien Destugues
786ec25bbaSAdrien Destugues
79a33f8fbdSAdrien Destugues/*!
80a33f8fbdSAdrien Destugues	\fn BBox::BBox(border_style border, BView* child)
816ac7032dSJohn Scipione	\brief Constructs an anonymous BBox object with a defined border style
826ac7032dSJohn Scipione		and child view.
836ec25bbaSAdrien Destugues
846ac7032dSJohn Scipione	There can only be a single child view. This view can, however, act as a
856ac7032dSJohn Scipione	nesting container if you need to show more items inside the box.
86*47852bffSJohn Scipione
87*47852bffSJohn Scipione	\since Haiku R1
886ec25bbaSAdrien Destugues*/
896ec25bbaSAdrien Destugues
906ec25bbaSAdrien Destugues
91a33f8fbdSAdrien Destugues/*!
92a33f8fbdSAdrien Destugues	\fn BBox::BBox(BMessage* archive)
936ac7032dSJohn Scipione	\brief Constructs a BBox object from an \a archive message.
946ec25bbaSAdrien Destugues
95a33f8fbdSAdrien Destugues	This method is usually not called directly. If you want to build a BBox
966ac7032dSJohn Scipione	object from a message you should call Instantiate() which can
976ac7032dSJohn Scipione	handle errors properly.
986ec25bbaSAdrien Destugues
996ac7032dSJohn Scipione	If the \a archive deep, the BBox object will also unarchive each of its
1006ac7032dSJohn Scipione	child views recursively.
1016ec25bbaSAdrien Destugues
1026ac7032dSJohn Scipione	\param archive The \a archive message to restore from.
103*47852bffSJohn Scipione
104*47852bffSJohn Scipione	\since BeOS R3
1056ec25bbaSAdrien Destugues*/
1066ec25bbaSAdrien Destugues
1076ec25bbaSAdrien Destugues
108a33f8fbdSAdrien Destugues/*!
109a33f8fbdSAdrien Destugues	\fn BBox::~BBox()
110a33f8fbdSAdrien Destugues	\brief Destructor method.
1116ec25bbaSAdrien Destugues
112a33f8fbdSAdrien Destugues	Calling the destructor will also free the memory used by the box's label
113a33f8fbdSAdrien Destugues	if it has one.
114*47852bffSJohn Scipione
115*47852bffSJohn Scipione	\since BeOS R3
1166ec25bbaSAdrien Destugues*/
1176ec25bbaSAdrien Destugues
1186ec25bbaSAdrien Destugues
119a33f8fbdSAdrien Destugues/*!
120*47852bffSJohn Scipione	\name Archiving
121*47852bffSJohn Scipione*/
122*47852bffSJohn Scipione
123*47852bffSJohn Scipione
124*47852bffSJohn Scipione//! @{
125*47852bffSJohn Scipione
126*47852bffSJohn Scipione
127*47852bffSJohn Scipione/*!
128a33f8fbdSAdrien Destugues	\fn static BArchivable* BBox::Instantiate(BMessage* archive)
1296ac7032dSJohn Scipione	\brief Creates a new object from an \a archive.
1306ec25bbaSAdrien Destugues
1316ac7032dSJohn Scipione	If the message is a valid object then the instance created from the
132a33f8fbdSAdrien Destugues	passed in \a archive will be returned. Otherwise this method will
133a33f8fbdSAdrien Destugues	return \c NULL.
134a33f8fbdSAdrien Destugues
135a33f8fbdSAdrien Destugues	\param archive The \a archive message.
136a33f8fbdSAdrien Destugues
1376ac7032dSJohn Scipione	\returns An instance of the object if \a archive is valid or \c NULL.
1386ac7032dSJohn Scipione
1396ac7032dSJohn Scipione	\sa BArchivable::Instantiate()
140*47852bffSJohn Scipione
141*47852bffSJohn Scipione	\since BeOS R3
142a33f8fbdSAdrien Destugues*/
143a33f8fbdSAdrien Destugues
144a33f8fbdSAdrien Destugues
145a33f8fbdSAdrien Destugues/*!
146a33f8fbdSAdrien Destugues	\fn virtual status_t BBox::Archive(BMessage* archive,
147a33f8fbdSAdrien Destugues		bool deep = true) const;
1486ac7032dSJohn Scipione	\brief Archives the object into \a archive.
149a33f8fbdSAdrien Destugues
1506ac7032dSJohn Scipione	\param archive The target \a archive that the data will go into.
1516ac7032dSJohn Scipione	\param deep Whether or not to recursively archive child views.
152a33f8fbdSAdrien Destugues
153a33f8fbdSAdrien Destugues	\retval B_OK The archive operation was successful.
1546ac7032dSJohn Scipione	\retval B_BAD_VALUE \c NULL \a archive message.
1556ac7032dSJohn Scipione	\retval B_ERROR The archive operation failed.
1566ac7032dSJohn Scipione
1576ac7032dSJohn Scipione	\sa BArchivable::Archive()
158*47852bffSJohn Scipione
159*47852bffSJohn Scipione	\since BeOS R3
1606ec25bbaSAdrien Destugues*/
1616ec25bbaSAdrien Destugues
1626ec25bbaSAdrien Destugues
163*47852bffSJohn Scipione//! @}
164*47852bffSJohn Scipione
165*47852bffSJohn Scipione
166a33f8fbdSAdrien Destugues/*!
167a33f8fbdSAdrien Destugues	\fn virtual void BBox::SetBorder(border_style border)
1686ac7032dSJohn Scipione	\brief Sets the #border_style.
16901c2a7f3SAdrien Destugues
1706ac7032dSJohn Scipione	Possible #border_style values include:
1716ac7032dSJohn Scipione		- \c B_PLAIN_BORDER A single 1-pixel line border.
1726ac7032dSJohn Scipione		- \c B_FANCY_BORDER The default, beveled look.
1736ac7032dSJohn Scipione		- \c B_NO_BORDER Used to make a borderless box.
1746ac7032dSJohn Scipione
1756ac7032dSJohn Scipione	\param border The #border_style to set.
176*47852bffSJohn Scipione
177*47852bffSJohn Scipione	\since BeOS R3
1786ec25bbaSAdrien Destugues*/
1796ec25bbaSAdrien Destugues
1806ec25bbaSAdrien Destugues
181a33f8fbdSAdrien Destugues/*!
182a33f8fbdSAdrien Destugues	\fn border_style BBox::Border() const
1836ac7032dSJohn Scipione	\brief Gets the current #border_style.
184a33f8fbdSAdrien Destugues
1856ac7032dSJohn Scipione	Possible #border_style values include:
1866ac7032dSJohn Scipione		- \c B_PLAIN_BORDER A single 1-pixel line border.
1876ac7032dSJohn Scipione		- \c B_FANCY_BORDER The default, beveled look.
1886ac7032dSJohn Scipione		- \c B_NO_BORDER Used to make a borderless box.
1896ac7032dSJohn Scipione
1906ac7032dSJohn Scipione	\returns The #border_style of the box.
191*47852bffSJohn Scipione
192*47852bffSJohn Scipione	\since BeOS R3
1936ec25bbaSAdrien Destugues*/
1946ec25bbaSAdrien Destugues
1956ec25bbaSAdrien Destugues
196a33f8fbdSAdrien Destugues/*!
197a33f8fbdSAdrien Destugues	\fn float BBox::TopBorderOffset()
1986ac7032dSJohn Scipione	\brief Gets the distance from the very top of the box to the top border
1996ac7032dSJohn Scipione		line in pixels.
200a33f8fbdSAdrien Destugues
201*47852bffSJohn Scipione	\warning This method is not yet finalized.
20201c2a7f3SAdrien Destugues
2036ac7032dSJohn Scipione	The distance may vary depending on the text or view used as label and the
2046ac7032dSJohn Scipione	font settings. The border is drawn center-aligned with the label. This
2056ac7032dSJohn Scipione	method can be used to line up two boxes visually if one has a label and
2066ac7032dSJohn Scipione	the other does not.
20701c2a7f3SAdrien Destugues
2086ac7032dSJohn Scipione	\returns The distance from the very top of the box to the top border
2096ac7032dSJohn Scipione		line in pixels as a \c float.
210*47852bffSJohn Scipione
211*47852bffSJohn Scipione	\since Haiku R1
2126ec25bbaSAdrien Destugues*/
2136ec25bbaSAdrien Destugues
2146ec25bbaSAdrien Destugues
215a33f8fbdSAdrien Destugues/*!
216a33f8fbdSAdrien Destugues	\fn BRect BBox::InnerFrame()
2176ac7032dSJohn Scipione	\brief Gets the frame rectangle just inside the border of the box.
218a33f8fbdSAdrien Destugues
219*47852bffSJohn Scipione	\warning This method is not yet finalized.
220a33f8fbdSAdrien Destugues
2216ac7032dSJohn Scipione	\returns A BRect set to the dimensions of the box's inside border.
222*47852bffSJohn Scipione
223*47852bffSJohn Scipione	\since Haiku R1
2246ec25bbaSAdrien Destugues*/
2256ec25bbaSAdrien Destugues
2266ec25bbaSAdrien Destugues
227a33f8fbdSAdrien Destugues/*!
228a33f8fbdSAdrien Destugues	\fn void BBox::SetLabel(const char* string)
229a33f8fbdSAdrien Destugues	\brief Sets the box's label text.
2306ec25bbaSAdrien Destugues
2316ac7032dSJohn Scipione	Below is an example of a box with some simple text label:
232a33f8fbdSAdrien Destugues
233a33f8fbdSAdrien Destugues	\image html BBox_example.png
234a33f8fbdSAdrien Destugues
2356ac7032dSJohn Scipione	The code to create a box with a text label looks like this:
236a33f8fbdSAdrien Destugues	\code
237a33f8fbdSAdrien DestuguesfIconBox = new BBox("Icon Box");
238a33f8fbdSAdrien DestuguesfIconBox->SetLabel("Icon");
239a33f8fbdSAdrien Destugues	\endcode
240a33f8fbdSAdrien Destugues
241a33f8fbdSAdrien Destugues	\param string The label text string to set as the box's title.
242*47852bffSJohn Scipione
243*47852bffSJohn Scipione	\since BeOS R3
2446ec25bbaSAdrien Destugues*/
2456ec25bbaSAdrien Destugues
2466ec25bbaSAdrien Destugues
247a33f8fbdSAdrien Destugues/*!
248a33f8fbdSAdrien Destugues	\fn status_t BBox::SetLabel(BView* viewLabel)
2496ac7032dSJohn Scipione	\brief Sets the label from a BView.
2506ec25bbaSAdrien Destugues
2516ac7032dSJohn Scipione	This version of SetLabel() provides for building a BBox object with a
2526ac7032dSJohn Scipione	control used in place of the text label. You can pass in any type of
2536ac7032dSJohn Scipione	BView derived control for this such as a BPopupMenu or BCheckBox.
254a33f8fbdSAdrien Destugues
2556ac7032dSJohn Scipione	An example of a box with a checkbox view is shown below:
256a33f8fbdSAdrien Destugues	\image html BBox_with_checkbox.png
257a33f8fbdSAdrien Destugues
2586ac7032dSJohn Scipione	The code to create such a box looks like this:
259a33f8fbdSAdrien Destugues	\code
260a33f8fbdSAdrien DestuguesfVirtualMemoryEnabledCheckBox = new BCheckBox("Virtual memory check box",
261a33f8fbdSAdrien Destugues	"Enable virtual memory", new BMessage(kVirtualMemoryEnabled));
262a33f8fbdSAdrien Destugues
263a33f8fbdSAdrien DestuguesBBox* fVirtualMemoryBox = new BBox("Virtual memory box");
264a33f8fbdSAdrien DestuguesfVirtualMemoryBox->SetLabel(fVirtualMemoryEnabledCheckBox);
265a33f8fbdSAdrien Destugues	\endcode
266a33f8fbdSAdrien Destugues
267a33f8fbdSAdrien Destugues	\param viewLabel A BView.
2686ac7032dSJohn Scipione
269a33f8fbdSAdrien Destugues	\returns \c B_OK
270*47852bffSJohn Scipione
271*47852bffSJohn Scipione	\since BeOS R3
2726ec25bbaSAdrien Destugues*/
2736ec25bbaSAdrien Destugues
2746ec25bbaSAdrien Destugues
275a33f8fbdSAdrien Destugues/*!
276a33f8fbdSAdrien Destugues	\fn const char* BBox::Label() const
2776ac7032dSJohn Scipione	\brief Gets the text of the box's label.
2786ec25bbaSAdrien Destugues
2796ac7032dSJohn Scipione	This only works if the label is set as text. If you set the label to a
2806ac7032dSJohn Scipione	BView, you have to get the text by other means, likely starting with
28101c2a7f3SAdrien Destugues	LabelView.
282a33f8fbdSAdrien Destugues
2836ac7032dSJohn Scipione	\returns The label text of the BBox if the box has a text label or
2846ac7032dSJohn Scipione		\c NULL otherwise.
285*47852bffSJohn Scipione
286*47852bffSJohn Scipione	\since BeOS R3
2876ec25bbaSAdrien Destugues*/
2886ec25bbaSAdrien Destugues
2896ec25bbaSAdrien Destugues
290a33f8fbdSAdrien Destugues/*!
291a33f8fbdSAdrien Destugues	\fn BView* BBox::LabelView() const
2926ec25bbaSAdrien Destugues	\brief Gets the BView representing the label.
2936ac7032dSJohn Scipione
2946ac7032dSJohn Scipione	\returns a pointer to a BView object.
295*47852bffSJohn Scipione
296*47852bffSJohn Scipione	\since BeOS R4
2976ec25bbaSAdrien Destugues*/
2986ec25bbaSAdrien Destugues
2996ec25bbaSAdrien Destugues
300a33f8fbdSAdrien Destugues/*!
301a33f8fbdSAdrien Destugues	\fn virtual void BBox::Draw(BRect updateRect)
3026ac7032dSJohn Scipione	\brief Draws the area of the box that intersects \a updateRect.
3036ec25bbaSAdrien Destugues
3046ac7032dSJohn Scipione	This is an hook method called by the Interface Kit, you don't have to
3056ac7032dSJohn Scipione	call it yourself. If you need to forcefully redraw the view,
3066ac7032dSJohn Scipione	consider calling Invalidate() instead.
30701c2a7f3SAdrien Destugues
3086ac7032dSJohn Scipione	\param updateRect The rectangular area to be drawn.
309*47852bffSJohn Scipione
310*47852bffSJohn Scipione	\since BeOS R3
3116ec25bbaSAdrien Destugues*/
3126ec25bbaSAdrien Destugues
3136ec25bbaSAdrien Destugues
314a33f8fbdSAdrien Destugues/*!
315a33f8fbdSAdrien Destugues	\fn virtual void BBox::AttachedToWindow()
3166ac7032dSJohn Scipione	\brief Hook method that is called when the object is attached to a
3176ac7032dSJohn Scipione		window.
3186ec25bbaSAdrien Destugues
3196ac7032dSJohn Scipione	This method overrides BView::AttachedToWindow() to set the background
3206ac7032dSJohn Scipione	color of the box to the background of its parent view.
3216ec25bbaSAdrien Destugues
322a33f8fbdSAdrien Destugues	If you are using the layout system, the BBox is also resized according to
323a33f8fbdSAdrien Destugues	the layout of the parent view.
3246ac7032dSJohn Scipione
3256ac7032dSJohn Scipione	\sa BView::AttachedToWindow()
326*47852bffSJohn Scipione
327*47852bffSJohn Scipione	\since BeOS R3
3286ec25bbaSAdrien Destugues*/
3296ec25bbaSAdrien Destugues
3306ec25bbaSAdrien Destugues
331a33f8fbdSAdrien Destugues/*!
332a33f8fbdSAdrien Destugues	\fn virtual void BBox::FrameResized(float width, float height)
3336ac7032dSJohn Scipione	\brief Hook method that gets called when the BBox object is resized.
3346ec25bbaSAdrien Destugues
3356ac7032dSJohn Scipione	This method may be called either because the window in which the BBox
3366ac7032dSJohn Scipione	object was resized, or because the window layout was otherwise altered.
3376ec25bbaSAdrien Destugues
3386ac7032dSJohn Scipione	This method recomputes the layout of the BBox (including label and
3396ac7032dSJohn Scipione	contents) and makes it redraw as necessary.
340*47852bffSJohn Scipione
341*47852bffSJohn Scipione	\since BeOS R3
3426ec25bbaSAdrien Destugues*/
3436ec25bbaSAdrien Destugues
3446ec25bbaSAdrien Destugues
345a33f8fbdSAdrien Destugues/*!
346a33f8fbdSAdrien Destugues	\fn virtual void BBox::ResizeToPreferred()
3476ac7032dSJohn Scipione	\brief Resizes the box to its preferred dimensions.
3486ec25bbaSAdrien Destugues
3496ac7032dSJohn Scipione	\note This only works in the non-layout mode, as it forces the resizing.
350*47852bffSJohn Scipione
351*47852bffSJohn Scipione	\since BeOS R3
3526ec25bbaSAdrien Destugues*/
3536ec25bbaSAdrien Destugues
3546ec25bbaSAdrien Destugues
355a33f8fbdSAdrien Destugues/*!
356a33f8fbdSAdrien Destugues	\fn virtual void BBox::GetPreferredSize(float* _width, float* _height)
3576ac7032dSJohn Scipione	\brief Fill out the preferred width and height of the box
3586ac7032dSJohn Scipione		into the \a _width and \a _height parameters.
3596ec25bbaSAdrien Destugues
360a33f8fbdSAdrien Destugues	\note Either the \a _width or \a _height parameter may be set to \c NULL
361a33f8fbdSAdrien Destugues		if you only want to get the other one.
36201c2a7f3SAdrien Destugues
3636ac7032dSJohn Scipione	The size is computed from the child view sizes, unless it was explicitly
3646ac7032dSJohn Scipione	set for the BBox (which can be done only if the BBox is configured to
3656ac7032dSJohn Scipione	use the Layout API).
3666ac7032dSJohn Scipione
3676ac7032dSJohn Scipione	\param[out] _width Pointer to a \c float to store the width of the view.
3686ac7032dSJohn Scipione	\param[out] _height Pointer to a \c float to store the height of the view.
369*47852bffSJohn Scipione
370*47852bffSJohn Scipione	\since BeOS R3
3716ec25bbaSAdrien Destugues*/
3726ec25bbaSAdrien Destugues
3736ec25bbaSAdrien Destugues
374a33f8fbdSAdrien Destugues/*!
375a33f8fbdSAdrien Destugues	\fn virtual BSize BBox::MinSize()
3766ac7032dSJohn Scipione	\brief Gets the minimum possible size of the BBox object.
3776ec25bbaSAdrien Destugues
3786ac7032dSJohn Scipione	Drawing the box at this size ensures the label and the child view are
3796ac7032dSJohn Scipione	visible. Reducing the size even more would mean that a view would not
3806ac7032dSJohn Scipione	be visible.
381*47852bffSJohn Scipione
382*47852bffSJohn Scipione	\since Haiku R1
3836ec25bbaSAdrien Destugues*/
3846ec25bbaSAdrien Destugues
3856ec25bbaSAdrien Destugues
386a33f8fbdSAdrien Destugues/*!
387a33f8fbdSAdrien Destugues	\fn virtual BSize BBox::MaxSize()
3886ac7032dSJohn Scipione	\brief Gets the maximum possible size of the BBox object.
3896ec25bbaSAdrien Destugues
3906ac7032dSJohn Scipione	The maximum size depends on the maximize size of the child views.
391a33f8fbdSAdrien Destugues
3926ac7032dSJohn Scipione	\returns The maximum possible size of the BBox as a BSize.
393*47852bffSJohn Scipione
394*47852bffSJohn Scipione	\since Haiku R1
3956ec25bbaSAdrien Destugues*/
3966ec25bbaSAdrien Destugues
3976ec25bbaSAdrien Destugues
398a33f8fbdSAdrien Destugues/*!
399a33f8fbdSAdrien Destugues	\fn virtual BSize BBox::PreferredSize()
4006ac7032dSJohn Scipione	\brief Returns the preferred size of the box.
4016ec25bbaSAdrien Destugues
4026ac7032dSJohn Scipione	This method works the same as GetPreferredSize, but uses the more
4036ac7032dSJohn Scipione	convenient BSize object.
404a33f8fbdSAdrien Destugues
4056ac7032dSJohn Scipione	\returns The minimum possible size of the BBox as a BSize.
406*47852bffSJohn Scipione
407*47852bffSJohn Scipione	\since Haiku R1
4086ec25bbaSAdrien Destugues*/
4096ec25bbaSAdrien Destugues
4106ec25bbaSAdrien Destugues
411a33f8fbdSAdrien Destugues/*!
412a33f8fbdSAdrien Destugues	\fn virtual void BBox::DoLayout()
4136ac7032dSJohn Scipione	\brief Lays out the box moving everything into its appropriate position.
4146ec25bbaSAdrien Destugues
4156ac7032dSJohn Scipione	This only works if the BBox object was constructed using the Layout API,
416a33f8fbdSAdrien Destugues	i.e. it was created with one of the BRect-less constructors.
41701c2a7f3SAdrien Destugues
4186ac7032dSJohn Scipione	Once the size of the box is known from laying out its parent views,
4196ac7032dSJohn Scipione	this method is called so the box can adjust the position and size of the
4206ac7032dSJohn Scipione	label, eventually truncating the label text if there is not enough space.
4216ac7032dSJohn Scipione	The exact border positions are also computed, then the child view is also
4226ac7032dSJohn Scipione	laid out if its size constraints change.
423*47852bffSJohn Scipione
424*47852bffSJohn Scipione	\since Haiku R1
4256ec25bbaSAdrien Destugues*/
426