[PD-cvs] pd/src desire.tk,1.1.2.332,1.1.2.333

Mathieu Bouchard matju at users.sourceforge.net
Mon Aug 14 16:28:17 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
fixed inlet/outlet highlighting


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.332
retrieving revision 1.1.2.333
diff -C2 -d -r1.1.2.332 -r1.1.2.333
*** desire.tk	14 Aug 2006 14:04:56 -0000	1.1.2.332
--- desire.tk	14 Aug 2006 14:28:15 -0000	1.1.2.333
***************
*** 1883,1907 ****
        }
      }
!     mset {type id} [$self identify_target $x $y -1 -1 "move"]
      switch $type {
        object {
  	if {$@editmode} {set event motionedit} {set event motion}
  	$id $event $x $y $mods
- 	if {$@editmode && [llength [$id bbox]]} {
- 	  mset {x1 y1 x2 y2} [$id bbox]
- 	  if {$y<[expr $y1+2]} {
- 		set port [$id hilite_io i $x $y]
- 		if {$port==""} return
- 		set @dehighlight "$c delete ${id}i${port}b; set wire_to {}"
- 		set @wire_to [list $id $port]
- 		return
- 	  }
- 	  if {$y>=[expr $y2-2]} {
- 		set port [$id hilite_io o $x $y]
- 		if {$port==""} return
- 		set @dehighlight "$c delete ${id}o${port}b"
- 		return
- 	  }
- 	}
        }
        wire {}
--- 1883,1894 ----
        }
      }
!     set target [$self identify_target $x $y -1 -1 "move"]
!     mset {type id detail} $target
      switch $type {
+       inlet  {set port [$id hilite_io i $x $y]; set @dehighlight [list $c delete ${id}i${port}b]}
+       outlet {set port [$id hilite_io o $x $y]; set @dehighlight [list $c delete ${id}o${port}b]}
        object {
  	if {$@editmode} {set event motionedit} {set event motion}
  	$id $event $x $y $mods
        }
        wire {}
***************
*** 2189,2227 ****
  	switch $type {
  	  outlet {set @action [FutureWire new $self $x $y $bf $target]; return}
! 	  object {# handles the dash wire drawing
! 	    mset {x1 y1 x2 y2} [$id bbox]
! 	    set outs 0; set outs [$id noutlets]
! 	    set ins  0; set  ins [$id  ninlets]
! 	    if {$y>=$y2-6 && $outs} { # click on outlet
! 	    } else {
! 	      if {$y<$y1+2 && $ins} { # click on inlet
! 	     	if {$f} {#click on an inlet with shift
! 			mset {type id} [$@canvas identify_target $x $y [expr $x-1] [expr $y-1] "unclick"]
! 			if {$id != ""} {
!         		mset {x1 y1 x2 y2} [$id bbox]
!         		set ins 0; set ins [$id ninlets]
!         		if {$y<$y1+6 && $ins} {
! 			set in [expr int(($x-$x1)*$ins/($x2-$x1))]
! 			set @wire_to [list $id $in]
! 			mset {from outlet} $@shift_wires
! 			mset {to    inlet} $@wire_to
! 			$self connect [lsearch $@children $from] $outlet [lsearch $@children $to] $inlet
! 			}
! 			return
! 			}
! 		}
! 	     } else {
! 	     # clcik on object
! 	     # if no previous selection, edit the clicked object
! 	     if {![llength $@selection]} {
  	     	$id clickedit $x $y $b $f $in_selection $@selection
! 	     } else {
! 	     # otherwise do multiple object selection
  	     	if {[lsearch $@selection $id] < 0} {lappend @selection $id}
  	     	$id selected?= 1; set @action edit
  	     }
! 	     }
! 	     }
! 	     	 }
  	  wire   {
  	  	switch $f {
--- 2176,2187 ----
  	switch $type {
  	  outlet {set @action [FutureWire new $self $x $y $bf $target]; return}
! 	  object {
! 	     if {![llength $@selection]} {# if no previous selection, edit the clicked object
  	     	$id clickedit $x $y $b $f $in_selection $@selection
! 	     } else {# otherwise do multiple object selection
  	     	if {[lsearch $@selection $id] < 0} {lappend @selection $id}
  	     	$id selected?= 1; set @action edit
  	     }
! 	  }
  	  wire   {
  	  	switch $f {





More information about the Pd-cvs mailing list