Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 5
Registered: ‎07-20-2008
My Device: Not Specified
Accepted Solution

Add To DEFAULT_MENU

I have been adding new MenuItems to MainScreen objects for some time now (standard menu in the top right of the screen), but have not been able to extend the DEFAULT_MENU.  MainScreen adds a DEFAULT_MENU with a single "Close" entry that appears from the bottom left when the escape key is pressed but have not been able to find an example of how to expand the list to include menu items of my own.  I am using JDE 4.5.0.7.   - Brian


Highlighted
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Add To DEFAULT_MENU

Which function have you been using exactly? There is both MainScreen.makeMenu(Menu menu, int instance) and Field.makeContextMenu(ContextMenu contextMenu). There are instance constants in the Menu class to use with makeMenu().
New Developer
Posts: 5
Registered: ‎07-20-2008
My Device: Not Specified

Re: Add To DEFAULT_MENU

I have simply been creating a new Menu() object and then adding  MenuItem objects. - Brian
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Add To DEFAULT_MENU

[ Edited ]

Override makeMenu(). When Screen.onMenu() is called, it creates a new Menu object then calls makeMenu() to populate it. You can even override makeMenu() in Managers and makeContextMenu() in Fields to better seperate object specific menu items.

 

Message Edited by mreed on 07-20-2008 11:06 PM