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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Simulating buttons using bitmap on Storm touch screen

I have an old app thats working with 8300, 8800, 9000 that uses bitmaps as buttons. Using getLeafFieldWithFocus and trackwheelClick i can push new screens depending on which bitmap field has focus.

 

I'm trying to update the app to work on the Storm and have reviewed the TouchEvent and TouchGesture class but I still can't figure out how the touchEvent(TouchEvent message) gets fired so i can push a new screen.

 

I'm compiling a CLDC app that extends UiApplication and the touchEvent looks something like this.

 

 

public boolean touchEvent(TouchEvent message) { int eventCode = message.getEvent(); if(eventCode == TouchEvent.CLICK) { if ( whatFieldFocus == bitmapField1 ) { try { UiApplication.getUiApplication().pushScreen(new Screen1()); } catch( Exception e) { System.out.println(e); } } else if ( whatFieldFocus == bitmapField2 ) { try { UiApplication.getUiApplication().pushScreen(new Screen2()); } catch( Exception e) { System.out.println(e); } } else if ( whatFieldFocus == bitmapField3 ) { try { UiApplication.getUiApplication().pushScreen(new Screen3()); } catch( Exception e) { System.out.println(e); } } } return true; }

 

Does this code look okay?
 

 

Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: Simulating buttons using bitmap on Storm touch screen

figured this out. lots of changing in my UI for the new OS.
New Developer
Posts: 1
Registered: ‎12-17-2008
My Device: Not Specified

Re: Simulating buttons using bitmap on Storm touch screen

Could you please shed some light on how you did it?  Thanks a lot!
Highlighted
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: Simulating buttons using bitmap on Storm touch screen

I extended the bitmapfield like so:

BitmapField bitmapField = new BitmapField(bmImage,BitmapField.FOCUSABLE ) { protected boolean navigationClick(int status, int time) { try { UiApplication.getUiApplication().pushScreen(new MyScreen()); } catch( Exception e) { System.out.println(e); } return true; } };

 

seems to be working fine so far.