Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Menu does open when push trackball button' is it right ?

Hello guys'

 

I've made several menus for my application.This is my source code for making menu :

 

 

private class SimpleScreen extends MainScreen { .... public SimpleScreen() { .... } private MenuItem _menu1 = new MenuItem("Menu 1", 100000,10) { public void run() { ... } }; private MenuItem _menu2 = new MenuItem("Menu 2", 200000,10) { public void run() { ... } }; protected void makeMenu( Menu menu, int instance ) { menu.add(_menu1); menu.add(_menu2); super.makeMenu(menu, instance); } }

 

Then I run the application, I saw menu items when push on BlackBerry button. It is OK, no problem.

And while I push on trackball button (I try to mean trundle button on center of BB.) , opens menu items.

 

Why does menu open when push on trackball button ? Is it working right ? I want to make it only when push on BlackBerry button. 

I am using BlackBerry JDE 4.2.1 simulator(BB 8800).


Tnx all guys

 

Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Menu does open when push trackball button' is it right ?

[ Edited ]
The menu is meant to open if the trackball/wheel click is not consumed. If you consume the trackball click by overriding trackwheelClick() and returning true, the menu won't open. You probably want to call super.trackwheelClick() first, but still return true manually.
Message Edited by mreed on 08-24-2008 10:15 PM
Please use plain text.
Developer
Raiden
Posts: 490
Registered: ‎07-16-2008
My Device: Not Specified

Re: Menu does open when push trackball button' is it right ?

Tnx man' It is working fine.
Please use plain text.