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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
brchase
Posts: 5
Registered: ‎07-20-2008
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


Please use plain text.
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

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().
Please use plain text.
New Developer
brchase
Posts: 5
Registered: ‎07-20-2008

Re: Add To DEFAULT_MENU

I have simply been creating a new Menu() object and then adding  MenuItem objects. - Brian
Please use plain text.
Developer
mreed
Posts: 1,023
Registered: ‎07-16-2008

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
Please use plain text.