BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-13-2007, 10:52 AM   #1 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7100
PIN: N/A
Carrier: Vodafone
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question .trackwheelRoll()

Please Login to Remove!

I'm implementing TrackwheelListener and my code in .trackwheelClick() is working correctly but .trackwheelRoll() never fires.

Any ideas?
Offline  
Old 09-13-2007, 11:35 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

if you paste your code we might be able to help
Offline  
Old 09-14-2007, 04:18 AM   #3 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7100
PIN: N/A
Carrier: Vodafone
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's the code

Code:
package com.lyon.forum;

import net.rim.device.api.system.TrackwheelListener;

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.FlowFieldManager;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.RichTextField;

public class Forum extends UiApplication implements TrackwheelListener
{
    public MainScreen _MainScreen;
    
    public static void main( String[] args )
    {
        Forum forum = new Forum();
        forum.enterEventDispatcher();
    }

    public Forum()
    {
        this._MainScreen = new MainScreen();
        this._MainScreen.addTrackwheelListener( this );
        this._MainScreen.setTitle( new LabelField( "Forum", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH ) );
        
        this._MainScreen.add( new RichTextField( "RichTextFieldA" ) );
        this._MainScreen.add( new RichTextField( "RichTextFieldB" ) );
        this._MainScreen.add( new RichTextField( "RichTextFieldC" ) );

        this.pushScreen( this._MainScreen );
    }

    public boolean trackwheelClick( int status, int time )
    {
        Field leafField = this.getActiveScreen().getLeafFieldWithFocus();
        if ( leafField instanceof RichTextField )
        {
            RichTextField richTextField = (RichTextField) leafField;
            Dialog.alert( richTextField.getText() );
        }
        return true;
    }

    public boolean trackwheelUnclick( int status, int time )
    {
        return false;
    }

    public boolean trackwheelRoll(int amount, int status, int time)
    {
        this._MainScreen.setTitle( this.getActiveScreen().getLeafFieldWithFocus().toString() );
        return true;
    }
}
I think I'm on the case because .trackwheelRoll() IS being fired but only when you scroll past the Fields.
Offline  
Old 09-14-2007, 09:06 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

in trackwheelRoll try returning super.trackwheelroll(amount, status, time);
Offline  
Old 09-17-2007, 05:17 AM   #5 (permalink)
New Member
 
Join Date: Sep 2007
Model: 7100
PIN: N/A
Carrier: Vodafone
Posts: 10
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks anyway but that doesn't work. I got what I wanted by Extending RichTextField and overriding .onFocus().


Quote:
Originally Posted by bemshaswing View Post
in trackwheelRoll try returning super.trackwheelroll(amount, status, time);
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

COMPUTER GRADE 140,000 uF 20 V MEPCO/ELECTRA ELECTROLYTIC CAPS 3186GH144U020AM
$14.0
COMPUTER GRADE 140,000 uF  20 V MEPCO/ELECTRA  ELECTROLYTIC CAPS 3186GH144U020AM pictureHV Doorknob Capacitor 680 pF 12kV (18kV) Brand New Lot of 2pcs
$15.5
HV Doorknob Capacitor 680 pF 12kV (18kV) Brand New  Lot of 2pcs picture(Lot of 4) Sprague 39D 200uf 250VDC Capacitor
$10.0
(Lot of 4) Sprague 39D 200uf 250VDC Capacitor  picture1 PC 10,000uf 10000uf 10000mfd 50V Electrolytic Capacitor 105c 51mm x 35mm
$7.88
1 PC 10,000uf 10000uf 10000mfd 50V Electrolytic Capacitor 105c 51mm x 35mm picture10 pcs New 1000UF 25V Radial Electrolytic Capacitor
$1.69
10 pcs New 1000UF 25V Radial Electrolytic Capacitor picture






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