Bind
C++ UI toolkit for Arduino
 
Loading...
Searching...
No Matches
BindTextLabel Class Reference

The BindTextLabel class represents a text label UI element for use with BindCanvas. More...

#include <BindTextLabel.hpp>

Inheritance diagram for BindTextLabel:
BindView

Public Member Functions

 BindTextLabel (const char *cstr)
 Constructs a BindTextLabel with a custom label.
 
 BindTextLabel ()
 Constructs a BindTextLabel with a default label.
 
void setlabel (const char *cstr)
 
void setLabel (const char *cstr)
 Sets the label text for the text label.
 
uint16_t getBytes (uint8_t *out) override
 Retrieves the bytes representing the text label for synchronization.
 

Public Attributes

int16_t x
 X-coordinate position of the text label.
 
int16_t y
 Y-coordinate position of the text label.
 
uint8_t cmdId = 0
 Command ID for the text label. See the notes for possible cmdId values.
 
int16_t fontSize
 Font size for the text label.
 
int32_t color
 Text color for the text label.
 
- Public Attributes inherited from BindView
int16_t tag
 

Detailed Description

The BindTextLabel class represents a text label UI element for use with BindCanvas.

BindTextLabel

BindTextLabel is a class that defines a text label UI element that can be used within BindCanvas-based applications. It inherits from the BindView class and provides functionality to create and customize text labels, including setting labels, positions, font size, and text color.

Note
Possible cmdId values for a BindView and corresponding effects:
  • BIND_ADD_OR_REFRESH_CMD: Adds the object to the canvas (screen) or refreshes the existing one.
  • BIND_DATA_ONLY_CMD: Refreshes the existing object without moving or resizing; updates data, such as text.
  • BIND_REMOVE_CMD: Removes the object from the canvas (screen).
  • BIND_DISABLE_CMD: Disables the object.
  • BIND_ENABLE_CMD: Enables the object.
  • BIND_HIDE_CMD: Hides the object.
  • BIND_VISIBLE_CMD: Restores the object's visibility.

Text labels created with BindTextLabel can be synchronized with BindCanvas through the Bind framework, allowing dynamic text content to be displayed in various applications.

Note
To use BindTextLabel effectively, you can set various properties such as the label, position, font size, and text color.

Constructor & Destructor Documentation

◆ BindTextLabel() [1/2]

BindTextLabel::BindTextLabel ( const char *  cstr)

Constructs a BindTextLabel with a custom label.

This constructor creates a BindTextLabel with a custom text label provided as 'cstr.' The label can be used to define the text content of the label.

Parameters
cstrA pointer to the character array representing the custom label for the text label.

◆ BindTextLabel() [2/2]

BindTextLabel::BindTextLabel ( )
inline

Constructs a BindTextLabel with a default label.

This constructor creates a BindTextLabel with a default label of "TextLabel." You can customize the label later using the 'setLabel' function.

Member Function Documentation

◆ getBytes()

uint16_t BindTextLabel::getBytes ( uint8_t *  out)
inlineoverridevirtual

Retrieves the bytes representing the text label for synchronization.

This function is used to gather the bytes that represent the text label's properties for synchronization.

Parameters
outA pointer to the output buffer where the text label data will be stored.
Returns
The number of bytes written to the output buffer.

Reimplemented from BindView.

◆ setLabel()

void BindTextLabel::setLabel ( const char *  cstr)
inline

Sets the label text for the text label.

This function allows you to set the text label for the text label UI element, providing the content to be displayed.

Parameters
cstrA pointer to the character array representing the label text.

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