2019-09-20 09:34:29 +03:00
|
|
|
/*
|
2020-03-15 13:56:19 +03:00
|
|
|
* Copyright 2020 Haiku, Inc. All rights reserved.
|
2019-09-20 09:34:29 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
2020-03-15 13:56:19 +03:00
|
|
|
* Niels Sascha Reedijk, niels.reedijk@gmail.com
|
2019-09-20 09:34:29 +03:00
|
|
|
*
|
|
|
|
* Corresponds to:
|
|
|
|
* headers/os/interface/GridLayoutBuilder.h hrev38512
|
|
|
|
* src/kits/interface/GridLayoutBuilder.cpp hrev45833
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\file GridLayoutBuilder.h
|
2020-03-15 13:56:19 +03:00
|
|
|
\ingroup libbe
|
|
|
|
\brief Provides \b deprecated GridLayoutBuilder class.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class BGridLayoutBuilder
|
|
|
|
\ingroup layout
|
|
|
|
\ingroup libbe
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief \b Deprecated helper class that helps building a \ref BGridLayout.
|
|
|
|
|
|
|
|
The modern builder can be found in \ref BLayoutBuilder::Grid<>.
|
|
|
|
|
|
|
|
\warning This class is deprecated and should not be used in new projects.
|
|
|
|
It may be removed in newer releases.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder::BGridLayoutBuilder(float horizontal=B_USE_DEFAULT_SPACING, float vertical=B_USE_DEFAULT_SPACING)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Create a new layout builder with a new underlying \ref BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param horizontal Horizontal spacing.
|
|
|
|
\param vertical Vertical Spacing
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder::BGridLayoutBuilder(BGridLayout *layout)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Create a new layout builder that operates on a \a layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param layout The existing layout you want the builder to alter.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder::BGridLayoutBuilder(BGridView *view)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Create a new layout builder that operates on a \a view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param view The existing grid view you want the builder to alter.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayout* BGridLayoutBuilder::GridLayout() const
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Get a reference to the underlying \ref BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return A borrowed pointer to the current underlaying layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::GetGridLayout(BGridLayout **_layout)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Get a reference to the underlying \ref BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param[out] _layout The variable to store a borrowed pointer to the
|
|
|
|
underlying layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BView* BGridLayoutBuilder::View() const
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Get a reference to the owning \ref BView.
|
|
|
|
|
|
|
|
Returns the same BView* as BLayout::Owner(), this method is inherited from
|
|
|
|
BLayoutItem.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return A borrowed pointer to the owning \ref BView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::GetView(BView **_view)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Get a reference to the owning \ref BView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param[out] _view The variable to store the borrowed pointer to the owning
|
|
|
|
\ref BView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::Add(BView *view, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Add a \a view to the underlying \ref BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param view The BView to add.
|
|
|
|
\param column The column number (zero-based) to use.
|
|
|
|
\param row The row number (zero-based) to use.
|
|
|
|
\param columnCount The number of columns to span over.
|
|
|
|
\param rowCount The number of rows to span over.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::Add(BLayoutItem *item, int32 column, int32 row, int32 columnCount=1, int32 rowCount=1)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Add a \ref BLayoutItem to the underlying \ref BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param item The \ref BLayoutItem to add.
|
|
|
|
\param column The column number (zero-index) to use.
|
|
|
|
\param row The row number (zero-index) to use.
|
|
|
|
\param columnCount The number of columns to span over.
|
|
|
|
\param rowCount The number of rows to span over.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::SetColumnWeight(int32 column, float weight)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Set the weight for \a column to \a weight.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param column The column to set.
|
|
|
|
\param weight The weight to set.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::SetRowWeight(int32 row, float weight)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Set the weight of \a row to \a weight.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param row The \a row number.
|
|
|
|
\param weight The \a weight to set.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder& BGridLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Set the insets for the layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param left The left inset as a \c float.
|
|
|
|
\param top The top inset as a \c float.
|
|
|
|
\param right The right inset as a \c float.
|
|
|
|
\param bottom The bottom inset as a \c float.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return The method returns a self reference, so that calls to the builder
|
|
|
|
may be chained.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayoutBuilder::operator BGridLayout *()
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Casts the builder to the underlying \ref BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
Convenience method for the \ref GridLayout() method.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|