Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
spinedit.h
Go to the documentation of this file.
1#pragma once
2
3#include "widget.h"
4
5namespace gridui {
6
9class SpinEdit : public Widget {
10 template <typename Self, typename Finished>
12
13 using Widget::Widget;
14
15public:
16 void setFontSize(float fontSize) {
17 m_state->set("fontSize", new rbjson::Number(fontSize));
18 }
19
20 float fontSize() const {
21 return data().getDouble("fontSize");
22 }
23
24 void setColor(const std::string& color) {
25 m_state->set("color", new rbjson::String(color));
26 }
27
28 std::string color() const {
29 return data().getString("color");
30 }
31
32 void setValue(float value) {
33 m_state->set("value", new rbjson::Number(value));
34 }
35
36 float value() const {
37 return data().getDouble("value");
38 }
39
40 void setStep(float step) {
41 m_state->set("step", new rbjson::Number(step));
42 }
43
44 float step() const {
45 return data().getDouble("step");
46 }
47
48 void setPrecision(float precision) {
49 m_state->set("precision", new rbjson::Number(precision));
50 }
51
52 float precision() const {
53 return data().getDouble("precision");
54 }
55};
56
57};
void setStep(float step)
Definition spinedit.h:40
float step() const
Definition spinedit.h:44
float fontSize() const
Definition spinedit.h:20
float value() const
Definition spinedit.h:36
float precision() const
Definition spinedit.h:52
void setColor(const std::string &color)
Definition spinedit.h:24
std::string color() const
Definition spinedit.h:28
void setFontSize(float fontSize)
Definition spinedit.h:16
void setValue(float value)
Definition spinedit.h:32
void setPrecision(float precision)
Definition spinedit.h:48
bool set(const std::string &key, rbjson::Value *value)
Definition widget.cpp:27
WidgetState * m_state
Definition widget.h:265
const rbjson::Object & data() const
Definition widget.h:263
Definition arm.h:8