BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 11-10-2006, 12:00 PM   #1
donricouga
Thumbs Must Hurt
 
Join Date: Jul 2006
Location: Atlanta
Model: 8703e
Carrier: Sprint
Posts: 58
Question Separator in Menu

Please Login to Remove!

I am trying to add a seperator to the menu of my screen class. The menu Items I have created work fine but when I try to add a separator to organize the options, it doesn't work at all and no errors ???? Anyone know why ?
I created my own class that subclasses net.rim.device.api.ui.container.FullScreen as follows

Code:
public class myScreen extends FullScreen
{
    protected void makeMenu(Menu menu, int instance)
    {
         //add some MenuItems
         menu.addSeparator();  //doesn't work
         menu.getDefault().separator(100); //doesnt work
         super(menu, instance);
    }
}
__________________
Cingular BB 7290 and Sprint BB 8703e.
Offline  
Old 11-12-2006, 12:44 PM   #2
Vorino
Knows Where the Search Button Is
 
Vorino's Avatar
 
Join Date: Aug 2006
Location: Canada
Model: All
PIN: ABBAABBA
Carrier: Rogers
Posts: 25
Default

I've noticed that when you build the entire menu, the separator goes in fine, but if you build a menu on a screen with, for example, an edit field (which has its own menu items), your own separators get ignored. But I don't have any more details or explanations than that at the moment.
__________________
Paul Beaulieu, Vorino Software Inc. -- http://vorino.com
Offline  
Old 11-15-2006, 03:22 PM   #3
adwiv
Thumbs Must Hurt
 
Join Date: Oct 2006
Model: 8707g
Carrier: Hutch
Posts: 73
Default

addSeperator adds the seperator to the end of the menu. When you are builing the menu on the screen, the default menu item - Close - is already there, with a very high ordinal, and hence occupying the last position in menu. Your Seperator goes and adds at the end of menu, which is useless.
Try doing a addMenuItem(MenuItem.seperator(ordinal)) where ordinal is greater the integer value of the item after which you want the seperator.

For example, if you have just added the following menuitem

new MenuItem("Show", 2000, 10) {....} and want the seperator after it,

use 2001 as the ordinal value
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump






Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.