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

Simple view to display text on screen. More...

#include <TextView.h>

Inheritance diagram for Boardcore::TextView:
Collaboration diagram for Boardcore::TextView:

Public Member Functions

 TextView (std::string text="", mxgui::Color textColor=mxgui::white, uint8_t padding=1)
 Creates a new TextView.
 
void setVerticalAlignment (VertAlignment alignment)
 
void setHorizontalAlignment (HorizAlignment alignment)
 
void setAlignment (HorizAlignment horizAlign, VertAlignment vertAlign)
 
void setText (std::string text)
 
std::string getText ()
 
virtual void setTextColor (mxgui::Color color)
 
mxgui::Color getTextColor ()
 
virtual void draw (mxgui::DrawingContext &dc) override
 Draw the view in its bounds.
 
void setFont (mxgui::Font font)
 
mxgui::Font getFont ()
 
- Public Member Functions inherited from Boardcore::View
 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 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

short int getTextWidth (std::string text)
 
- Protected Member Functions inherited from Boardcore::View
bool isInvalidated ()
 

Additional Inherited Members

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

Detailed Description

Simple view to display text on screen.

Definition at line 36 of file TextView.h.

Constructor & Destructor Documentation

◆ TextView()

Boardcore::TextView::TextView ( std::string text = "",
mxgui::Color textColor = mxgui::white,
uint8_t padding = 1 )
inline

Creates a new TextView.

Parameters
textText
textColorText color
paddingSpacing from view bounds in pixels

Definition at line 46 of file TextView.h.

Member Function Documentation

◆ draw()

virtual void Boardcore::TextView::draw ( mxgui::DrawingContext & dc)
inlineoverridevirtual

Draw the view in its bounds.

Parameters
dcReference to a drawingcontext

Reimplemented from Boardcore::View.

Definition at line 92 of file TextView.h.

◆ getFont()

mxgui::Font Boardcore::TextView::getFont ( )
inline

Definition at line 151 of file TextView.h.

◆ getText()

std::string Boardcore::TextView::getText ( )
inline

Definition at line 79 of file TextView.h.

◆ getTextColor()

mxgui::Color Boardcore::TextView::getTextColor ( )
inline

Definition at line 90 of file TextView.h.

◆ getTextWidth()

short int Boardcore::TextView::getTextWidth ( std::string text)
inlineprotected

Definition at line 154 of file TextView.h.

◆ setAlignment()

void Boardcore::TextView::setAlignment ( HorizAlignment horizAlign,
VertAlignment vertAlign )
inline

Definition at line 64 of file TextView.h.

◆ setFont()

void Boardcore::TextView::setFont ( mxgui::Font font)
inline

Definition at line 145 of file TextView.h.

◆ setHorizontalAlignment()

void Boardcore::TextView::setHorizontalAlignment ( HorizAlignment alignment)
inline

Definition at line 58 of file TextView.h.

◆ setText()

void Boardcore::TextView::setText ( std::string text)
inline

Definition at line 70 of file TextView.h.

◆ setTextColor()

virtual void Boardcore::TextView::setTextColor ( mxgui::Color color)
inlinevirtual

Definition at line 81 of file TextView.h.

◆ setVerticalAlignment()

void Boardcore::TextView::setVerticalAlignment ( VertAlignment alignment)
inline

Definition at line 52 of file TextView.h.


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