Bind
C++ UI toolkit for Arduino
 
Loading...
Searching...
No Matches
BindSeekBar.hpp
1#ifndef __BINDSEEKBAR_HPP
2#define __BINDSEEKBAR_HPP
3#include "BindView.hpp"
4#include "BindUtils.hpp"
22class BindSeekBar : public BindView
23{
24
25public:
26 int16_t x;
27 int16_t y;
28 uint8_t cmdId = 0;
29 int16_t seekValue = 0;
30 int16_t maxValue = 100;
31 int16_t width = 200;
32
43 uint16_t getBytes(uint8_t *out) override
44 {
45 offset = 0;
46 copyAndOffset(out, &offset, &objID, sizeof(objID));
47 copyAndOffset(out, &offset, &x, 2);
48 copyAndOffset(out, &offset, &y, 2);
49 copyAndOffset(out, &offset, &tag, 2);
50 copyAndOffset(out, &offset, &cmdId, sizeof(cmdId));
51 copyAndOffset(out, &offset, &seekValue, sizeof(seekValue));
52 copyAndOffset(out, &offset, &maxValue, sizeof(maxValue));
53 copyAndOffset(out, &offset, &width, sizeof(width));
54 return offset;
55 }
56
57private:
58 uint8_t objID = BIND_ID_SEEK_BAR;
59 uint16_t offset = 0;
60};
61
62#endif /* __BINDSEEKBAR_HPP */
Represents a SeekBar object in the Bind framework.
Definition BindSeekBar.hpp:23
uint8_t cmdId
Command identifier. See the notes for possible cmdId values.
Definition BindSeekBar.hpp:28
uint16_t getBytes(uint8_t *out) override
Serialize the SeekBar data into a byte array.
Definition BindSeekBar.hpp:43
int16_t x
X-coordinate position of the SeekBar.
Definition BindSeekBar.hpp:26
int16_t width
Width of the SeekBar.
Definition BindSeekBar.hpp:31
int16_t maxValue
Maximum value of the SeekBar.
Definition BindSeekBar.hpp:30
int16_t y
Y-coordinate position of the SeekBar.
Definition BindSeekBar.hpp:27
int16_t seekValue
Current value selected on the SeekBar.
Definition BindSeekBar.hpp:29
Definition BindView.hpp:22