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

Button State for a button that displays text in the button. More...

#include <ButtonState.h>

Inheritance diagram for TextButtonState:
ButtonState

Public Member Functions

void begin (void) override
 Initializes the button state object. This method should be called before first use of the object.
 
Constructors and Destructors
 TextButtonState (Canvas &Destination, const Block_Image &DestLoc, const char *_buttonText, FontList::FontID Font, ButtonState::buttonCallbackFunction callback, uint16_t baseline, unsigned short cornerRadius, uint16_t borderWidth, uint16_t borderColor16, uint16_t fillColor16)
 Construct a new Text Button State object.
 
 ~TextButtonState (void)=default
 Destroys the Text Button State object.
 
- Public Member Functions inherited from ButtonState
 ButtonState (Canvas &destCanvas, uint16_t x, uint16_t y, uint16_t width, uint16_t height, buttonCallbackFunction callback, unsigned short cornerRadius, uint8_t borderWidth, uint16_t borderColor, uint16_t fillColor16)
 Construct a new Button State object.
 
virtual ~ButtonState ()=default
 Default destructor.
 
virtual void updateBackground (void)
 Update the button background graphics.
 
virtual void draw (void)
 Draw the button assuming images have transparent background.
 
virtual void drawOpaque (void)
 Draw the button assuming images have an opaque background.
 
virtual void draw (Canvas &newCanvas, bool TransparentOn=true)
 Draw the button onto the specified canvas at the specified location.
 
void callback (void) const
 Calls the callback function associated with this button state.
 
uint16_t width (void) const
 Returns the width of the button state.
 
uint16_t height (void) const
 Returns the height of the button state.
 
uint16_t x (void) const
 Returns the X location of the button state on the destination canvas.
 
uint16_t y (void) const
 Returns the Y location of the button state on the destination canvas.
 

Additional Inherited Members

- Public Types inherited from ButtonState
typedef void(* buttonCallbackFunction) (void)
 Defines the form of the callback functions expected by the Button class.
 
- Protected Attributes inherited from ButtonState
Canvas_ButtonGfxCanvas = nullptr
 Canvas that holds the colorized button graphics. Derived classes will define this canvas as appropriate.
 

Detailed Description

Button State for a button that displays text in the button.

Constructor & Destructor Documentation

◆ TextButtonState()

TextButtonState::TextButtonState ( Canvas & Destination,
const Block_Image & DestLoc,
const char * _buttonText,
FontList::FontID Font,
ButtonState::buttonCallbackFunction callback,
uint16_t baseline,
unsigned short cornerRadius,
uint16_t borderWidth,
uint16_t borderColor16,
uint16_t fillColor16 )
inline

Construct a new Text Button State object.

Parameters
Destination[in] Canvas where the final button will be drawn
DestLoc[in] X-Y location and size of the button within the destination canvas
_buttonText[in] Text to be displayed on the button
Font[in] Font to be used to display the button text
callback[in] Callback function associated with this button state
baseline[in] Baseline position for the characters within the button
cornerRadius[in] Corner radius for the button
borderWidth[in] Border width in pixels of the button border
borderColor16[in] Border color in 16-bit RGB format
fillColor16[in] Fill color in 16-bit RGB format

◆ ~TextButtonState()

TextButtonState::~TextButtonState ( void )
default

Destroys the Text Button State object.

Parameters
None.

Member Function Documentation

◆ begin()

void TextButtonState::begin ( void )
overridevirtual

Initializes the button state object. This method should be called before first use of the object.

Parameters
None.

Reimplemented from ButtonState.


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