haiku/docs/user/interface/TwoDimensionalLayout.dox

154 lines
4.5 KiB
Plaintext
Raw Normal View History

/*!
\class BTwoDimensionalLayout
\ingroup interface
\ingroup layout
\ingroup libbe
\brief Abstract BLayout subclass arranging items within rows and columns.
This class manages all the tricky work of actually positioning/resizing
items, as well as calculating size constraints and providing extra features,
such as spacing/insets and alignment of multiple BTwoDimensionalLayouts.
Derived classes need only implement a few hook methods to get a working
layout.
\warning This class is not yet finalized, if you use it in your software
assume that it will break some time in the future.
*/
/*!
\struct BTwoDimensionalLayout::ColumnRowConstraints
\brief Used by BTwoDimensionalLayout derived classes to communicate the
size constraints for a given column or row to the
BTwoDimensionalLayout class.
*/
/*!
\struct BTwoDimensionalLayout::Dimensions
\brief Used by BTwoDimensionalLayout derived classes to communicate the
positioning and size of a BLayoutItem, in terms of columns and rows to
the BTwoDimensionalLayout class.
*/
/*!
\fn void BTwoDimensionalLayout::AlignLayoutWith(
BTwoDimensionalLayout* other, enum orientation)
\brief Align the BLayoutItems in two BTwoDimensionalLayouts with each other
within a certain orientation.
When two (or more) BTwoDimensionalLayouts are aligned within a certain
orientation, then the BLayoutItems within those BTwoDimensionalLayouts will
have identical widths or heights (depending on how the
BTwoDimensionalLayouts are aligned).
If you align two BGroupLayouts horizontally, for example, then the
BLayoutItems at index 0 in both BGroupLayouts will be given the same
horizontal area. The same is true for the BLayoutItems at index 1, 2, etc..
Not all BTwoDimensionalLayouts have to have an item at each index for the
alignment to proceed.
\param other The BTwoDimensionalLayout to be aligned with.
\param orientation The orientation on which to be aligned.
*/
/*!
\fn void BTwoDimensionalLayout::SetInsets(float left, float top,
float right, float bottom)
\brief Set the insets for this BTwoDimensionalLayout (in pixels).
Set the spacing around the edges of this BTwoDimensionalLayout. If you
pass B_USE_DEFAULT_SPACING for a certain parameter, that parameter will
be replaced with the value returned by BControlLook::DefaultItemSpacing().
\see BTwoDimensionalLayout::GetInsets();
*/
/*!
\fn void BTwoDimensionalLayout::GetInsets(float* left, float* top,
float* right, float* bottom) const
\brief Get the insets for this BTwoDimensionalLayout (in pixels).
Passing NULL for any paramater is not an error, such parameters will
be ignored.
\see BTwoDimensionalLayout::SetInsets();
*/
/*!
\name BTwoDimensionalLayout Hook methods
These methods are called automatically as needed during layout, and
provide the BTwoDimensionalLayout class with the necessary information
to properly layout the BLayoutItems in this BTwoDimensionalLayout.
@{
*/
/*!
\fn void BTwoDimensionalLayout::PrepareItems(enum orientation)
\brief Prepare the BLayoutItems in this BTwoDimensionalLayout subclass
for layout within a certain orientation.
This is a good place to update cache information that will be used in
other hook methods, for example.
*/
/*!
\fn bool BTwoDimensionalLayout::HasMultiColumnItems()
\brief Tests whether or not this BTwoDimensionalLayout contains any
BLayoutItems spanning more than one column.
The BTwoDimensionalLayout implementation returns false.
*/
/*!
\fn bool BTwoDimensionalLayout::HasMultiRowItems()
\brief Tests whether or not this BTwoDimensionalLayout contains any
BLayoutItems spanning more than one row.
The BTwoDimensionalLayout implementation returns false.
*/
/*!
\fn int32 BTwoDimensionalLayout::InternalCountColumns()
\brief Return the number of columns in this BTwoDimensionalLayout.
*/
/*!
\fn int32 BTwoDimensionalLayout::InternalCountRows()
\brief Return the number of rows in this BTwoDimensionalLayout.
*/
/*!
\fn void BTwoDimensionalLayout::GetColumnRowConstraints(enum orientation,
int32 index, ColumnRowConstraints* constraints)
\brief Fill in the ColumnRowConstraints for a certain column or row in
this BTwoDimensionalLayout.
This method is used to communicate the size constraints and weight for
a given row/column in this BTwoDimensionalLayout.
*/
/*!
\fn void BTwoDimensionalLayout::GetItemDimensions(BLayoutItem* item,
Dimensions* dimensions)
\brief Tell the base class what column and row a BLayoutItem is in, as
well as how many columns and rows it covers.
*/
//@}