iPlug2 - C++ Audio Plug-in Framework
Public Member Functions | List of all members
IFlexBox Class Reference

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.
 
IRECT GetItemBounds (int nodeIndex) const
 Get the bounds for a particular flex item.
 

Detailed Description

IFlexBox is a basic C++ helper for Yoga https://yogalayout.com.

For advanced use, probably best just to use Yoga directly

Definition at line 11 of file IGraphicsFlexBox.h.

Member Function Documentation

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.

Parameters
widthPostitive value sets width in pixels, negative value sets percentage or YGUndefined for "auto" https://yogalayout.com/docs/width-height
heightPostitive value sets height In pixels, negative value sets percentage or YGUndefined for "auto" https://yogalayout.com/docs/width-height
alignSelfhttps://yogalayout.com/docs/align-items
growhttps://yogalayout.com/docs/flex
shrinkhttps://yogalayout.com/docs/flex
marginhttps://yogalayout.com/docs/margins-paddings-borders
Returns
YGNodeRef The newly added YGNodeRef for the item (owned by this class)

Definition at line 34 of file IGraphicsFlexBox.cpp.

Referenced by TestFlexBoxControl::OnResize().

void IFlexBox::AddItem ( YGNodeRef  item)

Add a flex item manually.

Parameters
itemA new YGNodeRef to add (owndership transferred)

Definition at line 64 of file IGraphicsFlexBox.cpp.

void IFlexBox::CalcLayout ( YGDirection  direction = YGDirectionLTR)

Calculate the layout, call after add all items.

Parameters
directionhttps://yogalayout.com/docs/layout-direction

Definition at line 29 of file IGraphicsFlexBox.cpp.

Referenced by TestFlexBoxControl::OnResize().

void IFlexBox::Init ( const IRECT r,
YGFlexDirection  direction = YGFlexDirectionRow,
YGJustify  justify = YGJustifyFlexStart,
YGWrap  wrap = YGWrapNoWrap,
float  padding = 0.f,
float  margin = 0.f 
)

The documentation for this class was generated from the following files: