You Are Here:

Community: Developer Discussion Boards

#1 Old traverse and 40 series - 2006-11-26, 11:45

Join Date: Nov 2005
Posts: 322
Location: Amman/Jordan
dakoz's Avatar
dakoz
Offline
Regular Contributor
hello people ..


am planning to build a custom list ..
i have a sample example to use ... the one on the tips and tricks of www.java.sun.com
but it doesn't work on the nokia 40 series .. i debuged the application on a 6230i emulator it the canvas.down is only catched once ...
i don't know whats is wrong with it .....
here is the traverse code am using .....

Code:
public boolean traverse( int dir, int vw, int vh,
                             int[] vrect ){
        if( !_inTraversal ){
            _inTraversal = true;

            if( _selected <=0 && _count > 0 ){
                if( dir == Canvas.DOWN || dir == Canvas.RIGHT ){
                    _selected = 0;
                } else if( dir == Canvas.UP || dir == Canvas.LEFT ){
                    _selected = _count - 1;
                }

                makeSelectedVisible();
                repaint();
                notifyStateChanged();
            }

            return true;
        }

        int modes = getInteractionModes();
        boolean horiz = ( modes & TRAVERSE_HORIZONTAL ) != 0;
        boolean vert = ( modes & TRAVERSE_VERTICAL ) != 0;
        boolean notify = false;

        if( dir == Canvas.DOWN ||
            ( dir == Canvas.RIGHT && !vert ) ){
            if( _selected < _count - 1 ){
                ++_selected;
                notify = true;
            } else {
                return false;
            }
        } else if( dir == Canvas.UP ||
            ( dir == Canvas.LEFT && !vert ) ){
            if( _selected > 0 ){
                --_selected;
                notify = true;
            } else {
                return false;
            }
        } else if( dir != NONE ){
            return false;
        }

        makeSelectedVisible();
        repaint();

        if( notify ){
            notifyStateChanged();
        }

        return true;
    }
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia