xref: /haiku/docs/user/interface/Box.dox (revision ff1ee776fe00c4b29992cd25ef94463302ba6a92)
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
13*ff1ee776SNiels Sascha Reedijk */
14a33f8fbdSAdrien Destugues
156ec25bbaSAdrien Destugues
166ec25bbaSAdrien Destugues/*!
176ec25bbaSAdrien Destugues	\file Box.h
18820dca4dSJohn Scipione	\ingroup interface
19820dca4dSJohn Scipione	\ingroup libbe
206ec25bbaSAdrien Destugues	\brief Defines the BBox class
216ec25bbaSAdrien Destugues*/
226ec25bbaSAdrien Destugues
23a33f8fbdSAdrien Destugues
24a33f8fbdSAdrien Destugues/*!
25a33f8fbdSAdrien Destugues	\class BBox
266ec25bbaSAdrien Destugues	\ingroup interface
27820dca4dSJohn Scipione	\ingroup libbe
286ac7032dSJohn Scipione	\brief A rectangular view with a border and an optional label to group
296ac7032dSJohn Scipione		related subviews visually.
306ec25bbaSAdrien Destugues
316ac7032dSJohn Scipione	A basic BBox looks like this:
32a33f8fbdSAdrien Destugues	\image html B_FANCY_BORDER.png
33a33f8fbdSAdrien Destugues
346ac7032dSJohn Scipione	A box's label can either be composed of text or it can be a view such
35a33f8fbdSAdrien Destugues	as a checkbox or dropdown box. See SetLabel() for more details on setting
366ac7032dSJohn Scipione	the box's label.
3747852bffSJohn Scipione
3847852bffSJohn Scipione	\since BeOS R3
396ec25bbaSAdrien Destugues*/
406ec25bbaSAdrien Destugues
416ec25bbaSAdrien Destugues
42a33f8fbdSAdrien Destugues/*!
43a33f8fbdSAdrien Destugues	\fn BBox::BBox(BRect frame, const char *name = NULL,
44a33f8fbdSAdrien Destugues		uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP,
45a33f8fbdSAdrien Destugues		uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
46a33f8fbdSAdrien Destugues		border_style border = B_FANCY_BORDER)
476ac7032dSJohn Scipione	\brief Constructs a named BBox object from a set of dimensions.
486ec25bbaSAdrien Destugues
496ac7032dSJohn Scipione	\note This is the only constructor that can be used if the box is to be
50a33f8fbdSAdrien Destugues		inserted in a window that doesn't use the layout system.
51a33f8fbdSAdrien Destugues
526ac7032dSJohn Scipione	\param frame The bounds of the box.
536ac7032dSJohn Scipione	\param name The name of the box.
546ac7032dSJohn Scipione	\param resizingMode Defines the behavior of the box as the parent view
556ac7032dSJohn Scipione	       resizes. See BView for details.
566ac7032dSJohn Scipione	\param flags Behavior flags for the box. See BView for details.
576ac7032dSJohn Scipione	\param border The border_style of the box.
5847852bffSJohn Scipione
5947852bffSJohn Scipione	\since BeOS R3
606ec25bbaSAdrien Destugues*/
616ec25bbaSAdrien Destugues
626ec25bbaSAdrien Destugues
63a33f8fbdSAdrien Destugues/*!
64a33f8fbdSAdrien Destugues	\fn BBox::BBox(const char* name,
65a33f8fbdSAdrien Destugues		uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
66a33f8fbdSAdrien Destugues		border_style border = B_FANCY_BORDER, BView* child = NULL)
676ac7032dSJohn Scipione	\brief Constructs a named BBox object with its dimensions defined
686ac7032dSJohn Scipione		automatically by the Layout API.
696ec25bbaSAdrien Destugues
706ac7032dSJohn Scipione	\param name The name of the box.
716ac7032dSJohn Scipione	\param flags Behavior flags for the box. See BView for details.
726ac7032dSJohn Scipione	\param border The border_style of the box.
736ac7032dSJohn Scipione	\param child Adds an initial child to the Box object. See the Layout
746ac7032dSJohn Scipione		API for details.
7547852bffSJohn Scipione
7647852bffSJohn Scipione	\since Haiku R1
776ec25bbaSAdrien Destugues*/
786ec25bbaSAdrien Destugues
796ec25bbaSAdrien Destugues
80a33f8fbdSAdrien Destugues/*!
81a33f8fbdSAdrien Destugues	\fn BBox::BBox(border_style border, BView* child)
826ac7032dSJohn Scipione	\brief Constructs an anonymous BBox object with a defined border style
836ac7032dSJohn Scipione		and child view.
846ec25bbaSAdrien Destugues
856ac7032dSJohn Scipione	There can only be a single child view. This view can, however, act as a
866ac7032dSJohn Scipione	nesting container if you need to show more items inside the box.
8747852bffSJohn Scipione
8847852bffSJohn Scipione	\since Haiku R1
896ec25bbaSAdrien Destugues*/
906ec25bbaSAdrien Destugues
916ec25bbaSAdrien Destugues
92a33f8fbdSAdrien Destugues/*!
93a33f8fbdSAdrien Destugues	\fn BBox::BBox(BMessage* archive)
946ac7032dSJohn Scipione	\brief Constructs a BBox object from an \a archive message.
956ec25bbaSAdrien Destugues
96a33f8fbdSAdrien Destugues	This method is usually not called directly. If you want to build a BBox
976ac7032dSJohn Scipione	object from a message you should call Instantiate() which can
986ac7032dSJohn Scipione	handle errors properly.
996ec25bbaSAdrien Destugues
1006ac7032dSJohn Scipione	If the \a archive deep, the BBox object will also unarchive each of its
1016ac7032dSJohn Scipione	child views recursively.
1026ec25bbaSAdrien Destugues
1036ac7032dSJohn Scipione	\param archive The \a archive message to restore from.
10447852bffSJohn Scipione
10547852bffSJohn Scipione	\since BeOS R3
1066ec25bbaSAdrien Destugues*/
1076ec25bbaSAdrien Destugues
1086ec25bbaSAdrien Destugues
109a33f8fbdSAdrien Destugues/*!
110a33f8fbdSAdrien Destugues	\fn BBox::~BBox()
111a33f8fbdSAdrien Destugues	\brief Destructor method.
1126ec25bbaSAdrien Destugues
113a33f8fbdSAdrien Destugues	Calling the destructor will also free the memory used by the box's label
114a33f8fbdSAdrien Destugues	if it has one.
11547852bffSJohn Scipione
11647852bffSJohn Scipione	\since BeOS R3
1176ec25bbaSAdrien Destugues*/
1186ec25bbaSAdrien Destugues
1196ec25bbaSAdrien Destugues
120a33f8fbdSAdrien Destugues/*!
12147852bffSJohn Scipione	\name Archiving
12247852bffSJohn Scipione*/
12347852bffSJohn Scipione
12447852bffSJohn Scipione
12547852bffSJohn Scipione//! @{
12647852bffSJohn Scipione
12747852bffSJohn Scipione
12847852bffSJohn Scipione/*!
129a33f8fbdSAdrien Destugues	\fn static BArchivable* BBox::Instantiate(BMessage* archive)
1306ac7032dSJohn Scipione	\brief Creates a new object from an \a archive.
1316ec25bbaSAdrien Destugues
1326ac7032dSJohn Scipione	If the message is a valid object then the instance created from the
133a33f8fbdSAdrien Destugues	passed in \a archive will be returned. Otherwise this method will
134a33f8fbdSAdrien Destugues	return \c NULL.
135a33f8fbdSAdrien Destugues
136a33f8fbdSAdrien Destugues	\param archive The \a archive message.
137a33f8fbdSAdrien Destugues
1386ac7032dSJohn Scipione	\returns An instance of the object if \a archive is valid or \c NULL.
1396ac7032dSJohn Scipione
1406ac7032dSJohn Scipione	\sa BArchivable::Instantiate()
14147852bffSJohn Scipione
14247852bffSJohn Scipione	\since BeOS R3
143a33f8fbdSAdrien Destugues*/
144a33f8fbdSAdrien Destugues
145a33f8fbdSAdrien Destugues
146a33f8fbdSAdrien Destugues/*!
147a33f8fbdSAdrien Destugues	\fn virtual status_t BBox::Archive(BMessage* archive,
148a33f8fbdSAdrien Destugues		bool deep = true) const;
1496ac7032dSJohn Scipione	\brief Archives the object into \a archive.
150a33f8fbdSAdrien Destugues
1516ac7032dSJohn Scipione	\param archive The target \a archive that the data will go into.
1526ac7032dSJohn Scipione	\param deep Whether or not to recursively archive child views.
153a33f8fbdSAdrien Destugues
154a33f8fbdSAdrien Destugues	\retval B_OK The archive operation was successful.
1556ac7032dSJohn Scipione	\retval B_BAD_VALUE \c NULL \a archive message.
1566ac7032dSJohn Scipione	\retval B_ERROR The archive operation failed.
1576ac7032dSJohn Scipione
1586ac7032dSJohn Scipione	\sa BArchivable::Archive()
15947852bffSJohn Scipione
16047852bffSJohn Scipione	\since BeOS R3
1616ec25bbaSAdrien Destugues*/
1626ec25bbaSAdrien Destugues
1636ec25bbaSAdrien Destugues
16447852bffSJohn Scipione//! @}
16547852bffSJohn Scipione
16647852bffSJohn Scipione
167a33f8fbdSAdrien Destugues/*!
168a33f8fbdSAdrien Destugues	\fn virtual void BBox::SetBorder(border_style border)
1696ac7032dSJohn Scipione	\brief Sets the #border_style.
17001c2a7f3SAdrien Destugues
1716ac7032dSJohn Scipione	Possible #border_style values include:
1726ac7032dSJohn Scipione		- \c B_PLAIN_BORDER A single 1-pixel line border.
1736ac7032dSJohn Scipione		- \c B_FANCY_BORDER The default, beveled look.
1746ac7032dSJohn Scipione		- \c B_NO_BORDER Used to make a borderless box.
1756ac7032dSJohn Scipione
1766ac7032dSJohn Scipione	\param border The #border_style to set.
17747852bffSJohn Scipione
17847852bffSJohn Scipione	\since BeOS R3
1796ec25bbaSAdrien Destugues*/
1806ec25bbaSAdrien Destugues
1816ec25bbaSAdrien Destugues
182a33f8fbdSAdrien Destugues/*!
183a33f8fbdSAdrien Destugues	\fn border_style BBox::Border() const
1846ac7032dSJohn Scipione	\brief Gets the current #border_style.
185a33f8fbdSAdrien Destugues
1866ac7032dSJohn Scipione	Possible #border_style values include:
1876ac7032dSJohn Scipione		- \c B_PLAIN_BORDER A single 1-pixel line border.
1886ac7032dSJohn Scipione		- \c B_FANCY_BORDER The default, beveled look.
1896ac7032dSJohn Scipione		- \c B_NO_BORDER Used to make a borderless box.
1906ac7032dSJohn Scipione
1916ac7032dSJohn Scipione	\returns The #border_style of the box.
19247852bffSJohn Scipione
19347852bffSJohn Scipione	\since BeOS R3
1946ec25bbaSAdrien Destugues*/
1956ec25bbaSAdrien Destugues
1966ec25bbaSAdrien Destugues
197a33f8fbdSAdrien Destugues/*!
198a33f8fbdSAdrien Destugues	\fn float BBox::TopBorderOffset()
1996ac7032dSJohn Scipione	\brief Gets the distance from the very top of the box to the top border
2006ac7032dSJohn Scipione		line in pixels.
201a33f8fbdSAdrien Destugues
20247852bffSJohn Scipione	\warning This method is not yet finalized.
20301c2a7f3SAdrien Destugues
2046ac7032dSJohn Scipione	The distance may vary depending on the text or view used as label and the
2056ac7032dSJohn Scipione	font settings. The border is drawn center-aligned with the label. This
2066ac7032dSJohn Scipione	method can be used to line up two boxes visually if one has a label and
2076ac7032dSJohn Scipione	the other does not.
20801c2a7f3SAdrien Destugues
2096ac7032dSJohn Scipione	\returns The distance from the very top of the box to the top border
2106ac7032dSJohn Scipione		line in pixels as a \c float.
21147852bffSJohn Scipione
21247852bffSJohn Scipione	\since Haiku R1
2136ec25bbaSAdrien Destugues*/
2146ec25bbaSAdrien Destugues
2156ec25bbaSAdrien Destugues
216a33f8fbdSAdrien Destugues/*!
217a33f8fbdSAdrien Destugues	\fn BRect BBox::InnerFrame()
2186ac7032dSJohn Scipione	\brief Gets the frame rectangle just inside the border of the box.
219a33f8fbdSAdrien Destugues
22047852bffSJohn Scipione	\warning This method is not yet finalized.
221a33f8fbdSAdrien Destugues
2226ac7032dSJohn Scipione	\returns A BRect set to the dimensions of the box's inside border.
22347852bffSJohn Scipione
22447852bffSJohn Scipione	\since Haiku R1
2256ec25bbaSAdrien Destugues*/
2266ec25bbaSAdrien Destugues
2276ec25bbaSAdrien Destugues
228a33f8fbdSAdrien Destugues/*!
229a33f8fbdSAdrien Destugues	\fn void BBox::SetLabel(const char* string)
230a33f8fbdSAdrien Destugues	\brief Sets the box's label text.
2316ec25bbaSAdrien Destugues
2326ac7032dSJohn Scipione	Below is an example of a box with some simple text label:
233a33f8fbdSAdrien Destugues
234a33f8fbdSAdrien Destugues	\image html BBox_example.png
235a33f8fbdSAdrien Destugues
2366ac7032dSJohn Scipione	The code to create a box with a text label looks like this:
237a33f8fbdSAdrien Destugues	\code
238a33f8fbdSAdrien DestuguesfIconBox = new BBox("Icon Box");
239a33f8fbdSAdrien DestuguesfIconBox->SetLabel("Icon");
240a33f8fbdSAdrien Destugues	\endcode
241a33f8fbdSAdrien Destugues
242a33f8fbdSAdrien Destugues	\param string The label text string to set as the box's title.
24347852bffSJohn Scipione
24447852bffSJohn Scipione	\since BeOS R3
2456ec25bbaSAdrien Destugues*/
2466ec25bbaSAdrien Destugues
2476ec25bbaSAdrien Destugues
248a33f8fbdSAdrien Destugues/*!
249a33f8fbdSAdrien Destugues	\fn status_t BBox::SetLabel(BView* viewLabel)
2506ac7032dSJohn Scipione	\brief Sets the label from a BView.
2516ec25bbaSAdrien Destugues
2526ac7032dSJohn Scipione	This version of SetLabel() provides for building a BBox object with a
2536ac7032dSJohn Scipione	control used in place of the text label. You can pass in any type of
2546ac7032dSJohn Scipione	BView derived control for this such as a BPopupMenu or BCheckBox.
255a33f8fbdSAdrien Destugues
2566ac7032dSJohn Scipione	An example of a box with a checkbox view is shown below:
257a33f8fbdSAdrien Destugues	\image html BBox_with_checkbox.png
258a33f8fbdSAdrien Destugues
2596ac7032dSJohn Scipione	The code to create such a box looks like this:
260a33f8fbdSAdrien Destugues	\code
261a33f8fbdSAdrien DestuguesfVirtualMemoryEnabledCheckBox = new BCheckBox("Virtual memory check box",
262a33f8fbdSAdrien Destugues	"Enable virtual memory", new BMessage(kVirtualMemoryEnabled));
263a33f8fbdSAdrien Destugues
264a33f8fbdSAdrien DestuguesBBox* fVirtualMemoryBox = new BBox("Virtual memory box");
265a33f8fbdSAdrien DestuguesfVirtualMemoryBox->SetLabel(fVirtualMemoryEnabledCheckBox);
266a33f8fbdSAdrien Destugues	\endcode
267a33f8fbdSAdrien Destugues
268a33f8fbdSAdrien Destugues	\param viewLabel A BView.
2696ac7032dSJohn Scipione
270a33f8fbdSAdrien Destugues	\returns \c B_OK
27147852bffSJohn Scipione
27247852bffSJohn Scipione	\since BeOS R3
2736ec25bbaSAdrien Destugues*/
2746ec25bbaSAdrien Destugues
2756ec25bbaSAdrien Destugues
276a33f8fbdSAdrien Destugues/*!
277a33f8fbdSAdrien Destugues	\fn const char* BBox::Label() const
2786ac7032dSJohn Scipione	\brief Gets the text of the box's label.
2796ec25bbaSAdrien Destugues
2806ac7032dSJohn Scipione	This only works if the label is set as text. If you set the label to a
2816ac7032dSJohn Scipione	BView, you have to get the text by other means, likely starting with
28201c2a7f3SAdrien Destugues	LabelView.
283a33f8fbdSAdrien Destugues
2846ac7032dSJohn Scipione	\returns The label text of the BBox if the box has a text label or
2856ac7032dSJohn Scipione		\c NULL otherwise.
28647852bffSJohn Scipione
28747852bffSJohn Scipione	\since BeOS R3
2886ec25bbaSAdrien Destugues*/
2896ec25bbaSAdrien Destugues
2906ec25bbaSAdrien Destugues
291a33f8fbdSAdrien Destugues/*!
292a33f8fbdSAdrien Destugues	\fn BView* BBox::LabelView() const
2936ec25bbaSAdrien Destugues	\brief Gets the BView representing the label.
2946ac7032dSJohn Scipione
2956ac7032dSJohn Scipione	\returns a pointer to a BView object.
29647852bffSJohn Scipione
29747852bffSJohn Scipione	\since BeOS R4
2986ec25bbaSAdrien Destugues*/
2996ec25bbaSAdrien Destugues
3006ec25bbaSAdrien Destugues
301a33f8fbdSAdrien Destugues/*!
302a33f8fbdSAdrien Destugues	\fn virtual void BBox::Draw(BRect updateRect)
3036ac7032dSJohn Scipione	\brief Draws the area of the box that intersects \a updateRect.
3046ec25bbaSAdrien Destugues
3056ac7032dSJohn Scipione	This is an hook method called by the Interface Kit, you don't have to
3066ac7032dSJohn Scipione	call it yourself. If you need to forcefully redraw the view,
3076ac7032dSJohn Scipione	consider calling Invalidate() instead.
30801c2a7f3SAdrien Destugues
3096ac7032dSJohn Scipione	\param updateRect The rectangular area to be drawn.
31047852bffSJohn Scipione
31147852bffSJohn Scipione	\since BeOS R3
3126ec25bbaSAdrien Destugues*/
3136ec25bbaSAdrien Destugues
3146ec25bbaSAdrien Destugues
315a33f8fbdSAdrien Destugues/*!
316a33f8fbdSAdrien Destugues	\fn virtual void BBox::AttachedToWindow()
3176ac7032dSJohn Scipione	\brief Hook method that is called when the object is attached to a
3186ac7032dSJohn Scipione		window.
3196ec25bbaSAdrien Destugues
3206ac7032dSJohn Scipione	This method overrides BView::AttachedToWindow() to set the background
3216ac7032dSJohn Scipione	color of the box to the background of its parent view.
3226ec25bbaSAdrien Destugues
323a33f8fbdSAdrien Destugues	If you are using the layout system, the BBox is also resized according to
324a33f8fbdSAdrien Destugues	the layout of the parent view.
3256ac7032dSJohn Scipione
3266ac7032dSJohn Scipione	\sa BView::AttachedToWindow()
32747852bffSJohn Scipione
32847852bffSJohn Scipione	\since BeOS R3
3296ec25bbaSAdrien Destugues*/
3306ec25bbaSAdrien Destugues
3316ec25bbaSAdrien Destugues
332a33f8fbdSAdrien Destugues/*!
333a33f8fbdSAdrien Destugues	\fn virtual void BBox::FrameResized(float width, float height)
3346ac7032dSJohn Scipione	\brief Hook method that gets called when the BBox object is resized.
3356ec25bbaSAdrien Destugues
3366ac7032dSJohn Scipione	This method may be called either because the window in which the BBox
3376ac7032dSJohn Scipione	object was resized, or because the window layout was otherwise altered.
3386ec25bbaSAdrien Destugues
3396ac7032dSJohn Scipione	This method recomputes the layout of the BBox (including label and
3406ac7032dSJohn Scipione	contents) and makes it redraw as necessary.
34147852bffSJohn Scipione
34247852bffSJohn Scipione	\since BeOS R3
3436ec25bbaSAdrien Destugues*/
3446ec25bbaSAdrien Destugues
3456ec25bbaSAdrien Destugues
346a33f8fbdSAdrien Destugues/*!
347a33f8fbdSAdrien Destugues	\fn virtual void BBox::ResizeToPreferred()
3486ac7032dSJohn Scipione	\brief Resizes the box to its preferred dimensions.
3496ec25bbaSAdrien Destugues
3506ac7032dSJohn Scipione	\note This only works in the non-layout mode, as it forces the resizing.
35147852bffSJohn Scipione
35247852bffSJohn Scipione	\since BeOS R3
3536ec25bbaSAdrien Destugues*/
3546ec25bbaSAdrien Destugues
3556ec25bbaSAdrien Destugues
356a33f8fbdSAdrien Destugues/*!
357a33f8fbdSAdrien Destugues	\fn virtual void BBox::GetPreferredSize(float* _width, float* _height)
3586ac7032dSJohn Scipione	\brief Fill out the preferred width and height of the box
3596ac7032dSJohn Scipione		into the \a _width and \a _height parameters.
3606ec25bbaSAdrien Destugues
361a33f8fbdSAdrien Destugues	\note Either the \a _width or \a _height parameter may be set to \c NULL
362a33f8fbdSAdrien Destugues		if you only want to get the other one.
36301c2a7f3SAdrien Destugues
3646ac7032dSJohn Scipione	The size is computed from the child view sizes, unless it was explicitly
3656ac7032dSJohn Scipione	set for the BBox (which can be done only if the BBox is configured to
3666ac7032dSJohn Scipione	use the Layout API).
3676ac7032dSJohn Scipione
3686ac7032dSJohn Scipione	\param[out] _width Pointer to a \c float to store the width of the view.
3696ac7032dSJohn Scipione	\param[out] _height Pointer to a \c float to store the height of the view.
37047852bffSJohn Scipione
37147852bffSJohn Scipione	\since BeOS R3
3726ec25bbaSAdrien Destugues*/
3736ec25bbaSAdrien Destugues
3746ec25bbaSAdrien Destugues
375a33f8fbdSAdrien Destugues/*!
376a33f8fbdSAdrien Destugues	\fn virtual BSize BBox::MinSize()
3776ac7032dSJohn Scipione	\brief Gets the minimum possible size of the BBox object.
3786ec25bbaSAdrien Destugues
3796ac7032dSJohn Scipione	Drawing the box at this size ensures the label and the child view are
3806ac7032dSJohn Scipione	visible. Reducing the size even more would mean that a view would not
3816ac7032dSJohn Scipione	be visible.
38247852bffSJohn Scipione
38347852bffSJohn Scipione	\since Haiku R1
3846ec25bbaSAdrien Destugues*/
3856ec25bbaSAdrien Destugues
3866ec25bbaSAdrien Destugues
387a33f8fbdSAdrien Destugues/*!
388a33f8fbdSAdrien Destugues	\fn virtual BSize BBox::MaxSize()
3896ac7032dSJohn Scipione	\brief Gets the maximum possible size of the BBox object.
3906ec25bbaSAdrien Destugues
3916ac7032dSJohn Scipione	The maximum size depends on the maximize size of the child views.
392a33f8fbdSAdrien Destugues
3936ac7032dSJohn Scipione	\returns The maximum possible size of the BBox as a BSize.
39447852bffSJohn Scipione
39547852bffSJohn Scipione	\since Haiku R1
3966ec25bbaSAdrien Destugues*/
3976ec25bbaSAdrien Destugues
3986ec25bbaSAdrien Destugues
399a33f8fbdSAdrien Destugues/*!
400a33f8fbdSAdrien Destugues	\fn virtual BSize BBox::PreferredSize()
4016ac7032dSJohn Scipione	\brief Returns the preferred size of the box.
4026ec25bbaSAdrien Destugues
4036ac7032dSJohn Scipione	This method works the same as GetPreferredSize, but uses the more
4046ac7032dSJohn Scipione	convenient BSize object.
405a33f8fbdSAdrien Destugues
4066ac7032dSJohn Scipione	\returns The minimum possible size of the BBox as a BSize.
40747852bffSJohn Scipione
40847852bffSJohn Scipione	\since Haiku R1
4096ec25bbaSAdrien Destugues*/
4106ec25bbaSAdrien Destugues
4116ec25bbaSAdrien Destugues
412a33f8fbdSAdrien Destugues/*!
413a33f8fbdSAdrien Destugues	\fn virtual void BBox::DoLayout()
4146ac7032dSJohn Scipione	\brief Lays out the box moving everything into its appropriate position.
4156ec25bbaSAdrien Destugues
4166ac7032dSJohn Scipione	This only works if the BBox object was constructed using the Layout API,
417a33f8fbdSAdrien Destugues	i.e. it was created with one of the BRect-less constructors.
41801c2a7f3SAdrien Destugues
4196ac7032dSJohn Scipione	Once the size of the box is known from laying out its parent views,
4206ac7032dSJohn Scipione	this method is called so the box can adjust the position and size of the
4216ac7032dSJohn Scipione	label, eventually truncating the label text if there is not enough space.
4226ac7032dSJohn Scipione	The exact border positions are also computed, then the child view is also
4236ac7032dSJohn Scipione	laid out if its size constraints change.
42447852bffSJohn Scipione
42547852bffSJohn Scipione	\since Haiku R1
4266ec25bbaSAdrien Destugues*/
427