Esp32-RBGridUI
Library for creating UIs for the RBController app
Loading...
Searching...
No Matches
slider.h
Go to the documentation of this file.
1#pragma once
2
3#include "../widgets/slider.h"
4#include "widget.h"
5
6namespace gridui {
7namespace builder {
8
11class Slider : public Widget, public BuilderMixin<Slider, gridui::Slider> {
12 static const char* name() { return "Slider"; }
13
14 friend class gridui::_GridUi;
15 using Widget::Widget;
16
17public:
18 Slider& color(const std::string& color) {
19 extra().set("color", color);
20 return *this;
21 }
22
24 extra().set("fontSize", fontSize);
25 return *this;
26 }
27
28 Slider& min(float min) {
29 extra().set("min", min);
30 return *this;
31 }
32
33 Slider& max(float max) {
34 extra().set("max", max);
35 return *this;
36 }
37
38 Slider& value(float value) {
39 extra().set("value", value);
40 return *this;
41 }
42
44 extra().set("precision", precision);
45 return *this;
46 }
47
49 extra().set("showValue", new rbjson::Bool(showValue));
50 return *this;
51 }
52
56 addCallback("changed", cb);
57 return *this;
58 }
59};
60
61};
62};
std::function< void(gridui::Slider &)> callback_t
Definition widget.h:41
void addCallback(const std::string &name, const callback_t &cb)
Definition widget.h:54
Slider & fontSize(float fontSize)
Definition slider.h:23
Slider & max(float max)
Definition slider.h:33
Slider & value(float value)
Definition slider.h:38
Slider & color(const std::string &color)
Definition slider.h:18
Slider & min(float min)
Definition slider.h:28
Slider & showValue(bool showValue)
Definition slider.h:48
Slider & precision(float precision)
Definition slider.h:43
rbjson::Object & extra()
Definition widget.cpp:16
Slider & onChanged(callback_t cb)
Definition slider.h:55
Definition arm.h:8