1#ifndef __BINDSWITCH_HPP
2#define __BINDSWITCH_HPP
4#include "BindUtils.hpp"
81 strLength = strlen(str);
82 if (strLength > MAX_STRING_LENGTH_TERMINAL)
84 strLength = MAX_STRING_LENGTH_TERMINAL;
86 copyAndOffset(out, &offset, &objID,
sizeof(objID));
87 copyAndOffset(out, &offset, &
x, 2);
88 copyAndOffset(out, &offset, &
y, 2);
89 copyAndOffset(out, &offset, &tag, 2);
90 copyAndOffset(out, &offset, &
cmdId,
sizeof(
cmdId));
94 copyAndOffset(out, &offset, str, strLength);
99 uint8_t objID = BIND_ID_TOGGLE_SWITCH;
Represents a toggle switch UI element in the Bind framework.
Definition BindSwitch.hpp:32
int16_t y
Y-coordinate position of the toggle switch.
Definition BindSwitch.hpp:53
BindSwitch()
Default constructor to create a BindSwitch with a default label ("Switch").
Definition BindSwitch.hpp:47
uint16_t getBytes(uint8_t *out) override
Generates and returns the byte data representing the toggle switch configuration.
Definition BindSwitch.hpp:78
uint8_t cmdId
Command identifier. See the notes for possible cmdId values.
Definition BindSwitch.hpp:54
bool switchValue
The current state (ON/OFF) of the toggle switch.
Definition BindSwitch.hpp:55
int32_t textColor
Text color for the switch label.
Definition BindSwitch.hpp:57
void setlabel(const char *cstr)
Sets the label text for the toggle switch.
Definition BindSwitch.hpp:64
int16_t fontSize
Font size for the switch label.
Definition BindSwitch.hpp:56
int16_t x
X-coordinate position of the toggle switch.
Definition BindSwitch.hpp:52
BindSwitch(const char *cstr)
Constructor to create a BindSwitch with a custom label.
Definition BindSwitch.hpp:39
Definition BindView.hpp:22