Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::VerticalLayout Class Reference

Positions the childs in a vertical grid. The height of each child is dictated by its weight parameter. More...

#include <VerticalLayout.h>

Inheritance diagram for Boardcore::VerticalLayout:
Collaboration diagram for Boardcore::VerticalLayout:

Public Member Functions

 VerticalLayout (short int spacing=0)
 Creates a new VerticalLayout.
 
void addView (View *view, float weight)
 Adds a view to the layout.
 
void setBounds (Bounds bounds) override
 Sets the bounds in which the view will be drawn.
 
void draw (mxgui::DrawingContext &dc) override
 Draw the view in its bounds.
 
virtual std::vector< View * > getChilds () override
 Returns the list of childs.
 
- Public Member Functions inherited from Boardcore::View
 View ()
 
virtual ~View ()
 
Bounds getBounds ()
 
void invalidate ()
 Signal that what has been previously drawn is now invalid and has to be redrawn.
 
void invalidateTree ()
 Invalidate the view tree which has this view as a root.
 
virtual void setBackgroundColor (mxgui::Color color)
 
virtual mxgui::Color getBackgroundColor ()
 
void setSelectedColor (mxgui::Color color)
 
void setSelectable (bool selectable)
 
bool isSelectable ()
 
void setSelected (bool selected)
 
bool isSelected ()
 
void addOnInteractionListener (OnInteractionListener listener)
 
virtual void performInteraction (Interaction action)
 

Additional Inherited Members

- Public Types inherited from Boardcore::View
using OnInteractionListener = std::function<void(View*, Interaction)>
 
- Protected Member Functions inherited from Boardcore::View
bool isInvalidated ()
 

Detailed Description

Positions the childs in a vertical grid. The height of each child is dictated by its weight parameter.

Definition at line 34 of file VerticalLayout.h.

Constructor & Destructor Documentation

◆ VerticalLayout()

Boardcore::VerticalLayout::VerticalLayout ( short int spacing = 0)
inline

Creates a new VerticalLayout.

Parameters
spacingVertical space between each child in pixels

Definition at line 42 of file VerticalLayout.h.

Member Function Documentation

◆ addView()

void Boardcore::VerticalLayout::addView ( View * view,
float weight )
inline

Adds a view to the layout.

Parameters
viewPointer to the view to be added
weightRelative weight of the view to determine its display height

Definition at line 50 of file VerticalLayout.h.

◆ draw()

void Boardcore::VerticalLayout::draw ( mxgui::DrawingContext & dc)
inlineoverridevirtual

Draw the view in its bounds.

Parameters
dcReference to a drawingcontext

Reimplemented from Boardcore::View.

Definition at line 71 of file VerticalLayout.h.

◆ getChilds()

virtual std::vector< View * > Boardcore::VerticalLayout::getChilds ( )
inlineoverridevirtual

Returns the list of childs.

Returns
std::vector<View*>

Reimplemented from Boardcore::View.

Definition at line 79 of file VerticalLayout.h.

◆ setBounds()

void Boardcore::VerticalLayout::setBounds ( Bounds bounds)
inlineoverridevirtual

Sets the bounds in which the view will be drawn.

Reimplemented from Boardcore::View.

Definition at line 64 of file VerticalLayout.h.


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