left and right command menus in LWUIT form
Asked Answered
R

1

7

Using LWUIT framework to develop mobile application. In LWUIT by default first command is placed in the left and subsequent commands will be placed in the right menu of the form including the command which is already placed in form left.I need to add two menus to form.Left menu contains general application specific commands such as "Minimize","Back" and "Exit". Right Menu contains screen specific commands such as "Play Audio","Play Video" etc... Initially left softbutton of the form contains the text "Options" and the right softbutton of the form contains the text "Menu". When user selects "Options", a menu will be displayed with the following commands: Minimize Back Exit When user selects right soft button "Menu", a menu will be displayed with screen specific commands: Play Audio Play Video etc... Commands of the right menu keeps changing from one form to another form, whereas the commands of left menu remains the same for all screens(forms). I know command menu can be customized by overriding "Form.createCommandList(Vector)" which returns a list. But here in my case I need two lists(menus). One at the left of the form and the other one at the right of the form.Please do help me in resolving this issue.

Renshaw answered 26/6, 2009 at 7:11 Comment(0)
M
4

A LWUIT menu is just a dialog containing a List (or buttons for touch menu or pretty much anything you want), so to implement this just create a Command called options and place it in the left soft button. When options is pressed just show the dialog with your "additional commands". Since a List can accept a command array or vector doing something like this can be really easy. You can look at the code for MenuBar which is pretty simple, you can also replace the menu bar component in the latest version LWUIT (SVN at the moment) but that seems redundant for this particular use case.

Microchemistry answered 22/5, 2011 at 9:59 Comment(1)
i have a problem similar to this question , could you please give me the start point for the solution you mentioned before or any sample code to try.Trossachs

© 2022 - 2024 — McMap. All rights reserved.