[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 

code based navigation RSS feed
Forum Index » tcMenu Arduinio library
Author Message
Blueforcer


Joined: Apr 14, 2022
Messages: 7
Offline
Hello,

im not that good in C++ and im asking because i dont find any example for my needs smilie

I need to navigate the menu with code. So im searching for something to simulate button clicks.
But everything ive found needs gpio pins.

Is there something like switches.performRightClick() or something like that?

thanks in advance
Stephan
davetcc


Joined: Jan 19, 2019
Messages: 628
Offline
There's a couple of things you can do, firstly you can simulate a click in switches, if you wanted to go that way, on switches there is a handy function for testing -

void pushSwitch(pinid_t pin, bool held);


However, preferably you can use the navigation facilities on menu manager (menuMgr) -

void MenuManager::navigateToMenu(MenuItem* theNewItem, MenuItem* possibleActive, bool customMenu)

void MenuManager::resetMenu(bool completeReset) // complete reset - true means go back to root, otherwise one level back
Blueforcer


Joined: Apr 14, 2022
Messages: 7
Offline
But
void pushSwitch(pinid_t pin, bool held);


will not work if there is no pin configurated, right?
Or can i use dummy pins?

I think something like that would be more easier than building the navigation from scratch.
So you can use nearly everything to navigate without having any hardwarepins declared.



Blueforcer


Joined: Apr 14, 2022
Messages: 7
Offline
short feedback:

i just used pins in the designer wich doesnt exit ( 50,51,52 ..)
And it works just fine.
I will use this istead of building my own navigation smilie
davetcc


Joined: Jan 19, 2019
Messages: 628
Offline
As per the last post, You can also use

navigateToMenu and resetMenu to avoid that. It lets you push a new menu and pop back on level or back to root.

You can also use takeOverDisplay when you want to show something completely custom.

See https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menumanager-and-iteration/
Blueforcer


Joined: Apr 14, 2022
Messages: 7
Offline
davetcc wrote:As per the last post, You can also use

navigateToMenu and resetMenu to avoid that. It lets you push a new menu and pop back on level or back to root.

You can also use takeOverDisplay when you want to show something completely custom.

See https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menumanager-and-iteration/


Sure but that means that i have to build the complete navigation procedure myself including changing values etc. wich the lib already provides.
And all that effort just because i dont have Pins to trigger the existing functions of the lib. It doesnt worth in my opinion.
a software input plugin would be the greatest.
So the user can use nearly everything to navigate the menu. Like GestureSensors etc.
Somthing like
MenuMgr.performleftClick
MenuMgr.performDownClick
MenuMgr.performOkClick

But anyway. pushSwitch was the easiest way to get to my goal.

davetcc


Joined: Jan 19, 2019
Messages: 628
Offline
Not really you can make any sub menu the current one by calling menuMgr.navigateToMenu(&mySubMenu)

You can simulate going back menuMgr.resetMenu(fullReset) where it either goes back one level or if the parameter is true, back to root.

This way, menu control is done for you, you are just manually controlling what submenu is being shown.
davetcc


Joined: Jan 19, 2019
Messages: 628
Offline
i think these functions kind of do what you want:

https://www.thecoderscorner.com/products/arduino-libraries/tc-menu/menumanager-and-iteration/#controlling-the-menu-items-manually
 
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

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.