BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 01-26-2008, 02:57 PM   #1
kberry
New Member
 
Join Date: Jan 2008
Model: 8320
PIN: N/A
Carrier: Verizon
Posts: 7
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
kberry
New Member
 
Join Date: Jan 2008
Model: 8320
PIN: N/A
Carrier: Verizon
Posts: 7
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



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


Measurement Computing 4-20mA Input 24-Channel Analog Input Board CIO-DAS48 picture

Measurement Computing 4-20mA Input 24-Channel Analog Input Board CIO-DAS48

$180.00



Onset Computer Analog/Temp/RH/Light Data Logger MX1104 Onset Computer MX1104 picture

Onset Computer Analog/Temp/RH/Light Data Logger MX1104 Onset Computer MX1104

$271.78



Schneider PLC TWIDO TM2AMM6HT ANALOGUE I/O MODULE 20mA 24VDC Missing Terminal picture

Schneider PLC TWIDO TM2AMM6HT ANALOGUE I/O MODULE 20mA 24VDC Missing Terminal

$156.00



Measurement Computing 4-20mA Input 24-Channel Analog Input Board CIO-DAS48-I picture

Measurement Computing 4-20mA Input 24-Channel Analog Input Board CIO-DAS48-I

$899.99



Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog picture

Measurement Computing 197728B USB 1608HS-2A0 16-Channel Digital DAQ +2 Analog

$650.00



Measurements Computing PCI-DDA02/16 Analog Output and Digital I/O Card picture

Measurements Computing PCI-DDA02/16 Analog Output and Digital I/O Card

$699.99







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