[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 

Disable / hide menu item. RSS feed
Forum Index » tcMenu Arduinio library
Author Message
davetcc


Joined: Jan 19, 2019
Messages: 362
Offline
I’ve actually been thinking of this for a while and it’s just slipped through the cracks of each release.

This isn’t implemented at the moment but is trivial to implement, I can add this to the next release that is due out in a few days time.

Could you feed back with how you think it would work:

My thoughts are:

Disable flag: stop editing and grey out on graphical displays, show remotely as greyed out.
Visible flag: completely remove item from display and remote.
davetcc


Joined: Jan 19, 2019
Messages: 362
Offline
Is it possible to hide a menu item at runtime that has been created using the Menu designer?

To outline my use case -

- I am reporting the value of several sensors on the menu, however, each installation may or may not use all sensors.
- I would therefore like to hide menu items that are not used.
- Sensors are enabled / disable via a simple configuration file within the code so we already know whether the sensor is in use or not.

I guess what would be good, is something along the lines of

view source

print?
1 menuFoo.disable


I've had a look through the API but cannot see such a function.

Is it possible to do what I am trying to do?

With thanks in advance.

/DM
DeeEmm


Joined: Nov 28, 2019
Messages: 13
Offline
Yes, I think that would work very well.

For my immediate use case I just want to completely remove the item from the display, but I can also foresee other uses where it might be good to simply 'grey it out' but keep it visible.

/DM
davetcc


Joined: Jan 19, 2019
Messages: 362
Offline
We are finally (after a couple of months of significant effort) at the point where we can release 1.4 of the library, this version will include visibility, that works both locally on the menu and remotely.

TcMenuLib - the library itself has now got support for this on master, and the UI's will be following along very shortly, probably within a week or so.

In terms of enabled status: There is already a method of making something non-editable, set the read-only flag. In a future version, we could give the option of a different rending color for this.

Limitations:

If you change the visibility of an item after the display has been initialized (think after setupMenu() in setup), you must completely refresh the menuMgr by calling setCurrentMenu() with whatever menu you want to display (or the root menu). See the examples, keyboard ethernet and Ada32 Ethernet have been updated with this support. Also, the changes will only take effect remotely after a new remote connection.

Edit - link to tcMenuLib: https://github.com/davetcc/tcMenuLib
davetcc


Joined: Jan 19, 2019
Messages: 362
Offline
This is now available in both the Windows store and Java designer versions. There's a few major changes in 1.4.1, but you can easily go back to 1.3.5 in the event of issues.

https://github.com/davetcc/tcMenu/releases/tag/1.4.1
 
Forum Index » tcMenu Arduinio library
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer