API Documentation
Public Member Functions | List of all members
nkWinUi::RelativeLayout Class Referencefinal

Implements a layout positioning its children components relative to each other. More...

Inheritance diagram for nkWinUi::RelativeLayout:
nkWinUi::Layout nkExport::Exportable

Public Member Functions

 RelativeLayout (System *system) noexcept
 
virtual ~RelativeLayout ()
 
ComponentgetComponentAt (unsigned int index) const
 
virtual void setParentComponent (Component *parent) override
 
void addComponent (Component *component, const nkMaths::Rectangle &area)
 
void addComponent (Component *component, const nkMaths::Rectangle &area, RELATIVE_POSITION position, Component *relativeTo)
 
virtual void removeComponent (Component *component) override
 
virtual void update () override
 
virtual void exportComponentsNodeEntry (nkExport::Node *rootNode) override
 
virtual void processComponentsNodeEntry (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkWinUi::Layout
 Layout (System *system) noexcept
 
virtual ~Layout ()
 
ComponentgetParentComponent () const
 
SystemgetSystem () const
 
LAYOUT_TYPE getType () const
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable () noexcept
 
virtual ~Exportable ()
 

Detailed Description

Implements a layout positioning its children components relative to each other.

Constructor & Destructor Documentation

◆ RelativeLayout()

nkWinUi::RelativeLayout::RelativeLayout ( System system)
noexcept

Constructor.

Parameters
systemThe parent system in which the layout will live.

◆ ~RelativeLayout()

virtual nkWinUi::RelativeLayout::~RelativeLayout ( )
virtual

Destructor.

Member Function Documentation

◆ getComponentAt()

Component* nkWinUi::RelativeLayout::getComponentAt ( unsigned int  index) const
Parameters
indexThe wanted component's index.
Returns
The child component at given index, if available. If out of bounds, nullptr.

◆ setParentComponent()

virtual void nkWinUi::RelativeLayout::setParentComponent ( Component parent)
overridevirtual

◆ addComponent() [1/2]

void nkWinUi::RelativeLayout::addComponent ( Component component,
const nkMaths::Rectangle area 
)

Adds a child component to be placed by this layout.

Parameters
componentThe component to place.
areaThe area this component will have in the layout.
Remarks
Can be called for components that should act as anchor in the layout.

◆ addComponent() [2/2]

void nkWinUi::RelativeLayout::addComponent ( Component component,
const nkMaths::Rectangle area,
RELATIVE_POSITION  position,
Component relativeTo 
)

Adds a child component to be place by this layout.

Parameters
componentThe component to place.
areaThe area this component will have in the layout, relative to the relativeTo component.
positionThe position the component should have, compared to the relativeTo component.
relativeToThe component being the anchor to place the new child component to add. It should be part of this layout, already.

◆ removeComponent()

virtual void nkWinUi::RelativeLayout::removeComponent ( Component component)
overridevirtual

◆ update()

virtual void nkWinUi::RelativeLayout::update ( )
overridevirtual

◆ exportComponentsNodeEntry()

virtual void nkWinUi::RelativeLayout::exportComponentsNodeEntry ( nkExport::Node rootNode)
overridevirtual

◆ processComponentsNodeEntry()

virtual void nkWinUi::RelativeLayout::processComponentsNodeEntry ( nkExport::Node rootNode)
overridevirtual

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