91 int _marginBottom = 0;
146 enum Type { WidgetItem, LayoutItem, StretchItem };
150 int stretchFactor = 0;
189 int rowSpan = 1,
int colSpan = 1);
Dynamic array container wrapping std::vector.
Definition list.h:40
Base object for promeki.
Definition objectbase.h:129
ObjectBase * parent() const
Returns the parent object, if one. nullptr if none.
Definition objectbase.h:258
Layout that arranges widgets in a horizontal or vertical line.
Definition layout.h:112
TuiBoxLayout(TuiBoxDirection direction, ObjectBase *parent=nullptr)
Constructs a TuiBoxLayout.
void addStretch(int factor=1)
Adds a stretch item with the given factor.
TuiBoxDirection direction() const
Returns the direction.
Definition layout.h:123
Size2Di32 sizeHint() const override
Returns the preferred size based on children and direction.
void calculateLayout(const Rect2Di32 &available) override
Calculates and applies the layout.
void addWidget(TuiWidget *widget) override
Adds a widget to the ordered item list.
void addLayout(TuiLayout *layout) override
Adds a sub-layout to the ordered item list.
void setStretch(int index, int factor)
Sets the stretch factor for the item at the given index.
Grid layout with rows and columns.
Definition layout.h:180
void setRowStretch(int row, int factor)
Sets the stretch factor for a row.
void addWidget(TuiWidget *widget, int row, int col, int rowSpan=1, int colSpan=1)
Adds a widget at the given row/column with optional span.
void setRowMinimumHeight(int row, int height)
Sets the minimum height for a row.
void setColumnStretch(int col, int factor)
Sets the stretch factor for a column.
void setColumnMinimumWidth(int col, int width)
Sets the minimum width for a column.
void calculateLayout(const Rect2Di32 &available) override
Calculates and applies the layout.
Horizontal box layout (left to right).
Definition layout.h:160
Abstract base class for TUI layout managers.
Definition layout.h:26
int spacing() const
Returns the spacing.
Definition layout.h:51
void removeWidget(TuiWidget *widget)
Removes a widget from this layout.
Rect2Di32 contentRect(const Rect2Di32 &available) const
Returns the content rect after subtracting margins.
void margins(int &top, int &right, int &bottom, int &left) const
Returns the margins.
Definition layout.h:54
virtual void calculateLayout(const Rect2Di32 &available)=0
Calculates and applies the layout to the given rectangle.
virtual void addWidget(TuiWidget *widget)
Adds a widget to this layout.
virtual Size2Di32 sizeHint() const
Returns the preferred size for this layout based on its children.
void setMargins(int margin)
Sets uniform margins.
Definition layout.h:45
virtual void addLayout(TuiLayout *layout)
Adds a nested layout.
const List< TuiWidget * > & widgets() const
Returns the list of managed widgets.
Definition layout.h:73
void setSpacing(int spacing)
Sets the spacing between items.
Definition layout.h:48
void setMargins(int top, int right, int bottom, int left)
Sets the margins (top, right, bottom, left).
const List< TuiLayout * > & layouts() const
Returns the list of sub-layouts.
Definition layout.h:76
Vertical box layout (top to bottom).
Definition layout.h:170
TuiBoxDirection
Box layout direction.
Definition layout.h:98
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19
TextStream & right(TextStream &s)
Sets field alignment to Right.
Definition textstream.h:451
TextStream & left(TextStream &s)
Sets field alignment to Left.
Definition textstream.h:445