From 83104e9e1ea107f65fe59bac1c7690e616e2c58d Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 18 Jul 2024 11:45:29 -0400 Subject: [PATCH] Made Type and ID private and added accessors for them. --- src/ESPUIcontrol.cpp | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/src/ESPUIcontrol.cpp b/src/ESPUIcontrol.cpp index 309fa61..e348553 100644 --- a/src/ESPUIcontrol.cpp +++ b/src/ESPUIcontrol.cpp @@ -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 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 callback, + const String& value, Control::Color color, bool visible, ControlId_t parentControl) + : id(id), + type(type), label(label), callback(callback), value(value), @@ -14,24 +14,21 @@ Control::Control(Control::Type type, const char* label, std::function