TcMenu / tcMenuLib

TcMenu modular IoT menu library supporting rotary encoder, joysticks, many displays, and remote control over Ethernet and Serial
Apache License 2.0
111 stars 10 forks source link

Allow ALL runtime menu items to have an INFO block #197

Closed davetcc closed 1 year ago

davetcc commented 1 year ago

Is your feature request related to a problem? Please describe. As a developer of Tcmenu apps, when I create dynamic menu items there is a huge amount of complexity in setting up custom RtFn blocks for them all, the best solution that is already used by submenuitem is for all Runtimes to be able but not forced to get the name, ID and other parameters from an info block.

Confirm that the bug is in the embedded library Yes it is

Commerical or personal/community use Commercial, davetcc

Describe the solution you'd like For all runtime items to have menu blocks

Describe alternatives you've considered N/A

davetcc commented 1 year ago

In 3.2 an example of simplified item creation:

TextMenuItem menuTextExtra(newAnyMenuInfo("Text", nextRandomId(), 0xffff, NO_CALLBACK), "hello", 8, nullptr, INFO_LOCATION_RAM);
BooleanMenuItem menuOvenFull(newBooleanMenuInfoP("Start Oven", nextRandomId(), 0xffff, NO_CALLBACK, NAMING_YES_NO), false, &menuTextExtra, INFO_LOCATION_RAM);
AnyMenuInfo minfoOvenPower = { "Start Oven", nextRandomId(), 0xffff, 255, NO_CALLBACK};
ActionMenuItem menuOvenPower(&minfoOvenPower, &menuOvenFull, INFO_LOCATION_RAM);
AnalogMenuItem menuOvenTempItem(newAnalogMenuInfo("Oven Temp", nextRandomId(), 0xffff, NO_CALLBACK, 255, 0, 1, "C"), 0, &menuOvenPower, INFO_LOCATION_RAM);