WatchUi.Menu2.AddItem

Hi everyone! How can I add a text or number input field in WatchUi.Menu2.Additem? What are the menu item options other than plain text and checkbox?

  • What are the menu item options other than plain text and checkbox?

    There's a custom menu item which allows you to provide a custom implementation for draw()  but I don't think you would be able to implement a text or number input field using it, because it doesn't support any input other than selection/deselection. And I don't think it would be very user-friendly in any case, due to the small screen size and the fact that you probably have to support button-based input (unless you only support watches where the touchscreen is mandatory for basic functionality, like Vivoactive and Venu.) It might be confusing or clunky to navigate between multiple input fields on the same screen with the buttons, which are also used to edit those fields.

    For example, in the native Forerunner watch UI, I've never seen more than one text/number input field on the screen at the same time.

    I think the best way to accomplish your goal would be to have a regular menu item where the label is the name of the field, and the sublabel is the value. When the user selects the menu item (with the START button or a tap), the app could push a new view which is a fullscreen text input field or number picker.

  • I have already implemented such a method. But for example, entering coordinates for a point in standard functions is often available. And I need to enter coordinates in the dial settings.... Probably only from a phone is this possible. Thanks for the answer!

  • I stand corrected about entering multiple numbers in the native UI haha. I still think it would be awkward to so within a menu, since both the input fields and the menu itself would have to accept input.

    Can't you still implement a full-screen view for the coordinates entry, as opposed to trying to do it in a menu2?

  • Is it possible to somehow send a click on a menu item to an input form and then write the resulting value to the settings?

  • Not using Menu2. EDIT: I mean that I don't think it's possible for the input form/field to be in the menu item itself, if that's still what you're thinking of.

    Like I said, I think the best approach is to have a menu item which takes you to a new view when it's selected. This new view can be a custom view which implements all the input fields you need (e.g. coordinates for a single location.)

  • Yes it is!

    I have implemented something similar to what it sounds like you are trying to do.  The way I did it was I had to create a TextPicker and associated delegate for the textPicker to handle the actual text entry.  The text picker was launched from a menu2 menuItem, which once selected would initialize the picker and the picker delegate.  The picker delegate would take two options, the picker view so it could update the entry view, and also the chosen menu option so that when the picker onback menthid was called, I could update the settings and the menu sublabel to reflect the option change once the picker view was popped from the screen.

    I used the sample Text Picker from this thread as the starting point or my text/number entry screens.

    forums.garmin.com/.../ciq-tools