ControlGrid
The ControlGrid class is a layout control derived from Control that arranges child controls in a grid structure with configurable columns and spacing. It allows dynamic adjustment of the number of columns, spacing between items, and individual column width ratios to create flexible UI layouts. The class provides methods to retrieve the size occupied by all child controls, making it useful for auto-layout and responsive interface design.
#include <interface/TellusimControls.h>
Inheritance
- Inherits from Control
Constructors
ControlGrid()
explicit ControlGrid(Control *parent)
ControlGrid(Control *parent, uint32_t columns)
ControlGrid(Control *parent, uint32_t columns, float32_t x, float32_t y = 0.0f)
Methods
Number of columns.
void setColumns(uint32_t columns)
uint32_t getColumns() const
Grid spacing.
void setSpacing(Vector2f spacing)
void setSpacing(float32_t x, float32_t y)
const Vector2f getSpacing() const
Grid column ratio.
void setColumnRatio(uint32_t index, float32_t ratio)
float32_t getColumnRatio(uint32_t index) const
Controls size.
const Vector2f getControlsSize() const