Menu-item

Former Member
Former Member
Hello,

I have implement a menu in my Fenix 3 application and it works.

But I want to add to this menu a boolean (enable disable) selection for a parameter.

at the moment the menu is like this:
<menu id="MainMenu">
<menu-item id="SetTime">Temps de course</menu-item>
<menu-item id="SetLength">Distance</menu-item>
<menu-item id="VMA">VMA</menu-item>
<menu-item id="Interval">Interval</menu-item>
<menu-item id="Training">Training </menu-item>
</menu>

I want that the last parameter Training can be selected false/ true and that it will be displayed in the menu
during I change it. Like in the garmin menu.

Have somebody an example how to do it?

Another questions.
I have found no documentation about all the parameters of the menu-item in the Eclipse GUI. For Example
what is the DTD information?
What are the Edit namespace
Add Processing instruction?
Cdata Section?

Have anybody some detailed information on how to create nice menu in the GUI?

Thanks in advance for your help
  • The built-in menu system is pretty primitive. Even if you programmatically generate the menus (not using the resource files), you can't manipulate the menu items after you've added them, so doing what you want is kind of difficult. Options that I see are to...

    • display the value as part of the menu item name, and in the handler for that menu item, pop the menu (so the user has to enter that menu again and will see the new value).
    • write your own custom menu system that has a place for a value to be displayed.
    • figure some way to avoid needing to display the current value.
  • Former Member
    Former Member over 9 years ago
    Different ways of using menus

    Hello,

    I have implement a menu in my Fenix 3 application and it works.

    But I want to add to this menu a boolean (enable disable) selection for a parameter.

    at the moment the menu is like this:
    <menu id="MainMenu">
    <menu-item id="SetTime">Temps de course</menu-item>
    <menu-item id="SetLength">Distance</menu-item>
    <menu-item id="VMA">VMA</menu-item>
    <menu-item id="Interval">Interval</menu-item>
    <menu-item id="Training">Training </menu-item>
    </menu>

    I want that the last parameter Training can be selected false/ true and that it will be displayed in the menu
    during I change it. Like in the garmin menu.

    Have somebody an example how to do it?

    Another questions.
    I have found no documentation about all the parameters of the menu-item in the Eclipse GUI. For Example
    what is the DTD information?
    What are the Edit namespace
    Add Processing instruction?
    Cdata Section?

    Have anybody some detailed information on how to create nice menu in the GUI?

    Thanks in advance for your help


    Hi there,

    I did a bit of messing about with menus in a widget, my source code is on Github here: https://github.com/rnewby/cgm-garmin

    I apologise in advance for the code quality, but you can see a few different ways I have used menus. Different menu items feed into different screens or menu selectors, including text pickers and others submenus defined in resource files. They all tend to end up in a single confirmation delegate. Most of the menu functionality is in CGMWidgetsBehaviourDelegates.mc.

    I didn't work out how to pick up the menu item name and set that as the settingText value, nor to control which menu item was selected as the default (as in the user profile gender watch setting). But you could set the activemenu title, for Training to show the current value.

    activemenu = new Rez.Menus.TrainingMenu();
    activemenu.setTitle("Training set to...");

    Perhaps you could look at the ObjectStore sample code and see how it uses strings defined in the resource file. If you can manipulate the strings and then load the Menu item names using @Strings.trainingselected or Rez.Strings.... type syntax, then you might find that when the menu initialises you can manipulate its content and order. But I haven't managed to get it to work even though it is documented here: http://developer.garmin.com/connect-iq/programmers-guide/resource-compiler/

    e.g.
    <string id="trainingselected">True</string>
    <string id="trainingdeselected">False</string>


    <menu id="TrainingMenu">
    <menu-item id="item_1">@Strings.trainingselected</menu-item>
    <menu-item id="item_2">@Strings.trainingdeselected</menu-item>
    </menu>


    The widget is here https://apps.garmin.com/en-GB/apps/00bde42c-44b6-474e-975c-7c593c6a3bcb
    but it in itself is unlikely to be of use to you.

    R.