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 "../widgets/spinedit.h"
4#include "widget.h"
5
6namespace gridui {
7namespace builder {
8
11class SpinEdit : public Widget, public BuilderMixin<SpinEdit, gridui::SpinEdit> {
12 static const char* name() { return "SpinEdit"; }
13
14 friend class gridui::_GridUi;
15 using Widget::Widget;
16
17public:
19 extra().set("fontSize", fontSize);
20 return *this;
21 }
22
23 SpinEdit& color(const std::string& color) {
24 extra().set("color", color);
25 return *this;
26 }
27
29 extra().set("value", value);
30 return *this;
31 }
32
33 SpinEdit& step(float step) {
34 extra().set("step", step);
35 return *this;
36 }
37
39 extra().set("precision", precision);
40 return *this;
41 }
42
46 addCallback("changed", cb);
47 return *this;
48 }
49};
50
51};
52};
std::function< void(gridui::SpinEdit &)> callback_t
Definition widget.h:41
void addCallback(const std::string &name, const callback_t &cb)
Definition widget.h:54
SpinEdit & fontSize(float fontSize)
Definition spinedit.h:18
SpinEdit & color(const std::string &color)
Definition spinedit.h:23
SpinEdit & precision(float precision)
Definition spinedit.h:38
SpinEdit & step(float step)
Definition spinedit.h:33
SpinEdit & value(float value)
Definition spinedit.h:28
rbjson::Object & extra()
Definition widget.cpp:16
SpinEdit & onChanged(callback_t cb)
Definition spinedit.h:45
Definition arm.h:8