Forums Register Login

Controlling appearance of popup menu with Command

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 959 times.
Similar Threads
Command listenr
HELP!! I can't see my picture
Puzzled by the behaviour
IllegalStateException
my .jar didn't run well
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:33:08.