Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Designer UI » Allow MenuItems variable name to be set manually

Author: emptynick
09/10/2020 12:57:56
Hey,

thanks for your awesome library. I'm already doing some cool things with it.
What would be really helpful is to set the name which the UI will give a menu-item by hand.
In my case I have a few sub-menus that all contain a save-action:
- Root
-- Ethernet
--- IP
--- Save (Will generate "ActionMenuItem menuSave")
-- Wifi
--- IP
--- Save (Will also generate "ActionMenuItem menuSave")

Those two "menuSave" will then clash when compiling.

Another (similar) suggestion is for enums.
I have 10 LEDs which can be separately controlled (set color to Red, Green, Blue, ...).
In this case it will generate 10 enum-string-array which are identical.
It would be good to be able to either generate the enum-values OR add a name which references an already existing array.

Thanks again for your work.

- Christoph

Author: davetcc
09/10/2020 14:16:27
 
thanks for your awesome library. I'm already doing some cool things with it.


You're welcome, I'm always glad to hear how it is used.

Those two "menuSave" will then clash when compiling.


Have you tried setting the use fully qualified names option, in the app store version, it's on the ROOT menu, on the Java version it's on the Generator page.

This gives fully qualified variable names. EG: menuEthernetSave and menuWiFiSave

But noted, in the future I'll see if it's possible to actually provide manual names, in case that is not enough.

It would be good to be able to either generate the enum-values OR add a name which references an already existing array.


For enums, we are introducing a new type at the moment called ScrollChoiceMenuItem, that will compliment rather than replace the current support for more complex cases, with this you'll have far more flexibility on how to provide the values. It can change size and values at runtime. It will be able to read values from:

* A fixed array in memory
* EEPROM storage in a fixed array (optionally cached)
* Delegate Callback function that will be asked for a string equivalent for each value.

This will give far more flexibility for enumerations, and allow for pretty much every case.




Register / Login  |  Desktop view  |  Jump to top of page