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