1/* 2 * Copyright 2020 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Niels Sascha Reedijk, niels.reedijk@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/GridView.h hrev43514 10 * src/kits/interface/GridView.cpp hrev49777 11 */ 12 13 14/*! 15 \file GridView.h 16 \ingroup layout 17 \brief Provides the BGridView class. 18 19 \since Haiku R1 20*/ 21 22 23/*! 24 \class BGridView 25 \ingroup layout 26 \ingroup libbe 27 \brief Container view for a collection of views organized in a grid. 28 29 This class is a convencience class, that creates a BView with a BGridView 30 set up by default. 31 32 You place views in the grid in a table-like structure, that consists of 33 rows and columns. It is not required to put views in every cell in the 34 table. By default, the view has the default system grey background. 35 36 \see BGridLayout for more information on how and when to use this 37 type of container. 38 39 \since Haiku R1 40*/ 41 42 43/*! 44 \fn BGridView::BGridView(float horizontal, float vertical) 45 \brief Creates a new grid view. 46 47 48 \param horizontal The horizontal padding between the columns that contain 49 views. 50 \param vertical The vertical padding between the rows that contain views. 51 52 \since Haiku R1 53*/ 54 55 56/*! 57 \fn BGridView::BGridView(const char *name, float horizontal, 58 float vertical) 59 \brief Creates a new grid view with a \a name. 60 61 \param name The name for the view. 62 \param horizontal The horizontal padding between the columns that contain 63 views. 64 \param vertical The vertical padding between the rows that contain views. 65 66 \since Haiku R1 67*/ 68 69 70/*! 71 \fn BGridView::BGridView(BMessage *from) 72 \brief Constructs a BGridView \a from an archive message. 73 74 This method is usually not called directly, if you want to build a 75 grid view from an archived message you should call Instantiate() instead 76 because it can handle errors properly. 77 78 \param from The \ref BMessage that contains the grid view. 79 80 \since Haiku R1 81*/ 82 83 84/*! 85 \fn virtual BGridView::~BGridView() 86 \brief Destructor. 87 88 \since Haiku R1 89*/ 90 91 92/*! 93 \fn virtual void BGridView::SetLayout(BLayout *layout) 94 \brief Adopt a given grid \a layout. 95 96 \param layout The layout to set to. This must be a BGridLayout, or a 97 derivative. Any other layout types will be ignored. 98 99 \since Haiku R1 100*/ 101 102 103/*! 104 \fn BGridLayout* BGridView::GridLayout() const 105 \brief Get a pointer to the underlying BGridLayout. 106 107 \return A pointer to the underlying grid layout. 108 109 \since Haiku R1 110*/ 111 112 113/*! 114 \fn virtual status_t BGridView::Perform(perform_code d, void *arg) 115 \brief Perform some action. (Internal Method) 116 117 Reimplemented from BView::Perform() 118 119 \since Haiku R1 120*/ 121 122 123/*! 124 \fn static BArchivable* BGridView::Instantiate(BMessage *from) 125 \brief Instantiate the view from the message \a from. 126 127 \since Haiku R1 128*/ 129