×

Discussion Board

Results 1 to 15 of 15

Thread: Menu in Asha

  1. #1
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Menu in Asha

    Hi,

    I am developing application in Asha using low level API(Canvas),In midlet class i have set "setfullscreenmode="false",In my screen Top left corner i have one option.If i pressed,it displaying a item like"open a keypad" by default.I want to remove that item and need to add my own items ,Is it possible.
    Last edited by ohiletechguy; 2013-03-25 at 10:37.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    You should read:

    These will tell you how to manipulate the menu and command system in the Asha UI.

    Graham.

  3. #3
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    Hi grahamhughes,

    Thanks for your reply.By using canvas class how can i add items in that option list.If i have list i will do,but i have canvas i tried "canvas.addCommand(ok);".but this command button was not displaying.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    Did you read the two documents?

  5. #5
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    ya i read..but "open keypad" item also coming..I have two file,one is midlet and another one is class file i extend canvas. If i use the command button in midlet class it displaying that item,but in canvas extended class its not displaying that menu item.

    My Code:

    Mainmid midlet=Mainmid .getInstance();
    Canvas canvas=midlet.getMidletCanvas();
    Display dis=midlet.getDisplay();

    upgradeok = new Command("Yes", Command.OK, 1);
    canvas.addCommand(upgradeok);
    Last edited by ohiletechguy; 2013-03-25 at 12:38.

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    Quote Originally Posted by ohiletechguy View Post
    If i use the command button in midlet class it displaying that item,but in canvas extended class its not displaying that menu item.
    I don't understand what you mean. If you call addCommand() on the Canvas, you will add a Command, and it will be displayed according to the rules in the documentation. It does not matter from where you call addCommand().

    As the documentation says, if you have only one Command, and it is of type "OK", it will be displayed as a "tick" icon in the top-right position.

    Graham.

  7. #7
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    by default item under the option icon is "open Keypad".If i add new item like(about) its appending to that list. Now the list contain two item "open keypad","about".I need to remove the open Keypad"option. But in that document

    String keyboardType = System.getProperty("com.nokia.keyboard.type");
    if (keyboardType.equals("None")) {
    // full touch device detected
    com.nokia.mid.ui.VirtualKeyboard.hideOpenKeypadCommand(true);
    }

    If i use the above code it disable the "Action button2" that is in my screen left top corner option is disabled.

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    What type of Command is "about"?

  9. #9
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    abt = new Command("About", Command.OK, 1);
    canvas.addCommand(abt);

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    OK. If you read the the rules about command mapping on Asha devices, you'll see that when you have one Command, and it is of type "OK", it is assigned to the Action 1 button (with a "tick" icon). Your Action 2 button disappears because, without the "show keyboard" button, there are no commands to display in it.

    Try changing the type of the "about" command to "SCREEN".

    Graham.

  11. #11
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    abt = new Command("About", Command.SCREEN, 1);
    canvas.addCommand(abt);

    I have given only the above command in my Action button2 but Also "Open keypad" command id also there.Its coming default.How can i remove that?

  12. #12
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    Using the code in your previous post...

    Code:
    com.nokia.mid.ui.VirtualKeyboard.hideOpenKeypadCommand(true);

  13. #13
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    thanks grahamhughes. Its working. I have one more issue. if i navigate form one to another screen how can i clear the canvas.For example i am in screen A in that screen i have aboutUs command button,In screen B i have exit button. If i move screen A to B i need to flush canvas. Now in my application inside screen B both buttons are displaying.

  14. #14
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Menu in Asha

    Either you create a new Canvas, or you remember which Commands you added, and remove them one by one.

    Graham.

  15. #15
    Registered User
    Join Date
    Jul 2012
    Location
    Bangalore,India
    Posts
    26

    Re: Menu in Asha

    thanks grahamhughes.. I solved that issue with your help..

Similar Threads

  1. MMS with Asha 202
    By Ajipua in forum Mobile Java General
    Replies: 5
    Last Post: 2013-03-03, 08:28
  2. Please improve S40 Asha OS
    By lumasha in forum General Development Questions
    Replies: 10
    Last Post: 2012-12-10, 09:35
  3. PDF reader in Asha 311
    By jackflaming in forum General Development Questions
    Replies: 3
    Last Post: 2012-10-03, 11:50
  4. Asha 200 : UTF-8 Problem
    By sujitshinde in forum Mobile Java General
    Replies: 0
    Last Post: 2012-09-05, 12:02
  5. nokia asha 302
    By Krishnarulezz in forum General Development Questions
    Replies: 2
    Last Post: 2012-03-05, 08:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •