Class GridLayout¶
Defined in File layout.h
Page Contents
Inheritance Relationships¶
Base Type¶
public nanogui::Layout
(Class Layout)
Class Documentation¶
-
class
GridLayout
: public nanogui::Layout¶ Grid layout.
Widgets are arranged in a grid that has a fixed grid resolution
resolution
along one of the axes. The layout orientation indicates the fixed dimension; widgets are also appended on this axis. The spacing between items can be specified per axis. The horizontal/vertical alignment can be specified per row and column.Public Functions
-
GridLayout
(Orientation orientation = Orientation::Horizontal, int resolution = 2, Alignment alignment = Alignment::Middle, int margin = 0, int spacing = 0)¶ Create a 2-column grid layout by default.
- Parameters
orientation
: The fixed dimension of this GridLayout.resolution
: The number of rows or columns in the grid (depending on the Orientation).alignment
: How widgets should be aligned within each grid cell.margin
: The amount of spacing to add around the border of the grid.spacing
: The amount of spacing between widgets added to the grid.
-
Orientation
orientation
() const¶ The Orientation of this GridLayout.
-
void
setOrientation
(Orientation orientation)¶ Sets the Orientation of this GridLayout.
-
int
resolution
() const¶ The number of rows or columns (depending on the Orientation) of this GridLayout.
-
void
setResolution
(int resolution)¶ Sets the number of rows or columns (depending on the Orientation) of this GridLayout.
-
int
spacing
(int axis) const¶ The spacing at the specified axis (row or column number, depending on the Orientation).
-
void
setSpacing
(int axis, int spacing)¶ Sets the spacing for a specific axis.
-
void
setSpacing
(int spacing)¶ Sets the spacing for all axes.
-
int
margin
() const¶ The margin around this GridLayout.
-
void
setMargin
(int margin)¶ Sets the margin of this GridLayout.
-
Alignment
alignment
(int axis, int item) const¶ The Alignment of the specified axis (row or column number, depending on the Orientation) at the specified index of that row or column.
-
void
setColAlignment
(const std::vector<Alignment> &value)¶ Use this to set variable Alignment for columns.
-
void
setRowAlignment
(const std::vector<Alignment> &value)¶ Use this to set variable Alignment for rows.
Protected Functions
Protected Attributes
-
Orientation
mOrientation
¶ The Orientation defining this GridLayout.
-
Alignment
mDefaultAlignment
[2]¶ The default Alignment for this GridLayout.
-
int
mResolution
¶ The number of rows or columns before starting a new one, depending on the Orientation.
-
int
mMargin
¶ The margin around this GridLayout.
-