10-22-2008 10:09 PM
Hi guys'
I need to make menu for my application. I made menus for MainScreen and this screen includes PopupScreen.
When push PopupScreen, the menu doesn't appear on screen. I want to appear the menus when push PopupScreen.
Is it possible to make menus for PopupScreen ?
Plz share knowledge.
Tnx'
Solved! Go to Solution.
10-23-2008 03:27 AM
I think PopupScreen don't support menu items.
10-23-2008 04:29 AM
It is possible. In your constructor make sure you specify DEFAULT_MENU. Then just override the the makeMenu function:
public void makeMenu(Menu menu, int instance)
{if (instance == Menu.INSTANCE_DEFAULT)
{// Add your menus here.
// menu.add(...);
}
super.makeMenu(menu, instance);
}
-- Ian
10-23-2008 06:00 AM - edited 10-23-2008 06:04 AM
Tnx for your advice'
I've tried your code. But the menu doesn't appear on the screen.
Is it really impossible to make menus for PopupScreen ?
What do other dear advisors think ?
10-23-2008 09:13 AM
It definitely works because I've done it before. Try also specifying DEFAULT_CLOSE. Just to be sure you're doing it right here is a basic class:
class MyPopup extends PopupScreen { MyPopup() { super(new VerticalFieldManager(), DEFAULT_MENU|DEFAULT_CLOSE); } public void makeMenu(Menu menu, int instance) { if (instance == Menu.INSTANCE_DEFAULT) { menu.add(_myItem); } super.makeMenu(menu, instance); } protected MenuItem _myItem = new MenuItem("My Item", 100, 10) { public void run() { // do something here } };
}
10-23-2008 10:18 PM