|
iPlug2 - C++ Audio Plug-in Framework
|
IFlexBox is a basic C++ helper for Yoga https://yogalayout.com. More...
#include <IGraphicsFlexBox.h>
Public Member Functions | |
| void | Init (const IRECT &r, YGFlexDirection direction=YGFlexDirectionRow, YGJustify justify=YGJustifyFlexStart, YGWrap wrap=YGWrapNoWrap, float padding=0.f, float margin=0.f) |
| Initialize the IFlexBox flex container. More... | |
| YGNodeRef | AddItem (float width, float height, YGAlign alignSelf=YGAlignAuto, float grow=0.f, float shrink=1.f, float margin=0.f) |
| Add a flex item, with some parameters. More... | |
| void | AddItem (YGNodeRef item) |
| Add a flex item manually. More... | |
| void | CalcLayout (YGDirection direction=YGDirectionLTR) |
| Calculate the layout, call after add all items. More... | |
| IRECT | GetRootBounds () const |
| Get an IRECT of the root node bounds. More... | |
| IRECT | GetItemBounds (int nodeIndex) const |
| Get the bounds for a particular flex item. More... | |
IFlexBox is a basic C++ helper for Yoga https://yogalayout.com.
For advanced use, probably best just to use Yoga directly
Definition at line 21 of file IGraphicsFlexBox.h.
| IFlexBox::IFlexBox | ( | ) |
Definition at line 16 of file IGraphicsFlexBox.cpp.
| IFlexBox::~IFlexBox | ( | ) |
Definition at line 22 of file IGraphicsFlexBox.cpp.
| YGNodeRef IFlexBox::AddItem | ( | float | width, |
| float | height, | ||
| YGAlign | alignSelf = YGAlignAuto, |
||
| float | grow = 0.f, |
||
| float | shrink = 1.f, |
||
| float | margin = 0.f |
||
| ) |
Add a flex item, with some parameters.
| width | Postitive value sets width in pixels, negative value sets percentage or YGUndefined for "auto" https://yogalayout.com/docs/width-height |
| height | Postitive value sets height In pixels, negative value sets percentage or YGUndefined for "auto" https://yogalayout.com/docs/width-height |
| alignSelf | https://yogalayout.com/docs/align-items |
| grow | https://yogalayout.com/docs/flex |
| shrink | https://yogalayout.com/docs/flex |
| margin | https://yogalayout.com/docs/margins-paddings-borders |
Definition at line 44 of file IGraphicsFlexBox.cpp.
| void IFlexBox::AddItem | ( | YGNodeRef | item | ) |
Add a flex item manually.
| item | A new YGNodeRef to add (owndership transferred) |
Definition at line 74 of file IGraphicsFlexBox.cpp.
| void IFlexBox::CalcLayout | ( | YGDirection | direction = YGDirectionLTR | ) |
Calculate the layout, call after add all items.
| direction | https://yogalayout.com/docs/layout-direction |
Definition at line 39 of file IGraphicsFlexBox.cpp.
| IRECT IFlexBox::GetItemBounds | ( | int | nodeIndex | ) | const |
Get the bounds for a particular flex item.
Definition at line 87 of file IGraphicsFlexBox.cpp.
| IRECT IFlexBox::GetRootBounds | ( | ) | const |
Get an IRECT of the root node bounds.
Definition at line 79 of file IGraphicsFlexBox.cpp.
| void IFlexBox::Init | ( | const IRECT & | r, |
| YGFlexDirection | direction = YGFlexDirectionRow, |
||
| YGJustify | justify = YGJustifyFlexStart, |
||
| YGWrap | wrap = YGWrapNoWrap, |
||
| float | padding = 0.f, |
||
| float | margin = 0.f |
||
| ) |
Initialize the IFlexBox flex container.
| r | The IRECT bounds for the flex container |
| direction | https://yogalayout.com/docs/flex-direction |
| justify | https://yogalayout.com/docs/justify-content |
| wrap | https://yogalayout.com/docs/flex-wrap |
| padding | https://yogalayout.com/docs/margins-paddings-borders |
| margin | https://yogalayout.com/docs/margins-paddings-borders |
Definition at line 28 of file IGraphicsFlexBox.cpp.
References IRECT::H(), and IRECT::W().