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

Represents a terminal display for BindCanvas. More...

#include <BindTerminal.hpp>

Inheritance diagram for BindTerminal:
BindView

Public Member Functions

uint16_t getBytes (uint8_t *out) override
 Generates and returns the byte data representing the terminal's configuration.
 
uint16_t getDataBytes (uint8_t *out, const char *str, int32_t textColor, bool autoScroll, bool newLine, bool bold, bool italic)
 Generates and returns the byte data representing text to be displayed in the terminal.
 

Public Attributes

int16_t x = 0
 X-coordinate position of the terminal.
 
int16_t y = 0
 Y-coordinate position of the terminal.
 
uint8_t cmdId = 0
 Command ID for the terminal. See the notes for possible cmdId values.
 
int16_t width = 200
 Width of the terminal.
 
int16_t height = 100
 Height of the terminal.
 
int16_t textSize = 10
 Text size of the displayed text.
 
int32_t backColor = UBUNTU
 Background color of the terminal.
 
- Public Attributes inherited from BindView
int16_t tag
 

Detailed Description

Represents a terminal display for BindCanvas.

BindTerminal

The BindTerminal class is designed to create and display a terminal-like text interface within a BindCanvas UI. This terminal can be used for displaying text data, log messages, or other textual information and provides various customization options.

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.
See also
the example folder for more information.

Member Function Documentation

◆ getBytes()

uint16_t BindTerminal::getBytes ( uint8_t *  out)
inlineoverridevirtual

Generates and returns the byte data representing the terminal's configuration.

This function is meant for internal use by the Bind framework and should not be called directly by users. It serializes the terminal's configuration properties into a byte array for communication with BindCanvas.

Parameters
outPointer to the output byte array.
Returns
The number of bytes written to the output array.

Reimplemented from BindView.

◆ getDataBytes()

uint16_t BindTerminal::getDataBytes ( uint8_t *  out,
const char *  str,
int32_t  textColor,
bool  autoScroll,
bool  newLine,
bool  bold,
bool  italic 
)
inline

Generates and returns the byte data representing text to be displayed in the terminal.

Use this method to send text data to the terminal for display. It serializes the text properties including color, formatting, and scrolling behavior into a byte array.

Parameters
outPointer to the output byte array.
strThe text data to be displayed.
textColorThe color of the text.
autoScrollWhether the terminal should automatically scroll to show new text.
newLineWhether a new line should be added after the text.
boldWhether the text should be displayed in bold.
italicWhether the text should be displayed in italic.
Returns
The number of bytes written to the output array.

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