[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 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

Entering a telephone number RSS feed
Forum Index » tcMenu Arduinio library
Author Message
Hero_21


Joined: May 13, 2020
Messages: 2
Offline
Hello everyone! My app must allow the user to enter his/her phone number. I am using a rotary encoder so I would like the user to change each digit with left right and when he presses the rotary encoder then move to the next digit etc. We use 10 digit phone numbers in my country. I red about RuntimeMenuItem and I am willing to implement it in my own way but I would like to ask here in case someone took this path before me...

Great job by the way!
davetcc


Joined: Jan 19, 2019
Messages: 686
Offline
Not exactly the same, but you could implement this in a similar way to the text editing, but with custom handling for your telephone numbers.

You would essentially look at the existing runtime menu function handlers and write a similar one for your purposes. I suggest you take a look at how the existing ones implement the required callback function. Take a look at the text menu item and its callback function:

https://www.thecoderscorner.com/ref-docs/tcmenu/html/class_text_menu_item.html

The callback function is textItemRenderFn implemented in src/RuntimeMenuItem.cpp

At the moment the designer does not support custom classes so you'd have to add them to the menu yourself at runtime (easiest to put them at the end of a menu by pointing the last item's next to this and setting the custom item's next to NULL). You'll see this done in many of the examples.

We'll need to think about how these can be integrated into the designer plugin system, probably by providing an XML definition of how to generate the code for these at some point.
Hero_21


Joined: May 13, 2020
Messages: 2
Offline
Thanks for the reply. I will give it a try and post back.
 
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.