Replies: 19 comments
-
Unless I'm mistaken (please correct me if I'm wrong) it seems that you're trying to add sub menus as navigation items. However, it should always be the first child item that is added. Again, it looks like the docs are not very clear on this, I'll clean up the documentation so it makes it clear that pushing navigation should always be done using the first menu item and not the sub-menu. If that is the case, you can get the suitable item for adding calling getChild() on the submenu, |
Beta Was this translation helpful? Give feedback.
-
I was trying to navigate to another submenu by code. For example, if I have such menu structure
If my cursor is on C1, in C1's callback, can I use |
Beta Was this translation helpful? Give feedback.
-
If you wanted to present another menu you'd normally get the first child item and present that. For example:
Thanks for raising this, I've made the guide much clearer: http://thecoderscorner.com/products/arduino-libraries/tc-menu/menumanager-and-iteration/#navigation-around-menus |
Beta Was this translation helpful? Give feedback.
-
So, If I want to present menu B2, I shall call |
Beta Was this translation helpful? Give feedback.
-
Yes, that should do what you want, it will push menuB's first item onto the navigation stack and then make B2 active. |
Beta Was this translation helpful? Give feedback.
-
It works as expected! 😄 But I still feel the usage is a bit counter intuitive. I can understand the current method may be due to uni-directional linked list, |
Beta Was this translation helpful? Give feedback.
-
The only thing that is possible is to add a helper method navigateToSubMenu that deals with the indirection, but it wouldn't work for root. But for root you'd normally just call menuMgr.resetMenu(true) anyway. Maybe providing null to that function would do a resetMenu(true) meaning it was univeral. |
Beta Was this translation helpful? Give feedback.
-
I don't quite understand how does |
Beta Was this translation helpful? Give feedback.
-
But suppose it is SubMenu item (and it sometimes is on designs I've done), then do you show that or root? The only way would be to pass in a specially defined constant (probably null is best) to select root. This is why navigate is the way it is at the moment.. |
Beta Was this translation helpful? Give feedback.
-
For example
|
Beta Was this translation helpful? Give feedback.
-
let's take this menu as an example:
In my opinion:
Did you mean by this way, the problem is unable to navigate to this?
|
Beta Was this translation helpful? Give feedback.
-
I think what you're suggesting now is how it works presently, you navigate to the first child that you want to present. To be honest, I think once understood, it's by far the clearest way given how the menu is structured on the device. Maybe we could have a new function like the one you suggest, where you skip needing to know which parent menu the item is in, something like: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have another thought about this argument. What if the menu is not a customed one, but I say |
Beta Was this translation helpful? Give feedback.
-
Thanks, I think I have the context now, I don't think a new method is needed, I just need to make sure that the inline code documentation is a lot clearer when 3.0 comes out shortly |
Beta Was this translation helpful? Give feedback.
-
Do you think we can we close this out now? The improved docs are below, if you can think of anything missing, or better wording please let me know and I'll change.
|
Beta Was this translation helpful? Give feedback.
-
I not sure if I understand how the history works, does history only effect how the prev/next button works ? |
Beta Was this translation helpful? Give feedback.
-
Includes a link to some just now improved documentation. This is probably the most complex interact most devs will have with the library, needs well documenting. |
Beta Was this translation helpful? Give feedback.
-
Nice place to have the doc link. 👍 After reading the inline/online doc, I still have some confusions:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How to reproduce:
simpleU8g2
menuMgr.navigateToMenu(&menuSettings, &menuSettingsSaveSettings);
to the end ofonStartToasting
functionStart toasting >>
Settings
, and unable to move the cursor up.p.s. But if I change the code to
menuMgr.navigateToMenu(&rootMenuItem(), &menuSettings)
, it will focus on Settings and free to scroll up and down.Beta Was this translation helpful? Give feedback.
All reactions