BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 01-26-2008, 02:57 PM   #1 (permalink)
New Member
 
Join Date: Jan 2008
Model: 8320
PIN: N/A
Carrier: Verizon
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How do you HIGHLIGHT a menu item?

Please Login to Remove!

How do you simply HIGHLIGHT whatever menu item you want
from within your own BB application?

The RIM Class MenuItem documentation Field summary shows
static int flags like 'SELECT' and 'CANCEL_SELECT' but the
Method summary for the class doesn't give you a clue what,
if anything, you can do with these commands.

The 'Menu' class ( Parent class for MenuItem? ) has the
obvious setDefault() and setItemHighlight() methods but
how do you just simply 'call' these parent Class 'Menu'
methods from within your own application?

Would it be some kind of 'super.setDefault()' call from
within the constructor of your own 'MenuItem'?

All I want to do is the same thing I see native RIM apps doing.

If I have added screen jump menu items to my own application
menu that lets the user go from screen to screen within the (same)
application then whatever screen the person is currently on...
when they press the MENU button again the last menu item
chosen should stay HIGHLIGHTED until they pick another menu
item and jump to another screen.

This ought to be simple. What am I missing here?
Offline  
Old 01-26-2008, 04:14 PM   #2 (permalink)
New Member
 
Join Date: Jan 2008
Model: 8320
PIN: N/A
Carrier: Verizon
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Answering my own question here...

What I appear to missing are brain cells.

When 'makeMenu' is called you then have a pointer to 'menu'
and anywhere within the 'makeMenu' override while you are
creating your MenuItems you can just call...

menu.setDefault( (MenuItem) my_menu_item );

If you want to set/change the default menu item AFTER
'makeMenu' or at some other run-time point within your
application then all you have to do is 'remember' what
the last 'menu' handle was passed to the last 'makeMenu'
method.

Create yourself a 'global' that can seen from all 'screens'
such as...

static Menu _menu = null;

...and then every time 'makeMenu' is called anywhere
in your application just update it with the 'Menu'
pointer being passed to you by 'makeMenu'...

_menu = menu;

Then, from anywhere in your application, as long as you
have also saved the 'MenuItem' handles for your own
menu items saved to globals as well you can just call...

_menu.setDefault( (MenuItem) my_menu_item );
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Packet8 ST2118 Analog Business Telephone and Adaptor - VOIP HANDSET
$19.99
Packet8 ST2118 Analog Business Telephone and Adaptor - VOIP HANDSET pictureVoIP 4-Port Zone Controller
$432.4
VoIP 4-Port Zone Controller picturePanasonic KX-TDE0111 KXTDE0111 TDE0111 DSP64 64DSP DSP VOIP Good condition
$591.4
Panasonic KX-TDE0111 KXTDE0111 TDE0111 DSP64 64DSP DSP VOIP Good condition pictureUSB SKYPE Laptop PC VOIP black IP Phone. Good condition
$5.92
USB SKYPE Laptop PC VOIP black IP Phone. Good condition pictureQty 5 - Backlight Panels from Aastra VOIP Phones - Good for Projects
$12.95
Qty 5 - Backlight Panels from Aastra VOIP Phones - Good for Projects picture






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