DIWNE::Stack
Stack is a helper layout class that manages a set of vertically or horizontally aligned DIWNE panels. More...
#include "DIWNE/Core/Layout/Stack.h"
Inherits from DIWNE::Layout
Inherited by DIWNE::HStack, DIWNE::VStack
Public Types
Name | |
---|---|
enum | Mode { HORIZONTAL, VERTICAL} |
Public Functions
Name | |
---|---|
Stack(NodeEditor & editor, Mode mode)<br>Create a stack. | |
Stack(NodeEditor & editor, Mode mode, DiwnePanel * panel)<br>Create a stack for a specified DIWNE panel, this allows the usage of the spring() method. | |
void | begin()<br>Begin the stack, should be called before beginItem(). |
DiwnePanel * | beginItem()<br>Begins the next stack item. |
void | end()<br>End the stack, called after begin(). |
void | endItem() |
void | setSpacing(float spacing) |
bool | spring(float relSize)<br>Adds a spring corresponding to the layout to the enclosing DIWNE panel. |
Additional inherited members
Public Functions inherited from DIWNE::Layout
Name | |
---|---|
Layout() =default | |
Layout(DiwnePanel * panel) |
Protected Attributes inherited from DIWNE::Layout
Name | |
---|---|
DiwnePanel * | m_panel <br>Panel associated with this layout. |
Detailed Description
class DIWNE::Stack;
class DIWNE::Stack;
Stack is a helper layout class that manages a set of vertically or horizontally aligned DIWNE panels.
Depending on the mode, the width or height of the panels is synced together, and they are aligned to be next to, or above each other. The stack can be used standalone to align items with fixed spacings, or it can be used within another enclosing DIWNE panel so that springs can be used as spacing.
Public Types Documentation
enum Mode
Enumerator | Value | Description |
---|---|---|
HORIZONTAL | ||
VERTICAL |
Public Functions Documentation
function Stack
inline explicit Stack(
NodeEditor & editor,
Mode mode
)
inline explicit Stack(
NodeEditor & editor,
Mode mode
)
Create a stack.
function Stack
inline explicit Stack(
NodeEditor & editor,
Mode mode,
DiwnePanel * panel
)
inline explicit Stack(
NodeEditor & editor,
Mode mode,
DiwnePanel * panel
)
Create a stack for a specified DIWNE panel, this allows the usage of the spring() method.
function begin
void begin()
void begin()
Begin the stack, should be called before beginItem().
function beginItem
DiwnePanel * beginItem()
DiwnePanel * beginItem()
Begins the next stack item.
Return: Panel managing the new item.
In vertical mode, the starting X coordinate of items is locked and vertical springs can be used between items. It is the opposite for horizontal mode.
function end
void end()
void end()
End the stack, called after begin().
function endItem
void endItem()
void endItem()
function setSpacing
inline void setSpacing(
float spacing
)
inline void setSpacing(
float spacing
)
function spring
bool spring(
float relSize
)
bool spring(
float relSize
)
Adds a spring corresponding to the layout to the enclosing DIWNE panel.
See: DiwnePanel::spring()
Return: Whether the spring was truly added.
Should be called between items and requires the Stack to have a reference to the enclosing panel.
Updated on 2025-05-31 at 12:55:31 +0000