• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Controlling appearance of popup menu with Command

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is there some easy way to have better control on the pop-up menu display with using Command on a Form?

e.g.
(Left softkey button):
List
-> L_action1
-> L_action2
-> L_action3

(Right softkey button):
Call
-> C_action1
-> C_action2

addCommand(new Command("List", Command.SCREEN, 1));
addCommand(new Command("Call", Command.SCREEN, 1));

addCommand(new Command("L_action1", Command.SCREEN, 2));
addCommand(new Command("L_action2", Command.SCREEN, 2));
addCommand(new Command("L_action3", Command.SCREEN, 2));

addCommand(new Command("C_action1", Command.SCREEN, 3));
addCommand(new Command("C_action2", Command.SCREEN, 3));


The above code didn't work, and playing with the prority and commandType also didn't help much. In particular, is it possible to group a list of options under a menu easily?

Thanks
Victor
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, when you are using the high level UI APIs, you have zero control in how it looks on the device, that is what the high level API is about, making the device be responsible for making it display in a nice mamner but device specific way.

You can use something like J2ME Polish to make a prettier UI.

Mark
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no sense naming multiple commands with the same priority.

For example, assume a device has two softkeys and you want to display 4 commands. It should put the highest ranked command on one of the softkeys. The other key will display something like "menu" where the remaining 3 commands will appear.

Move that same application to a three softkey device and commands 1 and 2 will be visible while 3 and 4 will be under one key called "menu".

It's also possible that the JVM will simply ignore the priorities and put all the commands under a single "menu" key.

All of the above is purely conjecture on what is likely. As Mark pointed out, it's really up to the JVM and there are no guarantees.

I usually make a "static final" called lowPriority and set it to 99. Then I make a highPriority set to 1. When I start defining commands I use expressions like highPriority, highPriority+1, highPriority+2, or lowPriority, lowPriority-1, lowPriority-2, etc.

William Frantz
http://sprintdevelopers.com
reply
    Bookmark Topic Watch Topic
  • New Topic