[PD-cvs] pd/src desire.tk,1.1.2.318,1.1.2.319

chunlee chunlee at users.sourceforge.net
Sat Aug 12 17:52:51 CEST 2006


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10305

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
first commit for codes dealing with making wires with keys


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.318
retrieving revision 1.1.2.319
diff -C2 -d -r1.1.2.318 -r1.1.2.319
*** desire.tk	11 Aug 2006 17:18:14 -0000	1.1.2.318
--- desire.tk	12 Aug 2006 15:52:48 -0000	1.1.2.319
***************
*** 543,546 ****
--- 543,547 ----
  set key(key_nav_right_shift) "Ctrl+RIGHT"
  set key(key_nav_left_shift) "Ctrl+LEFT"
+ set key(key_nav_ioselect) "Ctrl+tab"
  set key(incr_zoom) "Ctrl+equal"
  set key(decr_zoom) "Ctrl+minus"
***************
*** 999,1002 ****
--- 1000,1004 ----
  	set @noutlets 0
  	set @duplicate 0
+ 	set @ioselect {}
  	super
  }
***************
*** 1289,1292 ****
--- 1291,1300 ----
      set @coords 0
      set @jump 0
+     # the io select count
+     set @keynav_iocount 0
+     # which in/outlet is select
+     set @keynav_port 0
+     # the list of objects that has io selected
+     set @keynav_iosel {}
      set @keynav_current 0
      set @keynav_next 0
***************
*** 2238,2241 ****
--- 2246,2250 ----
  	if {![llength $id]} {
  		$self deselect_all
+ 		$self dehilite_io
  		set @action rect
  		$c create line $x $y $x $y $x $y $x $y $x $y \
***************
*** 2527,2536 ****
  		if {[llength $@children] != 0} {
  		$self deselect_all
- 		set @keynav_current [lindex $@children 0]
- 		set @selection $@keynav_current
- 		$@keynav_current selected?= 0 
  		set obj_sel [lindex $@children $@jump]
  		$obj_sel selected?= 1
  		set @keynav_current $obj_sel
  		#set @selection $obj_sel 
  		#puts "jump -> $@jump"
--- 2536,2543 ----
  		if {[llength $@children] != 0} {
  		$self deselect_all
  		set obj_sel [lindex $@children $@jump]
  		$obj_sel selected?= 1
  		set @keynav_current $obj_sel
+ 		set @selection $@keynav_current
  		#set @selection $obj_sel 
  		#puts "jump -> $@jump"
***************
*** 2577,2581 ****
  		}
  		incr off
! 		puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
--- 2584,2588 ----
  		}
  		incr off
! 		#puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
***************
*** 2597,2601 ****
  		}
  		incr off
! 		puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
--- 2604,2608 ----
  		}
  		incr off
! 		#puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
***************
*** 2617,2621 ****
  		}
  		incr off
! 		puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
--- 2624,2628 ----
  		}
  		incr off
! 		#puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
***************
*** 2637,2641 ****
  		}
  		incr off
! 		puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
--- 2644,2648 ----
  		}
  		incr off
! 		#puts "incr ----> $off"
  		if {$off == $max} {break}
  		}
***************
*** 2654,2658 ****
  		set @keynav_next [lindex $group $index]
  		} else {
! 		set @keynav_next $@selection
  		}
  		
--- 2661,2665 ----
  		set @keynav_next [lindex $group $index]
  		} else {
! 		set @keynav_next [lindex $@selection end end]
  		}
  		
***************
*** 2668,2671 ****
--- 2675,2738 ----
  }
  
+ def* Canvas key_nav_ioselect {} {
+ 	if {[llength $@selection] == 1} {
+ 		set var [lindex $@keynav_iosel end end]
+ 		if {[lsearch $@keynav_iosel $@selection] < 0} {lappend @keynav_iosel $@selection; set @keynav_iocount 0}
+ 		if {$@keynav_port != 0 && $@keynav_current == $var } {set hilitebox $@keynav_port;.$self.c delete ${hilitebox}b} 
+ 		set obj $@selection
+ 		#"$self$which $self$which$i $self"
+ 		set ins [$obj ninlets]
+ 		set outs [$obj noutlets]
+ 		set ports {}
+ 		set ports2 {}
+ 		set ports3 {}
+ 		for {set i 0} {$i < $ins} {incr i} {
+ 			lappend ports ${obj}i${i}
+ 			lappend ports2 "i"
+ 			lappend ports3 $i
+ 		}
+ 		for {set i 0} {$i < $outs} {incr i} {
+ 			lappend ports ${obj}o${i}
+ 			lappend ports2 "o"
+ 			lappend ports3 $i
+ 		}
+ 		#incr @keynav_iocount
+ 		if {$@keynav_iocount >= [llength $ports]} {set @keynav_iocount 0}
+ 		#puts "	ports:::: $ports"
+ 		#puts "	count ::: $@keynav_iocount"
+ 		mset {x y x1 y1} [.$self.c bbox [lindex $ports $@keynav_iocount]]	
+ 		set @keynav_port [lindex $ports $@keynav_iocount]
+ 		#puts "	port:::: $@keynav_port"
+ 		#puts "	ports:::: $@keynav_iosel"
+ 		#set _($@selection:ioselect) [lindex $ports $@keynav_iocount]
+ 		set _($@selection:ioselect) [list [lindex $ports3 $@keynav_iocount] [lindex $ports2 $@keynav_iocount]]
+ 		$obj hilite_io [lindex $ports2 $@keynav_iocount] $x $y
+ 		
+ 		incr @keynav_iocount
+ 		#puts "	select a io for $@selection|$ins|$outs"
+ 		#mset {x y x1 y1} [.$self.c bbox ${obj}i0]
+ 		#set port [$obj hilite_io i $x $y]
+ 	}
+ }
+ 
+ def* Canvas dehilite_io {} {
+ 	if {[llength $@keynav_iosel]} {
+ 		foreach io $@keynav_iosel {
+ 		puts "delete ::::: $_($io:ioselect)"
+ 		set box $_($io:ioselect)
+ 		#.$self.c delete ${box}b
+ 		set type [lindex $_($io:ioselect) 1]
+ 		set port [lindex $_($io:ioselect) 0]
+ 		set tag ${io}${type}${port}
+ 		.$self.c delete ${tag}b
+ 		set _($io:ioselect) {}
+ 		}
+ 		set @keynav_iosel {}
+ 		set @keynav_port 0 
+ 		set @keynav_iocount 0
+ 		}
+ 
+ }
+ 
  def* Canvas incr_zoom {} {$self zoom "in"}
  def* Canvas decr_zoom {} {$self zoom "out"}
***************
*** 2755,2762 ****
  	Return {
  	  if {[llength $@selection] == 1} {
! 	    if {$_($@selection:_class) == "ObjectBox"} {$@selection edit}
  	  }
  	}
! 	Escape {if {[llength $@selection] > 0} {$self deselect_all}}
  	default {}
      }
--- 2822,2846 ----
  	Return {
  	  if {[llength $@selection] == 1} {
! 	    if {[llength $@keynav_iosel] < 2} {
! 	    	if {$_($@selection:_class) == "ObjectBox"} {$@selection edit; $self dehilite_io}
! 	    } else {
! 	    	puts "connect this :::: $@keynav_iosel"
! 		set from_obj [lindex $@keynav_iosel 0]
! 		set to_obj [lindex $@keynav_iosel 1]
! 		set from [lsearch $@children [lindex $@keynav_iosel 0]]
! 		set to [lsearch $@children [lindex $@keynav_iosel 1]]
! 		puts "from::: $from to:::$to"
! 		pd .$self connect [list $from [lindex $_($from_obj:ioselect) 0] $to [lindex $_($to_obj:ioselect) 0]]
! 		$self dehilite_io
! 		
! 	    }
  	  }
  	}
! 	Escape {if {[llength $@selection] > 0} {
! 		$self deselect_all
! 		$self dehilite_io
! 	}
! 	
! 	}
  	default {}
      }
***************
*** 4383,4387 ****
  def Listener up   {} {if {$@histi>0} {set @histi [expr $@histi-1]; $self replace}}
  def Listener down {} {if {$@histi<[llength $@hist]}  {incr @histi; $self replace}}
! def Listener append {v} {lappend @hist $v; set @histi [llength $@hist]}
  
  def Listener eval {} {
--- 4467,4471 ----
  def Listener up   {} {if {$@histi>0} {set @histi [expr $@histi-1]; $self replace}}
  def Listener down {} {if {$@histi<[llength $@hist]}  {incr @histi; $self replace}}
! def Listener append {v} {set @hist $v; set @histi [llength $@hist]}
  
  def Listener eval {} {





More information about the Pd-cvs mailing list