CheeseBoard
A library for use with the CheeseBoard Cheddar platform
Public Member Functions | Protected Attributes | List of all members
GfxTextBox2 Class Reference
Inheritance diagram for GfxTextBox2:
Inheritance graph

Public Member Functions

 GfxTextBox2 (String initialText, GfxFont &font=GfxDefaultFont, bool border=true, uint8_t padding=1, char justify='C', uint16_t width=0, uint16_t height=0)
 
void draw (uint16_t xOffset=0, uint16_t yOffset=0)
 
uint16_t width ()
 
uint16_t height ()
 
const String & text ()
 
void setText (const String &newText)
 

Protected Attributes

String _text
 
GfxFont_font
 
bool _border
 
uint8_t _padding
 
bool _justify
 
uint16_t _width
 
uint16_t _height
 

Detailed Description

Definition at line 8 of file GfxTextBox2.h.

Constructor & Destructor Documentation

◆ GfxTextBox2()

GfxTextBox2::GfxTextBox2 ( String  initialText,
GfxFont font = GfxDefaultFont,
bool  border = true,
uint8_t  padding = 1,
char  justify = 'C',
uint16_t  width = 0,
uint16_t  height = 0 
)

Constructor.

Parameters
initialTextthe initial text in the box
fontthe font to be used. If NULL, the default font will be used
borderwhether or not to draw the border around the text box
paddinghow many pixels padding between the border and the font
justify'L', 'C', or 'R' (left, center, right)
widththe width in pixels. If 0, determine width from font/text
heightthe height in pixels. If 0, determine width from font/text

Definition at line 5 of file GfxTextBox2.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ draw()

void GfxTextBox2::draw ( uint16_t  xOffset = 0,
uint16_t  yOffset = 0 
)
virtual

Draw it.

Draws the bext box, starting at the top left corner specified by (xOffset,yOffset)

Implements GfxItem.

Definition at line 28 of file GfxTextBox2.cpp.

Here is the call graph for this function:

◆ height()

uint16_t GfxTextBox2::height ( )
virtual

Get the height of the text box.

Implements GfxItem.

Definition at line 56 of file GfxTextBox2.cpp.

◆ setText()

void GfxTextBox2::setText ( const String &  newText)

Update the text in the text box.

Definition at line 65 of file GfxTextBox2.cpp.

◆ text()

const String & GfxTextBox2::text ( )

Get the text in the text box.

Definition at line 60 of file GfxTextBox2.cpp.

◆ width()

uint16_t GfxTextBox2::width ( )
virtual

Get the width of the text box.

Implements GfxItem.

Definition at line 51 of file GfxTextBox2.cpp.


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