Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8657
Modified Files: Tag: devel_0_39 desire.tk Log Message: more key_nav
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.325 retrieving revision 1.1.2.326 diff -C2 -d -r1.1.2.325 -r1.1.2.326 *** desire.tk 13 Aug 2006 08:30:32 -0000 1.1.2.325 --- desire.tk 13 Aug 2006 08:42:24 -0000 1.1.2.326 *************** *** 2444,2448 **** def Canvas key_nav_left_shift {} {$self key_nav "left" 1}
! proc inside {x x0 x1} {return [expr $x>=$x0 && $x<=$x1]}
def* Canvas key_nav {direction shift} { --- 2444,2450 ---- def Canvas key_nav_left_shift {} {$self key_nav "left" 1}
! # intervals ! proc inside {x x0 x1} {return [expr $x>=$x0 && $x<=$x1]} ! proc overlap {y0 y1 x0 x1} {return [expr [inside $y0 $x0 $x1] || [inside $y1 $x0 $x1]]}
def* Canvas key_nav {direction shift} { *************** *** 2453,2462 **** set off 0 set max 100 - switch $direction { - up {set axis y; set polarity -1} - down {set axis y; set polarity +1} - left {set axis x; set polarity -1} - right {set axis x; set polarity +1} - } set x1 $_($@keynav_current:x1); set xs $_($@keynav_current:xs) set y1 $_($@keynav_current:y1); set ys $_($@keynav_current:ys) --- 2455,2458 ---- *************** *** 2465,2493 **** set top [expr $y1 - $ys*$off]; set bottom [expr $y1 + $ys + $ys*$off] foreach item $children { ! set ix1 $_($item:x1); set ix2 [expr $ix1 + $_($item:xs)] ! set iy1 $_($item:y1); set iy2 [expr $iy1 + $_($item:ys)] switch $direction { ! up { ! if {$iy1 >= $y1} {continue} ! set add [expr [inside $ix1 $left $right] || [inside $ix2 $left $right]] ! } ! down { ! if {$iy1 <= $y1} {continue} ! set add [expr [inside $ix1 $left $right] || [inside $ix2 $left $right]] ! } ! right { ! if {$ix1 <= $x1} {continue} ! set add [expr [inside $iy1 $top $bottom] || [inside $iy2 $top $bottom]] ! } ! left { ! if {$ix1 >= $x1} {continue} ! set add [expr [inside $iy1 $top $bottom] || [inside $iy2 $top $bottom]] ! } } if {$add} { lappend group $item ! lappend distances [switch $axis { ! y {expr abs($iy1-$y1)} ! x {expr abs($ix1-$x1)} }] } --- 2461,2477 ---- set top [expr $y1 - $ys*$off]; set bottom [expr $y1 + $ys + $ys*$off] foreach item $children { ! mset {ix1 iy1 ix2 iy2} [$item bbox] ! set add 0 switch $direction { ! up {if {$iy1 < $y1} {set add [overlap $ix1 $ix2 $left $right]}} ! down {if {$iy1 > $y1} {set add [overlap $ix1 $ix2 $left $right]}} ! left {if {$ix1 < $x1} {set add [overlap $iy1 $iy2 $top $bottom]}} ! right {if {$ix1 > $x1} {set add [overlap $iy1 $iy2 $top $bottom]}} } if {$add} { lappend group $item ! lappend distances [switch -regexp $direction { ! up|down {expr abs($iy1-$y1)} ! left|right {expr abs($ix1-$x1)} }] }