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

Base class for anything that can be drawn on the screen and interacted with. More...

#include <View.h>

Inheritance diagram for Boardcore::View:

Public Types

using OnInteractionListener = std::function< void(View *, Interaction)>
 

Public Member Functions

 View ()
 
virtual ~View ()
 
virtual void setBounds (Bounds bounds)
 Sets the bounds in which the view will be drawn.
 
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 draw (mxgui::DrawingContext &dc)
 Draw the view in its bounds.
 
virtual std::vector< View * > getChilds ()
 Returns the list of childs.
 
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)
 

Protected Member Functions

bool isInvalidated ()
 

Detailed Description

Base class for anything that can be drawn on the screen and interacted with.

Definition at line 125 of file View.h.

Member Typedef Documentation

◆ OnInteractionListener

Definition at line 128 of file View.h.

Constructor & Destructor Documentation

◆ View()

Boardcore::View::View ( )
inline

Definition at line 130 of file View.h.

◆ ~View()

virtual Boardcore::View::~View ( )
inlinevirtual

Definition at line 131 of file View.h.

Member Function Documentation

◆ addOnInteractionListener()

void Boardcore::View::addOnInteractionListener ( OnInteractionListener  listener)
inline

Definition at line 225 of file View.h.

◆ draw()

virtual void Boardcore::View::draw ( mxgui::DrawingContext &  dc)
inlinevirtual

Draw the view in its bounds.

Parameters
dcReference to a drawingcontext

Reimplemented in Boardcore::GridLayout, Boardcore::ImageView, Boardcore::OptionView, Boardcore::TextView, and Boardcore::VerticalLayout.

Definition at line 171 of file View.h.

◆ getBackgroundColor()

virtual mxgui::Color Boardcore::View::getBackgroundColor ( )
inlinevirtual

Definition at line 205 of file View.h.

◆ getBounds()

Bounds Boardcore::View::getBounds ( )
inline

Definition at line 142 of file View.h.

◆ getChilds()

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

Returns the list of childs.

Returns
std::vector<View*>

Reimplemented in Boardcore::GridLayout, Boardcore::OptionView, and Boardcore::VerticalLayout.

Definition at line 190 of file View.h.

◆ invalidate()

void Boardcore::View::invalidate ( )
inline

Signal that what has been previously drawn is now invalid and has to be redrawn.

Definition at line 148 of file View.h.

◆ invalidateTree()

void Boardcore::View::invalidateTree ( )
inline

Invalidate the view tree which has this view as a root.

Definition at line 157 of file View.h.

◆ isInvalidated()

bool Boardcore::View::isInvalidated ( )
inlineprotected

Definition at line 238 of file View.h.

◆ isSelectable()

bool Boardcore::View::isSelectable ( )
inline

Definition at line 215 of file View.h.

◆ isSelected()

bool Boardcore::View::isSelected ( )
inline

Definition at line 223 of file View.h.

◆ performInteraction()

virtual void Boardcore::View::performInteraction ( Interaction  action)
inlinevirtual

Definition at line 230 of file View.h.

◆ setBackgroundColor()

virtual void Boardcore::View::setBackgroundColor ( mxgui::Color  color)
inlinevirtual

Definition at line 196 of file View.h.

◆ setBounds()

virtual void Boardcore::View::setBounds ( Bounds  bounds)
inlinevirtual

Sets the bounds in which the view will be drawn.

Reimplemented in Boardcore::GridLayout, Boardcore::OptionView, and Boardcore::VerticalLayout.

Definition at line 136 of file View.h.

◆ setSelectable()

void Boardcore::View::setSelectable ( bool  selectable)
inline

Definition at line 213 of file View.h.

◆ setSelected()

void Boardcore::View::setSelected ( bool  selected)
inline

Definition at line 217 of file View.h.

◆ setSelectedColor()

void Boardcore::View::setSelectedColor ( mxgui::Color  color)
inline

Definition at line 207 of file View.h.


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