Solo Controller Documentation 1.0
Documentation for the Solo Controller
 
Loading...
Searching...
No Matches
TextBox Class Reference

Composite object containing a "Value" and "Units" Text Box. More...

#include <TextBox.h>

Public Member Functions

 TextBox (Canvas &DestCanvas, uint16_t x, uint16_t y, uint16_t textWidth, uint16_t unitsWidth, uint16_t height, uint16_t baseline, FontList::FontID TextFont, FontList::FontID UnitsFont)
 Generic Constructor.
 
 TextBox (Canvas &DestCanvas, const ConfigTextBox_t *config)
 Simplified construct that accepts one of the pre-defined configuration structures.
 
void begin (void)
 Initializes a specific TextBoxUnits instance.
 
uint16_t width (void) const
 

Static Public Member Functions

static void initializeFonts (void)
 Initializes the fonts and configuration data used by TextBox.
 

Public Attributes

DynamicText Value
 Text box containing the value to be displayed.
 
DynamicText Units
 Text box containing the units to be displayed.
 
const uint16_t X
 
const uint16_t Y
 
const uint16_t WIDTH
 
const uint16_t HEIGHT
 

Static Public Attributes

static Shape_t shape
 
static ConfigList_t config
 Data structure containing a collection of TextBox configuration.
 

Detailed Description

Composite object containing a "Value" and "Units" Text Box.

Before attempting to use this class, the caller must do two things. First the caller must fully initialize the fonts used by this class. This is accomplished by making a call to TextBox::initializeFonts(). Second, the caller must call the TextBox::begin() method after object instantiation.

auto myTextBox = TextBox(myCanvas, TextBox::config.main.kettleTemp);
myTextBox.begin();
myTextBox.Units.update("F", 2);
myTextBox.Value.update(value);
static void initializeFonts(void)
Initializes the fonts and configuration data used by TextBox.
static ConfigList_t config
Data structure containing a collection of TextBox configuration.
Definition TextBox.h:165
TextBox(Canvas &DestCanvas, uint16_t x, uint16_t y, uint16_t textWidth, uint16_t unitsWidth, uint16_t height, uint16_t baseline, FontList::FontID TextFont, FontList::FontID UnitsFont)
Generic Constructor.
Definition TextBox.h:189

Constructor & Destructor Documentation

◆ TextBox() [1/2]

TextBox::TextBox ( Canvas & DestCanvas,
uint16_t x,
uint16_t y,
uint16_t textWidth,
uint16_t unitsWidth,
uint16_t height,
uint16_t baseline,
FontList::FontID TextFont,
FontList::FontID UnitsFont )
inline

Generic Constructor.

Note
A call to TextBox::begin() must be completed after this object is instantiated
Parameters
[in]DestCanvasCanvas that will 'display' the TextBox
[in]xUL x-position of the TextBox within Canvas
[in]yUL y-position of the TextBox within Canvas
[in]textWidthWidth of the "Value" TextBox in pixels
[in]unitsWidthWidth of Text Box holding the "Units"
[in]heightHeight of the TextBox in pixels
[in]baselinePosition of the font's baseline within the TextBox
[in]TextFontGrFont object for "Value"
[in]UnitsFontGrFont object for "Units"

◆ TextBox() [2/2]

TextBox::TextBox ( Canvas & DestCanvas,
const ConfigTextBox_t * config )
inline

Simplified construct that accepts one of the pre-defined configuration structures.

Note
A call to TextBox::begin() must be completed after this object is instantiated
Parameters
[in]DestCanvasCanvas that will 'display' the TextBox
[in]configConfiguration information

Member Function Documentation

◆ begin()

void TextBox::begin ( void )
inline

Initializes a specific TextBoxUnits instance.

Note
This method should be called immediately after an object is instantiated. This method configures the internal data structures used by this object.
Parameters
None.

◆ initializeFonts()

static void TextBox::initializeFonts ( void )
static

Initializes the fonts and configuration data used by TextBox.

Note
This method must be called before instantiating any TextBox objects
Parameters
None.

◆ width()

uint16_t TextBox::width ( void ) const
inline

Member Data Documentation

◆ config

ConfigList_t TextBox::config
static

Data structure containing a collection of TextBox configuration.

◆ HEIGHT

const uint16_t TextBox::HEIGHT

◆ shape

Shape_t TextBox::shape
static

◆ Units

DynamicText TextBox::Units

Text box containing the units to be displayed.

◆ Value

DynamicText TextBox::Value

Text box containing the value to be displayed.

◆ WIDTH

const uint16_t TextBox::WIDTH

◆ X

const uint16_t TextBox::X

◆ Y

const uint16_t TextBox::Y

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