Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14964
Modified Files: Tag: devel_0_39 desire.tk Log Message: Canvas tab_jump rewrite.....
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.542 retrieving revision 1.1.2.543 diff -C2 -d -r1.1.2.542 -r1.1.2.543 *** desire.tk 31 Oct 2006 19:14:09 -0000 1.1.2.542 --- desire.tk 2 Nov 2006 00:41:41 -0000 1.1.2.543 *************** *** 1407,1411 **** set @iosel_deselect 0 ;# if selected should be deselected by clicking at empty space set @keynav_current 0 ! set @keynav_last 0 set @keynav_tab_sel "wire" set @keynav_shift 0 --- 1407,1412 ---- set @iosel_deselect 0 ;# if selected should be deselected by clicking at empty space set @keynav_current 0 ! set @keynav_last_obj 0 ! set @keynav_last_wire 0 set @keynav_tab_sel "wire" set @keynav_shift 0 *************** *** 2250,2254 **** def Canvas del {i} { set o [lindex $@children $i] ! $@history add [list $self ins $i [$o deconstruct]] pd .$self object_delete !$o } --- 2251,2262 ---- def Canvas del {i} { set o [lindex $@children $i] ! if {[$o class] != "Canvas"} { ! $@history add [list $self ins $i [$o deconstruct]] ! } else { ! #$@history add [list $self ins $i [$o deconstruct]] ! foreach wire [$o wires] {$@history add [list $o ins $i [$wire deconstruct]]} ! foreach obj [$o children] {$@history add [list $o ins $i [$obj deconstruct]]} ! $@history add [list $self ins $i [$o deconstruct]] ! } pd .$self object_delete !$o } *************** *** 2780,2783 **** --- 2788,2796 ---- }
+ def Canvas deselect_all_objs {} { + foreach o $@selection {$o selected?= 0} + set @selection {} + } + def Canvas popup_help {} {global main; $main class_browser}
*************** *** 3208,3268 **** set wlength [llength $@selection_wire] if {$@keynav_tab_sel == "object"} {set @keynav_tab_sel "wire"} else {set @keynav_tab_sel "object"} - #puts "o:: $olength w:: $wlength" - #puts "what??? $@keynav_tab_sel" switch $@keynav_tab_sel { ! object { ! #if {$@keynav_current == ""} {return} ! if {$@keynav_current == 0} {set @keynav_current [lindex $@children 0]} ! $@keynav_current selected?= 0 ! #$self selection_wire-= $@keynav_current ! if {$olength} { ! set @keynav_current [lindex $@selection 0] ! } else { ! if {$wlength} { ! set wire [lindex $@selection_wire 0] ! $self selection_wire-= $@keynav_current ! set @keynav_last $@keynav_current ! set @keynav_current $_($wire:obj1) } } ! set @selection $@keynav_current ! #set @keynav_tab_sel "wire" ! } ! wire { ! #if {$@keynav_current == ""} {return} ! #if {![llength $@selection_wire]} {return} ! if {[llength $@selection_wire]} { ! if {$@keynav_current == 0} {set @keynav_current [lindex $@selection_wire 0]} ! $@keynav_current selected?= 0 } else { ! if {[llength $@wires_pair]} {set @keynav_current [lindex $@wires_pair 1]} else {return} } ! if {$wlength} { ! set @keynav_current [lindex $@selection_wire 0] } else { ! if {$olength} { ! set obj [lindex $@selection 0] ! $self selection-= $@keynav_current ! #set @keynav_current [lindex $_($obj:wires) 0] ! if {$@keynav_last == 0} {set @keynav_last [lindex $_($obj:wires) 0]} ! #set @keynav_current $@keynav_last ! } } - set @selection_wire $@keynav_current - #set @keynav_tab_sel "object" - } - }
- #if {$@keynav_current != ""} {$@keynav_current selected?= 1} - $@keynav_current selected?= 1 - #if {$@keynav_tab_sel == "object"} {set @keynav_tab_sel "wire"} else {set @keynav_tab_sel "object"} - #puts "-------------------------------------------" - #puts " selection:::: [$self selection]" - #puts " selection_wire:::: [$self selection_wire]" - #puts " keynav_current:::: $@keynav_current" - #puts " keynav_tab_sel:::: $@keynav_tab_sel" }
def Canvas key_nav_up {} {$self key_nav +1 -1 0} def Canvas key_nav_down {} {$self key_nav -1 +1 0} --- 3221,3307 ---- set wlength [llength $@selection_wire] if {$@keynav_tab_sel == "object"} {set @keynav_tab_sel "wire"} else {set @keynav_tab_sel "object"} switch $@keynav_tab_sel { ! object {$self tab_jump_object} ! wire {$self tab_jump_wire} ! } ! } ! ! def Canvas tab_jump_wire {} { ! set wlength [llength $@selection_wire] ! # if no selection done by the mouse ! if {!$wlength} { ! # see if the selected object has wire, if yes, use it ! # if keynav_current is already a wire, do nothing ! if {[$@keynav_current class] != "Wire"} { ! #use the last key selected wire as start if there is one ! if {$@keynav_last_wire != 0} { ! $self deselect_all ! set @keynav_current $@keynav_last_wire ! } else { ! if {[llength [$@keynav_current wires]]} { ! $self deselect_all ! set @keynav_current [lindex [$@keynav_current wires] 0] ! set @keynav_last_wire $@keynav_current ! ! } else { ! # check if the canvas has wires, if yes, use it ! if {[llength $@wires]} { ! $self deselect_all ! set @keynav_current [lindex $@wires 0] ! set @keynav_last_wire $@keynav_current ! } else {return} ! ! } } } ! } else { ! ! } ! $self selection_wire= $@keynav_current ! ! } ! ! def Canvas tab_jump_object {} { ! set olength [llength $@selection] ! # if there is no selection done by mouse ! if {!$olength} { ! # if keynav_current is 0, aka the start of key navigation ! ! if {$@keynav_current == 0} { ! if {[llength $@children]} { ! # use the first @children as selection, else return ! set @keynav_current [lindex $@children 0] ! } else {return} } else { ! # if the keynav_current is a wire, set keynav_current to a object ! if {[$@keynav_current class] == "Wire"} { ! set @keynav_last $@keynav_current ! $self deselect_all ! # use the last key selected obj as the start if there is one ! if {$@keynav_last_obj != 0} { ! set @keynav_current $@keynav_last_obj ! } else { ! set @keynav_current [lindex [$@keynav_current report] 0] ! set @keynav_last_obj $@keynav_current ! } ! } } ! ! } else { ! #if there is selection done by mouse ! if {$olength == 1} { ! set @keynav_current [lindex $@selection 0] ! $self deselect_all } else { ! $self deselect_all ! set @keynav_current [lindex $@children 0] ! set @keynav_last_obj $@keynav_current } } + $self selection= $@keynav_current
}
+ def Canvas key_nav_up {} {$self key_nav +1 -1 0} def Canvas key_nav_down {} {$self key_nav -1 +1 0} *************** *** 3300,3303 **** --- 3339,3343 ---- $self selection-= $@keynav_current $@keynav_current selected?= 0 + set @keynav_last_obj $@keynav_next } if {[lsearch $@selection $@keynav_next] < 0} {lappend @selection $@keynav_next} *************** *** 3310,3313 **** --- 3350,3354 ---- $self selection_wire-= $@keynav_current $@keynav_current selected?= 0 + set @keynav_last_wire $@keynav_next } if {[lsearch $@selection_wire $@keynav_next] < 0} {lappend @selection_wire $@keynav_next} *************** *** 7236,7239 **** --- 7277,7281 ---- def Box deconstruct {} { global fields + puts " <> [array names fields $@pdclass]" if {[array names fields $@pdclass] == ""} { return [concat [list #X obj $@x1 $@y1] $@text] *************** *** 7251,7255 ****
def Canvas deconstruct {} { ! error "Canvas deconstruct: that's a feature request" }
--- 7293,7302 ----
def Canvas deconstruct {} { ! ##N canvas 0 0 450 300 qwer 0; ! #.x82a9d10 object_insert 0 #X obj 193 85 t ! #error "Canvas deconstruct: that's a feature request" ! puts " <><> [concat [list #X obj $@x1 $@y1] $@text] <><>" ! return [concat [list #X obj $@x1 $@y1] $@text] ! }