[PD-cvs] pd/src desire.tk,1.1.2.600.2.133,1.1.2.600.2.134

chunlee chunlee at users.sourceforge.net
Fri Dec 22 17:57:49 CET 2006


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

Modified Files:
      Tag: desiredata
	desire.tk 
Log Message:
some gop fixes


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.133
retrieving revision 1.1.2.600.2.134
diff -C2 -d -r1.1.2.600.2.133 -r1.1.2.600.2.134
*** desire.tk	21 Dec 2006 20:47:50 -0000	1.1.2.600.2.133
--- desire.tk	22 Dec 2006 16:57:45 -0000	1.1.2.600.2.134
***************
*** 1182,1192 ****
  def View xy {} {
  	if {$@canvas == ""} {return [list $@x1 $@y1]}
! 	if {[$@canvas gop]} {
! 		if {[focus] != ".$@canvas.c"} {
! 			mset {xmargin ymargin} [$@canvas margin]
! 			mset {x y} [$@canvas xy]
! 			list [expr {($@x1-$xmargin)+$x}] [expr {($@y1-$ymargin)+$y}]
! 		} else {list $@x1 $@y1}
! 	} else {list $@x1 $@y1}
  }
  
--- 1182,1199 ----
  def View xy {} {
  	if {$@canvas == ""} {return [list $@x1 $@y1]}
! 	set type [$@canvas type]
! 	if {$type == "gopabs" || $type == "gopsub"} {
! 		mset {xmargin ymargin} [$@canvas margin]
! 		mset {x y} [$@canvas xy]
! 		set x1 [expr {($@x1-$xmargin)+$x}]
! 		set y1 [expr {($@y1-$ymargin)+$y}]
! 		#if $self's gop is opened
! 		if {[regexp {^.x[0-9a-f]{6,8}.c} [focus] f]} {
! 			if {$f == ".$@canvas.c"} {set x1 $@x1; set y1 $@y1}
! 		}
! 		#if {[focus] != "." && [focus] == ".$@canvas.c"} {set x1 $@x1; set y1 $@y1}
! 		return [list $x1 $y1]
! 	}
! 	return [list $@x1 $@y1]
  }
  
***************
*** 1261,1265 ****
  	if {[$self class] == "Canvas" && $@canvas == ""} {return}
  	if {$@inside_box} {
! 		if {[$@canvas mapped] && ![$@canvas abs] && [$self gop_check]} {$self draw}
  	} else {
  		# for drawing opened gop
--- 1268,1273 ----
  	if {[$self class] == "Canvas" && $@canvas == ""} {return}
  	if {$@inside_box} {
! 		#if {[$@canvas mapped] && ![$@canvas abs] && [$self gop_check]} {$self draw}
! 		if {[$@canvas mapped] && [$self gop_check]} {$self draw}
  	} else {
  		# for drawing opened gop
***************
*** 1444,1448 ****
  def Canvas editmodeswitch {args} {$self editmode= [expr !$@editmode]}
  def Canvas window {} {
! 	if {$@gop} {return [$@canvas window]}
  	return .$self
  }
--- 1452,1456 ----
  def Canvas editmodeswitch {args} {$self editmode= [expr !$@editmode]}
  def Canvas window {} {
! 	if {$@gop && $@canvas != ""} {return [$@canvas window]}
  	return .$self
  }
***************
*** 1534,1543 ****
  	  set @x1 [lindex $mess 2]
  	  set @y1 [lindex $mess 3]
  	  $self text= [lrange $mess 4 end]
  		if {$@mapped && !$@gop} {
! 			if {!$@subpatch && !$@gop && $@text != ""} {
! 				set @abs 1
! 				return
! 			}
  			if {![winfo exists .$self.c]} {$self init_window}
  		}
--- 1542,1550 ----
  	  set @x1 [lindex $mess 2]
  	  set @y1 [lindex $mess 3]
+ 	  set args [lrange $mess 4 end]
  	  $self text= [lrange $mess 4 end]
+ 		if {!$@subpatch && [llength $args] != 0} {set @abs 1}
  		if {$@mapped && !$@gop} {
! 			#if {!$@subpatch && $@text != ""} {set @abs 1; return}
  			if {![winfo exists .$self.c]} {$self init_window}
  		}
***************
*** 1589,1592 ****
--- 1596,1600 ----
  def Canvas hidtext {} {return $@hidetext}
  def Canvas abs {} {return $@abs}
+ #def Canvas abs {} {if {!$@subpatch} {return 1} else {return 0}}
  def Canvas subpatch {} {return $@subpatch}
  def Canvas get_dimen {} {
***************
*** 2061,2073 ****
  }
  
  def Canvas draw {} {
- 	if {$@subpatch && $@canvas != "" && !$@gop} {super} ;# is for the [pd] box if applicable
  	if {$@gop} {
  		if {[$self gop_check]} {$self all_changed}
  		#if the focus is not in the opened gop
! 		if {[focus] != [$self widget]} {super;return}
! 	}
! 	if {$@abs} {super; return}
! 	if {!$@mapped} {return}
  	if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]}
  	[$self widget] configure -background $bg
--- 2069,2090 ----
  }
  
+ def Canvas type {} {
+ 	if {$@subpatch && !$@gop} {return "sub"}
+ 	if {$@subpatch && $@gop} {return "gopsub"}
+ 	if {$@abs && !$@gop} {return "abs"}
+ 	if {$@abs && $@gop} {return "gopabs"}
+ 	if {!$@subpatch && !$@abs && $@gop} {return "gop"}
+ 	if {!$@subpatch && !$@abs && !$@gop} {return "toplevel"}
+ }
+ 
  def Canvas draw {} {
  	if {$@gop} {
  		if {[$self gop_check]} {$self all_changed}
  		#if the focus is not in the opened gop
! 		if {[regexp {^.x[0-9a-f]{6,8}.c} [focus] f]} {
! 			if {$@canvas != ""&& $f != [$self widget]} {super;return}
! 		} elseif {$@canvas != "" && [focus] != [$self widget]} {super;return}
! 	} elseif {$@subpatch || $@abs} {super}
! 	if {!$@mapped} {return} else {if {![winfo exists [$self widget]]} {return}}
  	if {$@editmode} {set bg [$self look bgedit]} else {set bg [$self look bgrun]}
  	[$self widget] configure -background $bg
***************
*** 2078,2097 ****
  	}
  }
- 
- def Canvas restack {} {
- 	set c [$self get_canvas]
- 	set stack {}
- 	#[$c widget] lower $self [lindex [$self visible_children] 0]
- 	foreach child [$self visible_children] {
- 		foreach i [[$c widget] find withtag $child] {
- 			if {$i != ""} {lappend stack $i}
- 		}
- 	}
- 	set stack [lsort $stack]
- 	set lowest [[$c widget] gettags [lindex $stack 0]]
- 	if {[regexp {^[xo][0-9a-f]{6,8}} $lowest id]} {set lowest $id}
- 	[$c widget] lower $self $lowest
- }
- 
  def Canvas popup_properties {} {CanvasPropertiesDialog new $self}
  
--- 2095,2098 ----
***************
*** 3320,3324 ****
  	switch $type {
  		outlet {
! 			if {$@action == "none"} {
  				set @action [FutureWire new $self $x $y $f $target]
  			}
--- 3321,3325 ----
  	switch $type {
  		outlet {
! 			if {$@action == "none" && [$id canvas] == $self} {
  				set @action [FutureWire new $self $x $y $f $target]
  			}





More information about the Pd-cvs mailing list