ESPUI is a library to build webinterfaces on an ESP8266 or ESP32
It has a lot of UI-elements one is a input-number-field

There are two ways to define them
using
ESPUIClass::number(
//ie.
ESPUI.number("Numbertest", &numberCall, ControlColor::Alizarin, 5, 0, 10);
where the "0" and the "10" are min and max-limits
This method works only if the website has no tabs
I want to create a web-interface with tabs
The documentaion says that this requires to use the addControl-function
example
AdjustNr_ID = ESPUI.addControl(ControlType::Number, "Click Up/Down Number:", 50, ControlColor::Alizarin, myTab_Settings3_ID, &numberCallback);
In the example code inside the library (like the codeline above) the addControl-method has no min / max-parameters.
This is how the sourcecode of the "number"-function and the "addControl"-function looks like (inside file ESPUI.cpp)
uint16_t ESPUIClass::number(
const char* label, void (*callback)(Control*, int), ControlColor color, int number, int min, int max)
{
uint16_t numberId = addControl(ControlType::Number, label, String(number), color, Control::noParent, callback);
addControl(ControlType::Min, label, String(min), ControlColor::None, numberId);
addControl(ControlType::Max, label, String(max), ControlColor::None, numberId);
return numberId;
}
uint16_t ESPUIClass::addControl(ControlType type, const char* label, const String& value, ControlColor color,
uint16_t parentControl, void (*callback)(Control*, int))
{
Control* control = new Control(type, label, callback, value, color, true, parentControl);
if (this->controls == nullptr)
{
this->controls = control;
}
else
{
Control* iterator = this->controls;
while (iterator->next != nullptr)
{
iterator = iterator->next;
}
iterator->next = control;
}
this->controlCount++;
return control->id;
}
what baffles me is that the number-function has three calls to function addControl
first for "number"
second for "min"
third for "max"
uint16_t numberId = addControl(ControlType::Number, label, String(number), color, Control::noParent, callback);
addControl(ControlType::Min, label, String(min), ControlColor::None, numberId);
addControl(ControlType::Max, label, String(max), ControlColor::None, numberId);
As the documentation says for website with tabs I'm forced to use the addControl-function which has less parameters
how can I set the min and max-values when calling the addControl-function?
best regards Stefan