07-14-2010 10:45 AM
i would suggest a custom menu (popupscreen with listfield). or maybe you find an unicode char you can use.
07-14-2010 01:01 PM
I do this by faking it. I have two menu items, one with a check and one without. Inside makeMenu (or makeContextMenu), I decide which one to add to the menu based on the current state of the app.
The check itself is just a character. I tend to use Characters.BALLOT_BOX for the no-check version and Characters.BALLOT_BOX_WITH_CHECK for the checked version. The two characters take up about the same width, so the menu item doesn't seem to bounce around. (If you're putting this in a resource file, BALLOT_BOX is U+2610 and BALLOT_BOX_WITH_CHECK is U+2611.)
07-14-2010 01:13 PM
Great suggestion, Ted - thanks!
Just a small addition: if you want to redisplay the message with/without checkmark when the user clicks that particular item (making them feel like they are "toggling" the flag), change whatever flag you need to change in its (item's) run method then invoke onMenu() of the screen you came from. If that flag would have visual consequences (such as "Navigation Toolbar" in Mozilla), invalidate() the screen after changing that flag.