BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Make Custom Context Menu? (http://www.blackberryforums.com/developer-forum/94398-make-custom-context-menu.html)

pa4o85 09-10-2007 07:29 AM

Make Custom Context Menu?
 
I would like to make a custom context menu and my problem is with the separator. I use this code:

Code:

protected void makeContextMenu(ContextMenu contextMenu) {
    contextMenu.addItem(feedListScreen);
    contextMenu.addSeparatorInternal();
    contextMenu.addItem(syncScreen);
    contextMenu.addItem(toolsScreen);
    contextMenu.addItem(helpScreen);
  }

I have only a method AddSeparatorInternal(); and it puts the Separator at the bottom of the ContextMenu i.e. above the helpScreen MenuItem object but I would like to put it between feedListScreen MenuItem object and syncScreen MenuItem object. Do u know how? I don't have a method addSeparator() it is only available for Menu class.Thank U!

Skipper_Joe 09-11-2007 02:47 PM

use static method MenuItem.separator(int ordinal):
Code:

protected void makeContextMenu(ContextMenu contextMenu) {
    contextMenu.addItem(feedListScreen);
    contextMenu.addItem(MenuItem.separator(10)); // actual value depends on ordinal of other menuitems
    contextMenu.addItem(syncScreen);
    contextMenu.addItem(toolsScreen);
    contextMenu.addItem(helpScreen);
  }


pa4o85 09-12-2007 01:39 AM

Hi, I found out the way. I just should look the JDE library more carefully. Thank you!


All times are GMT -5. The time now is 04:10 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.