mirror of
https://github.com/s00500/ESPUI.git
synced 2024-11-22 14:20:53 +00:00
Made Type and ID private and added accessors for them.
This commit is contained in:
parent
bddcde4e57
commit
83104e9e1e
@ -1,11 +1,11 @@
|
||||
#include "ESPUI.h"
|
||||
|
||||
static uint16_t idCounter = 0;
|
||||
static const String ControlError = "*** ESPUI ERROR: Could not transfer control ***";
|
||||
|
||||
Control::Control(Control::Type type, const char* label, std::function<void(Control*, int)> callback,
|
||||
const String& value, Control::Color color, bool visible, uint16_t parentControl)
|
||||
: type(type),
|
||||
Control::Control(Control::ControlId_t id, Control::Type type, const char* label, std::function<void(Control*, int)> callback,
|
||||
const String& value, Control::Color color, bool visible, ControlId_t parentControl)
|
||||
: id(id),
|
||||
type(type),
|
||||
label(label),
|
||||
callback(callback),
|
||||
value(value),
|
||||
@ -14,23 +14,20 @@ Control::Control(Control::Type type, const char* label, std::function<void(Contr
|
||||
wide(false),
|
||||
vertical(false),
|
||||
enabled(true),
|
||||
parentControl(parentControl),
|
||||
next(nullptr)
|
||||
parentControl(parentControl)
|
||||
{
|
||||
id = ++idCounter;
|
||||
ControlChangeID = 1;
|
||||
}
|
||||
|
||||
Control::Control(const Control& Control)
|
||||
: type(Control.type),
|
||||
id(Control.id),
|
||||
id(Control::noParent),
|
||||
label(Control.label),
|
||||
callback(Control.callback),
|
||||
value(Control.value),
|
||||
color(Control.color),
|
||||
visible(Control.visible),
|
||||
parentControl(Control.parentControl),
|
||||
next(Control.next),
|
||||
ControlChangeID(Control.ControlChangeID)
|
||||
{ }
|
||||
|
||||
@ -249,7 +246,6 @@ void Control::onWsEvent(String & cmd, String& data)
|
||||
SendCallback(P_LEFT_DOWN);
|
||||
break;
|
||||
}
|
||||
|
||||
else if (cmd.equals(F("plup")))
|
||||
{
|
||||
SendCallback(P_LEFT_UP);
|
||||
|
Loading…
Reference in New Issue
Block a user