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/SplitLayoutBuilder.h hrev45833
|
|
|
|
* src/kits/interface/SplitLayoutBuilder.cpp hrev45833
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\file SplitLayoutBuilder.h
|
|
|
|
\ingroup layout
|
2020-03-15 13:56:19 +03:00
|
|
|
\ingroup libbe
|
|
|
|
\brief Provides \b deprecated SplitLayoutBuilder class.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class BSplitLayoutBuilder
|
|
|
|
\ingroup libbe
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief \b Deprecated helper class that helps building a \ref BSplitView.
|
|
|
|
|
|
|
|
The modern builder can be found in \ref BLayoutBuilder::Split<>.
|
|
|
|
|
|
|
|
\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 BSplitLayoutBuilder::BSplitLayoutBuilder(orientation orientation=B_HORIZONTAL, float spacing=B_USE_DEFAULT_SPACING)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Create a new layout builder with an underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param orientation The orientation of the split view.
|
|
|
|
\param spacing The spacing of items within the split view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BSplitLayoutBuilder::BSplitLayoutBuilder(BSplitView *view)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Create a new layout builder that operates on an existing \a view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param view The existing view you want the builder to alter.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BSplitView* BSplitLayoutBuilder::SplitView() const
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Get a reference to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\return A borrowed pointer to the current underlaying view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BSplitLayoutBuilder& BSplitLayoutBuilder::GetSplitView(BSplitView **view)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Get a reference to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param[out] view The variable to store a borrowed pointer to the
|
|
|
|
underlying view.
|
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 BSplitLayoutBuilder& BSplitLayoutBuilder::Add(BView *view)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Add a \a view to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param view The \ref BView to add.
|
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 BSplitLayoutBuilder& BSplitLayoutBuilder::Add(BView *view, float weight)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Add a \a view to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param view The \ref BView to add.
|
|
|
|
\param weight The weight of the item.
|
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 BSplitLayoutBuilder& BSplitLayoutBuilder::Add(BLayoutItem *item)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Add a \ref BLayoutItem to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param item The \ref BLayoutItem to add.
|
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 BSplitLayoutBuilder& BSplitLayoutBuilder::Add(BLayoutItem *item, float weight)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Add a \ref BLayoutItem to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param item The \ref BLayoutItem to add.
|
|
|
|
\param weight The weight of the \a item.
|
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 BSplitLayoutBuilder& BSplitLayoutBuilder::SetCollapsible(bool collapsible)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Set the collapsability of the most recently added item.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param collapsible \c true if the item is collapsible, \c false otherwise.
|
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 BSplitLayoutBuilder& BSplitLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Set the insets of the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
\param left The left inset.
|
|
|
|
\param top The top inset.
|
|
|
|
\param right The right inset.
|
|
|
|
\param bottom The bottom inset.
|
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 BSplitLayoutBuilder::operator BSplitView *()
|
2020-03-15 13:56:19 +03:00
|
|
|
\brief Cast the builder to the underlying \ref BSplitView.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-03-15 13:56:19 +03:00
|
|
|
Convenience method for the \ref SplitView() method.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|