iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
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. More...
 
IRECT GetItemBounds (int nodeIndex) const
 Get the bounds for a particular flex item. More...
 

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 21 of file IGraphicsFlexBox.h.

Constructor & Destructor Documentation

◆ IFlexBox()

IFlexBox::IFlexBox ( )

Definition at line 16 of file IGraphicsFlexBox.cpp.

◆ ~IFlexBox()

IFlexBox::~IFlexBox ( )

Definition at line 22 of file IGraphicsFlexBox.cpp.

Member Function Documentation

◆ AddItem() [1/2]

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 44 of file IGraphicsFlexBox.cpp.

◆ AddItem() [2/2]

void IFlexBox::AddItem ( YGNodeRef  item)

Add a flex item manually.

Parameters
itemA new YGNodeRef to add (owndership transferred)

Definition at line 74 of file IGraphicsFlexBox.cpp.

◆ CalcLayout()

void IFlexBox::CalcLayout ( YGDirection  direction = YGDirectionLTR)

Calculate the layout, call after add all items.

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

Definition at line 39 of file IGraphicsFlexBox.cpp.

◆ GetItemBounds()

IRECT IFlexBox::GetItemBounds ( int  nodeIndex) const

Get the bounds for a particular flex item.

Definition at line 87 of file IGraphicsFlexBox.cpp.

◆ GetRootBounds()

IRECT IFlexBox::GetRootBounds ( ) const

Get an IRECT of the root node bounds.

Definition at line 79 of file IGraphicsFlexBox.cpp.

◆ Init()

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: