| Reply | « Previous Thread | Next Thread » |
|
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|