Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » Entering a telephone number

Author: Hero_21
13/05/2020 21:56:13
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!

Author: davetcc
14/05/2020 07:42:47
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.

Author: Hero_21
15/05/2020 18:39:17
Thanks for the reply. I will give it a try and post back.




Register / Login  |  Desktop view  |  Jump to top of page