BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links




Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
cybrown Offline
New Member
 
Posts: 5
Join Date: Aug 2007
Model: 8300
PIN: N/A
Carrier: Cingular
Question Super simple(?) newbie nextFocus question - 11-20-2007, 04:11 PM

I'm creating a custom manager, and I'm baffled by why my focus handling doesn't work. Rather than post the entire program, I've written a quick test app that baffles me as well. Why doesn't this application produce a dialog? It looks like the nextFocus() method never gets called. Please help!

Code:
package FocusTest;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.system.*;

class FocusTest extends UiApplication{
    public static void main(String args[]){
        FocusTest theApp = new FocusTest();
        theApp.enterEventDispatcher();
    }
    
    FocusTest() {
        pushScreen(new FocusTestMainScreen());
    }
} 

class FocusTestMainScreen extends MainScreen{
    VerticalFieldManager vfm;
    FocusTestMainScreen(){
        super();
        vfm = new VerticalFieldManager(){
            protected int nextFocus(int direction, boolean alt){
                Dialog.alert("Focus change!");
                return super.nextFocus(direction,alt);
            }
        }; //THIS NEVER GETS CALLED!?

        vfm.add(new LabelField("Hello",Field.FOCUSABLE));
        vfm.add(new LabelField("world!",Field.FOCUSABLE));
        add(vfm);
    }
}
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
cybrown Offline
New Member
 
Posts: 5
Join Date: Aug 2007
Model: 8300
PIN: N/A
Carrier: Cingular
Default 11-26-2007, 02:47 PM

After some digging around on the RIM message boards, I found a VERY brief note that the function was changed to:
nextFocus(int direction, int n)

When I override this function, I instantly get the results I want, but I can't find it ANYWHERE in the documentation. Did anyone here know that already, and can anyone tell me what the mysterious "int n" represents? Thanks!!
   
Reply With Quote
  (#3 (permalink)) Old
haagmm Offline
New Member
 
Posts: 2
Join Date: Jun 2008
Model: 8700
PIN: N/A
Carrier: AT&T
Default 06-19-2008, 03:57 AM

So i hope you found the answer out by now, but since google took me here and you answered my question, as far as i can tell alt is 1 for a horizontal move of the trackball and 2 for a vertical move.

i cant get my tether to an 8700 to work right so i cant tell you what it does on a track wheal
   
Reply With Quote
  (#4 (permalink)) Old
richard.puckett Offline
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Posts: 212
Join Date: Oct 2007
Location: Seattle, WA
Model: 8800
PIN: N/A
Carrier: AT&T
Default 06-19-2008, 11:04 AM

Here's a brief explanation that I posted on the RIM dev forums recently. HTH.


Do your homework and know how to ask a good question.
   
Reply With Quote
Reply


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






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1