-
Notifications
You must be signed in to change notification settings - Fork 85
Description
Hello,
First, I would like to thank you for the menu system it seems well thought out.
But I have a few questions.
- In my use case I will be re-using menu items in multiple menus. I think this is possible but I am having some confusion.
Here is an example, this is for a sprinkler controller if it helps.
The Menu would like like this:
Manual
---Valve 1
------Set Minutes
Program
---Valve 1
------Set Minutes
Code snippet:
// Define menus and menu items
Menu mu1("Manual");
Menu v1("Valve 1");
MenuItem setmin("Set Minutes",&on_setMinutes_selected);
Menu mu2("Program");
Menu mu3("Valve Run Time");
// Build Menu
ms.get_root_menu().add_menu(&mu1); // Add "Manual" to root menu
mu1.add_menu(&v1); // Add "Valve 1" menu under "Manual"
v1.add_item(&setmin); // Add "Set Minutes" under "Valve 1"
ms.get_root_menu().add_menu(&mu2); // Add "Program" to root menu
mu2.add_menu(&mu3); // Add "Valve Run Time" menu under "Program"
mu3.add_menu(&v1); // Add "Valve 1" (and "Set Minutes") under "Valve Run Time"
My question is in the callback function on_setMinutes_selected, I need to know if the menu path started at "Program" or "Manual". Is there a way to keep track of the menu path taken to a given callback.
It would be a bit wasteful if different MenuItems were needed for each endpoint callback.
- I see that support for NumericMenuItem but I am not understanding its purpose. Can you elaborate with a small sample?
Thank you!