2019-09-20 09:34:29 +03:00
|
|
|
/*
|
2020-04-18 09:27:42 +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-04-18 09:27:42 +03:00
|
|
|
* Niels Sascha Reedijk, niels.reedijk@gmail.com
|
2019-09-20 09:34:29 +03:00
|
|
|
*
|
|
|
|
* Corresponds to:
|
|
|
|
* headers/os/interface/GridView.h hrev43514
|
|
|
|
* src/kits/interface/GridView.cpp hrev49777
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\file GridView.h
|
|
|
|
\ingroup layout
|
2020-04-18 09:27:42 +03:00
|
|
|
\brief Provides the BGridView class.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\class BGridView
|
|
|
|
\ingroup layout
|
|
|
|
\ingroup libbe
|
2020-04-18 09:27:42 +03:00
|
|
|
\brief Container view for a collection of views organized in a grid.
|
|
|
|
|
|
|
|
This class is a convencience class, that creates a BView with a BGridView
|
|
|
|
set up by default.
|
|
|
|
|
|
|
|
You place views in the grid in a table-like structure, that consists of
|
|
|
|
rows and columns. It is not required to put views in every cell in the
|
|
|
|
table. By default, the view has the default system grey background.
|
|
|
|
|
|
|
|
\see BGridLayout for more information on how and when to use this
|
|
|
|
type of container.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-18 09:27:42 +03:00
|
|
|
\fn BGridView::BGridView(float horizontal, float vertical)
|
|
|
|
\brief Creates a new grid view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
\param horizontal The horizontal padding between the columns that contain
|
|
|
|
views.
|
|
|
|
\param vertical The vertical padding between the rows that contain views.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-18 09:27:42 +03:00
|
|
|
\fn BGridView::BGridView(const char *name, float horizontal,
|
|
|
|
float vertical)
|
|
|
|
\brief Creates a new grid view with a \a name.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
\param name The name for the view.
|
|
|
|
\param horizontal The horizontal padding between the columns that contain
|
|
|
|
views.
|
|
|
|
\param vertical The vertical padding between the rows that contain views.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridView::BGridView(BMessage *from)
|
2020-04-18 09:27:42 +03:00
|
|
|
\brief Constructs a BGridView \a from an archive message.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
This method is usually not called directly, if you want to build a
|
|
|
|
grid view from an archived message you should call Instantiate() instead
|
|
|
|
because it can handle errors properly.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
\param from The \ref BMessage that contains the grid view.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-18 09:27:42 +03:00
|
|
|
\fn virtual BGridView::~BGridView()
|
|
|
|
\brief Destructor.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-18 09:27:42 +03:00
|
|
|
\fn virtual void BGridView::SetLayout(BLayout *layout)
|
|
|
|
\brief Adopt a given grid \a layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
\param layout The layout to set to. This must be a BGridLayout, or a
|
|
|
|
derivative. Any other layout types will be ignored.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn BGridLayout* BGridView::GridLayout() const
|
2020-04-18 09:27:42 +03:00
|
|
|
\brief Get a pointer to the underlying BGridLayout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
\return A pointer to the underlying grid layout.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-18 09:27:42 +03:00
|
|
|
\fn virtual status_t BGridView::Perform(perform_code d, void *arg)
|
|
|
|
\brief Perform some action. (Internal Method)
|
2019-09-20 09:34:29 +03:00
|
|
|
|
2020-04-18 09:27:42 +03:00
|
|
|
Reimplemented from BView::Perform()
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
2020-04-18 09:27:42 +03:00
|
|
|
\fn static BArchivable* BGridView::Instantiate(BMessage *from)
|
|
|
|
\brief Instantiate the view from the message \a from.
|
2019-09-20 09:34:29 +03:00
|
|
|
|
|
|
|
\since Haiku R1
|
|
|
|
*/
|