[PD-cvs] pd/src desire.tk,1.1.2.345,1.1.2.346

Mathieu Bouchard matju at users.sourceforge.net
Tue Aug 15 23:07:52 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
stuff


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.345
retrieving revision 1.1.2.346
diff -C2 -d -r1.1.2.345 -r1.1.2.346
*** desire.tk	15 Aug 2006 19:47:31 -0000	1.1.2.345
--- desire.tk	15 Aug 2006 21:07:50 -0000	1.1.2.346
***************
*** 996,1005 ****
  def View noutlets= {v}    {set @noutlets $v}
  def View noutlets  {} {return $@noutlets}
! def* View   click     {x y f} {} ;# being   clicked in run  mode
! def* View   clickedit {x y f} {} ;# being   clicked in edit mode
! def* View unclick     {x y f} {} ;# being unclicked in run  mode
! def* View unclickedit {x y f} {} ;# being unclicked in edit mode
! def  View  motionedit {x y f} {} ;# mouse motion in edit mode
! def  View  motion     {x y f} {} ;# mouse motion in run  mode
  
  def View init {} {
--- 996,1005 ----
  def View noutlets= {v}    {set @noutlets $v}
  def View noutlets  {} {return $@noutlets}
! def* View   click     {x y f target} {} ;# being   clicked in run  mode
! def* View   clickedit {x y f target} {} ;# being   clicked in edit mode
! def* View unclick     {x y f target} {} ;# being unclicked in run  mode
! def* View unclickedit {x y f target} {} ;# being unclicked in edit mode
! def  View  motionedit {x y f target} {} ;# mouse motion in edit mode
! def  View  motion     {x y f target} {} ;# mouse motion in run  mode
  
  def View init {} {
***************
*** 1732,1735 ****
--- 1732,1738 ----
  	pd .$@canvas text_setto !$self $l
  	focus $c
+ }
+ 
+ def ObjectBox unedit {} {
          $self erase ;# (why?)
  }
***************
*** 1866,1878 ****
  	#if {$@crosshair} {$self show_crosshair [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale]}
  	#if {$@crosshair} {$self show_crosshair $x $y}
! 	$self motion [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] $f	
  }
  def Canvas click_wrap {x y b f} {
  	set c .$self.c
! 	$self click [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] [expr $b*256+$f]
  }
  def Canvas unclick_wrap {x y b f} {
  	set c .$self.c
! 	$self unclick [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale] [expr $b*256+$f]
  }
  def Canvas key_wrap {x y key iso shift} {
--- 1869,1892 ----
  	#if {$@crosshair} {$self show_crosshair [expr [$c canvasx $x]/$@scale] [expr [$c canvasy $y]/$@scale]}
  	#if {$@crosshair} {$self show_crosshair $x $y}
! 	set x [expr [$c canvasx $x]/$@scale]
! 	set y [expr [$c canvasy $y]/$@scale]
! 	set target [$self identify_target $x $y $f "motion"]
! 	$self motion $x $y $f $target
  }
  def Canvas click_wrap {x y b f} {
  	set c .$self.c
! 	set x [expr [$c canvasx $x]/$@scale]
! 	set y [expr [$c canvasy $y]/$@scale]
! 	set f [expr 1<<($b+7)|$f]
! 	set target [$self identify_target $x $y $f "click"]
! 	$self click $x $y $f $target
  }
  def Canvas unclick_wrap {x y b f} {
  	set c .$self.c
! 	set x [expr [$c canvasx $x]/$@scale]
! 	set y [expr [$c canvasy $y]/$@scale]
! 	set f [expr 1<<($b+7)|$f]
! 	set target [$self identify_target $x $y $f "unclick"]
! 	$self unclick $x $y $f $target
  }
  def Canvas key_wrap {x y key iso shift} {
***************
*** 1924,1928 ****
  
  #!@#$ this method is too long
! def* Canvas motion {x y f} {
      global font canvas tooltip
      set canvas(current) $self
--- 1938,1942 ----
  
  #!@#$ this method is too long
! def* Canvas motion {x y f target} {
      global font canvas tooltip
      set canvas(current) $self
***************
*** 1939,1944 ****
      set @curpos [list $x $y]
      # detects if the focus is not on the canvas itself in run mode, ie. numbox 
!     if {!$@editmode & [$self focus] != $self & [$self focus] != ""} {[$self focus] motion $x $y $f}
!     set target [$self identify_target $x $y $f "motion"]
      mset {type id detail} $target
      switch $@action {
--- 1953,1957 ----
      set @curpos [list $x $y]
      # detects if the focus is not on the canvas itself in run mode, ie. numbox 
!     if {!$@editmode & [$self focus] != $self & [$self focus] != ""} {[$self focus] motion $x $y $f $target}
      mset {type id detail} $target
      switch $@action {
***************
*** 1966,1970 ****
        object {
  	if {$@editmode} {set event motionedit} {set event motion}
! 	$id $event $x $y $f
        }
        wire {}
--- 1979,1983 ----
        object {
  	if {$@editmode} {set event motionedit} {set event motion}
! 	$id $event $x $y $f $target
        }
        wire {}
***************
*** 1979,1983 ****
  #     wire $id         : a wire
  #  nothing             : nothing
! def Canvas identify_target2 {x y f label} {
      set c .$self.c
      set cx [expr $x*$@scale]
--- 1992,1996 ----
  #     wire $id         : a wire
  #  nothing             : nothing
! def Canvas identify_target {x y f label} {
      set c .$self.c
      set cx [expr $x*$@scale]
***************
*** 1999,2003 ****
  	      return [list "object" $id]
  	    }
! 	    puts "skipped a $class"
          }
      }
--- 2012,2016 ----
  	      return [list "object" $id]
  	    }
! 	    #puts "skipped a $class"
          }
      }
***************
*** 2008,2017 ****
  }
  
- def Canvas identify_target {x y f label} {
-     set r [$self identify_target2 $x $y $f $label]
-     puts "\[identify_target $x $y $f $label\] returns: $r"
-     return $r
- }
- 
  #-----------------------------------------------------------------------------------#
  class_new StatusBar {View} ;# no, using View is wrong here. View is for tk canvas item collections.
--- 2021,2024 ----
***************
*** 2056,2060 ****
  	[expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]] end]]
      foreach {type id} [$@canvas identify_target $x $y -1 "status"] {}
!     switch $type {
        object {
  	if {[info exists _($id:pdclass)]} {set class $_($id:pdclass)} {set class unknown}
--- 2063,2067 ----
  	[expr $x-2] [expr $y-2] [expr $x+2] [expr $y+2]] end]]
      foreach {type id} [$@canvas identify_target $x $y -1 "status"] {}
!     switch -- $type {
        object {
  	if {[info exists _($id:pdclass)]} {set class $_($id:pdclass)} {set class unknown}
***************
*** 2062,2066 ****
        }
        wire    {set t "$id wire"}
!       default {set t "... $tags"}
      }
      if {[string length [$@canvas focus]]} {set t "focus: [$@canvas focus]"}
--- 2069,2073 ----
        }
        wire    {set t "$id wire"}
!       default {set t "type=$type ... $tags"}
      }
      if {[string length [$@canvas focus]]} {set t "focus: [$@canvas focus]"}
***************
*** 2250,2254 ****
  	$self draw
  }
! def SelRect unclick {x y bf target} {
  	$self motion $x $y 0 $target
  	set sel {}
--- 2257,2261 ----
  	$self draw
  }
! def SelRect unclick {x y f target} {
  	$self motion $x $y 0 $target
  	set sel {}
***************
*** 2286,2292 ****
  #!@#$ this method is too long
  # this method receives (x,y) in descaled coords
! def* Canvas clickedit {x y f} {
  	set c .[$self canvas].c
- 	set target [$self identify_target $x $y $f "click"]
  	mset {type id detail} $target
  	if {$f&8} {$self popup $id [winfo pointerx $c] [winfo pointery $c]; return}
--- 2293,2298 ----
  #!@#$ this method is too long
  # this method receives (x,y) in descaled coords
! def* Canvas clickedit {x y f target} {
  	set c .[$self canvas].c
  	mset {type id detail} $target
  	if {$f&8} {$self popup $id [winfo pointerx $c] [winfo pointery $c]; return}
***************
*** 2348,2352 ****
  
  # should be renamed to "click" when the other "click" becomes unneeded.
! def* Canvas click {x y f} {
      if {[winfo exists .completion]} {
        raise .completion
--- 2354,2358 ----
  
  # should be renamed to "click" when the other "click" becomes unneeded.
! def* Canvas click {x y f target} {
      if {[winfo exists .completion]} {
        raise .completion
***************
*** 2357,2379 ****
      focus $c
      set @click_at [list $x $y]
!     #if {$@editmode && !($f&2)} {$self clickedit $x $y $f; return}
!     if {$@editmode} {$self clickedit $x $y $f; return}
!     mset {type id} [$self identify_target $x $y $f "click"]
      if {![llength $id]} {return}
      switch $type {
!       object {$id click $x $y $f}
!       wire   {$id click $x $y $f}
        default {error BORK}
      }
  }
  
! def* Canvas unclickedit {x y f} {
      set c .$self.c
!     mset {type id detail} [$self identify_target $x $y $f "unclick"]
      switch $@action {
!       edit {
!         set @obj_in_edit $id
!         $id edit
!       }
        move {
  	foreach obj $@selection {pd .$self object_moveto !$obj [$obj xy]}
--- 2363,2382 ----
      focus $c
      set @click_at [list $x $y]
!     #if {$@editmode && !($f&2)} {$self clickedit $x $y $f $target; return}
!     if {$@editmode} {$self clickedit $x $y $f $target; return}
!     mset {type id} $target
      if {![llength $id]} {return}
      switch $type {
!       object {$id click $x $y $f $target}
!       wire   {$id click $x $y $f $target}
        default {error BORK}
      }
  }
  
! def* Canvas unclickedit {x y f target} {
      set c .$self.c
!     mset {type id detail} $target
      switch $@action {
!       edit {set @obj_in_edit $id; $id edit}
        move {
  	foreach obj $@selection {pd .$self object_moveto !$obj [$obj xy]}
***************
*** 2383,2398 ****
        }
        none {}
!       default {
! 	set target [$self identify_target $x $y $f "unclick"]
! 	$@action unclick $x $y $f $target
!       }
      }
  }
  
! def* Canvas unclick {x y f} {
      if {$@editmode} {
! 	$self unclickedit $x $y $f
      } else {
! 	if {[$self focus] != ""} {[$self focus] unclick $x $y $b}
      }
      $self adjust_scrollbars
--- 2386,2398 ----
        }
        none {}
!       default {$@action unclick $x $y $f $target}
      }
  }
  
! def* Canvas unclick {x y f target} {
      if {$@editmode} {
! 	$self unclickedit $x $y $f $target
      } else {
! 	if {[$self focus] != ""} {[$self focus] unclick $x $y $f $target}
      }
      $self adjust_scrollbars
***************
*** 3036,3050 ****
  	set unborn_child [lsearch $_($c:unborn) $self]
  	if {$unborn_child > -1} {
- 		puts "subscribing unborn child:: $self"
- 		$self subscribe $c
  		$self canvas= $c
! 		$self draw ;# this shouldn't be here!
  		if {$unborn_child == [expr [llength $_($c:unborn)] - 1]} {
  			# when it reachs the last unborn child, its time to draw the wires
  			# the end of duplication
! 			puts "### at $self, [llength $_($c:unborn)] unborn children: $_($c:unborn)"
  			set _($c:unborn) ""
  			if {[info exists _($c:unborn_wire)]} {
! 				puts "time to draw wires ----- $_($c:unborn_wire)"
  				$c wires= $_($c:unborn_wire)
  				#set _($c:unborn_wire) ""
--- 3036,3049 ----
  	set unborn_child [lsearch $_($c:unborn) $self]
  	if {$unborn_child > -1} {
  		$self canvas= $c
! 		$self subscribe $c
! 		$self changed
  		if {$unborn_child == [expr [llength $_($c:unborn)] - 1]} {
  			# when it reachs the last unborn child, its time to draw the wires
  			# the end of duplication
! 			#puts "### at $self, [llength $_($c:unborn)] unborn children: $_($c:unborn)"
  			set _($c:unborn) ""
  			if {[info exists _($c:unborn_wire)]} {
! 				#puts "time to draw wires ----- $_($c:unborn_wire)"
  				$c wires= $_($c:unborn_wire)
  				#set _($c:unborn_wire) ""
***************
*** 3098,3112 ****
  }
  
! def MessageBox click {x y b f} {
  	$self bang 1
- 	$@canvas focus= $self
  	pd .$self bang
  	after 150 $self bang 0
  }
  
- def MessageBox unclick {x y mod} {
- 	$@canvas focus= ""
- }
- 
  def MessageBox bang {flag} {
  	.$@canvas.c itemconfigure ${self}BASE -fill \
--- 3097,3106 ----
  }
  
! def MessageBox click {x y f target} {
  	$self bang 1
  	pd .$self bang
  	after 150 $self bang 0
  }
  
  def MessageBox bang {flag} {
  	.$@canvas.c itemconfigure ${self}BASE -fill \
***************
*** 3176,3180 ****
  }
  
! def BlueBox motionedit {args} {
  	#puts "motions in $self in edit mode"
  }
--- 3170,3174 ----
  }
  
! def BlueBox motionedit {x y f target} {
  	#puts "motions in $self in edit mode"
  }
***************
*** 3532,3536 ****
  }
  
! def AtomBox click {x y b f} {
  	set c .$@canvas.c
  	set @clickpos [list $x $y]
--- 3526,3530 ----
  }
  
! def AtomBox click {x y f target} {
  	set c .$@canvas.c
  	set @clickpos [list $x $y]
***************
*** 3543,3547 ****
  }
  
! def AtomBox unclick {x y b} {
  	set @clicking 0
  	if {[lindex $@clickpos 0] == $x && [lindex $@clickpos 1] == $y} {
--- 3537,3541 ----
  }
  
! def AtomBox unclick {x y f target} {
  	set @clicking 0
  	if {[lindex $@clickpos 0] == $x && [lindex $@clickpos 1] == $y} {
***************
*** 3557,3561 ****
  }
  
! def FloatAtom motion {x y mod} {
  	set focused [$self == [$@canvas focus]]
  	if {!$focused} {return}
--- 3551,3555 ----
  }
  
! def FloatAtom motion {x y f target} {
  	set focused [$self == [$@canvas focus]]
  	if {!$focused} {return}
***************
*** 3648,3652 ****
  }
  
! def NumBox click {x y b f} {
  	$@canvas focus= $self
  	.$@canvas.c itemconfigure ${self}BASE4 -fill #00ff00
--- 3642,3646 ----
  }
  
! def NumBox click {x y f target} {
  	$@canvas focus= $self
  	.$@canvas.c itemconfigure ${self}BASE4 -fill #00ff00
***************
*** 3658,3662 ****
  }
  
! def NumBox motion {x y mod} {
  	set focused [$self == [$@canvas focus]]
  	if {!$focused || !$@clicking} {return}
--- 3652,3656 ----
  }
  
! def NumBox motion {x y f target} {
  	set focused [$self == [$@canvas focus]]
  	if {!$focused || !$@clicking} {return}
***************
*** 3672,3676 ****
  def NumBox unfocus {} {set @buf ""; $self changed}
  
! def NumBox unclick {x y b} {
  	set @clicking 0
  	#if {$@oval!=$@val} {
--- 3666,3670 ----
  def NumBox unfocus {} {set @buf ""; $self changed}
  
! def NumBox unclick {x y f target} {
  	set @clicking 0
  	#if {$@oval!=$@val} {
***************
*** 3777,3781 ****
  }
  
! def Radio click {x y b f} {
  	$@canvas focus= $self
  	mset {x1 y1} [$self xy]
--- 3771,3775 ----
  }
  
! def Radio click {x y f target} {
  	$@canvas focus= $self
  	mset {x1 y1} [$self xy]
***************
*** 3787,3791 ****
  }
  
! def Radio unclick {x y mod} {$@canvas focus= ""}
  
  class_new Slider {BlueBox}
--- 3781,3785 ----
  }
  
! def Radio unclick {x y f target} {$@canvas focus= ""}
  
  class_new Slider {BlueBox}
***************
*** 3860,3864 ****
  }
  
! def Slider click {x y b f} {
  	$@canvas focus= $self
  	set @first [list $x $y]
--- 3854,3858 ----
  }
  
! def Slider click {x y f target} {
  	$@canvas focus= $self
  	set @first [list $x $y]
***************
*** 3868,3872 ****
  }
  
! def Slider unclick {x y mod} {
  	set @clicking 0
  	if {[lindex $@first 1] != $y} {
--- 3862,3866 ----
  }
  
! def Slider unclick {x y f target} {
  	set @clicking 0
  	if {[lindex $@first 1] != $y} {
***************
*** 3878,3882 ****
  }
  
! def Slider motion {x y f} {
  	set focused [$self == [$@canvas focus]]
  	if {!$focused} {return}
--- 3872,3876 ----
  }
  
! def Slider motion {x y f target} {
  	set focused [$self == [$@canvas focus]]
  	if {!$focused} {return}
***************
*** 3940,3946 ****
  
  
! def Bang unclick {x y b} {$@canvas focus= ""}
  
! def Bang click {x y b f} {
  	$@canvas focus= $self
  	pd .$self bang
--- 3934,3940 ----
  
  
! def Bang unclick {x y f target} {$@canvas focus= ""}
  
! def Bang click {x y f target} {
  	$@canvas focus= $self
  	pd .$self bang
***************
*** 3985,3989 ****
  }
  
! def Toggle click {x y b f} {
  	pd .$self bang
  	if {!$@on} {set @on 1} {set @on 0}
--- 3979,3983 ----
  }
  
! def Toggle click {x y f target} {
  	pd .$self bang
  	if {!$@on} {set @on 1} {set @on 0}
***************
*** 3993,3997 ****
  }
  
! def Toggle unclick {x y b} {
  	set @clicking 0
  	$@canvas focus= ""
--- 3987,3991 ----
  }
  
! def Toggle unclick {x y f target} {
  	set @clicking 0
  	$@canvas focus= ""





More information about the Pd-cvs mailing list