[PD-cvs] pd/src desire.tk,1.1.2.92,1.1.2.93

chunlee chunlee at users.sourceforge.net
Tue Nov 1 17:51:04 CET 2005


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
ctrl+e and object creation worx


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.92
retrieving revision 1.1.2.93
diff -C2 -d -r1.1.2.92 -r1.1.2.93
*** desire.tk	1 Nov 2005 14:24:16 -0000	1.1.2.92
--- desire.tk	1 Nov 2005 16:51:02 -0000	1.1.2.93
***************
*** 849,853 ****
  }
  
! proc menu_editmode {name} {pd "$name editmode 0 ;"}
  
  # correct edit menu, enabling or disabling undo/redo
--- 849,871 ----
  }
  
! proc menu_editmode {name} {
!     global _
!     puts "name: $name"
!     pd "$name editmode 0 ;"
! 
! }
! 
! def canvas editmodeswitch {args} {
!     global _
!     set name .x$self
!     if {$@editmode} {
!     set @editmode 0;
!     } else {
!     set @editmode 1; 
!     }
!     
!     pd "$name editmode $@editmode ;"
! 
! }
  
  # correct edit menu, enabling or disabling undo/redo
***************
*** 888,891 ****
--- 906,910 ----
      set key [string tolower $key]
      # for quit/save/undo
+     puts "key: $key ; shift $shift"
      switch -- $key {
        q {if {$shift} {menu_really_quit} {menu_quit};      return}
***************
*** 905,909 ****
        slash  {menu_audio 1}
        period {menu_audio 0}
!       e      {menu_editmode $name}
      }
  }
--- 924,928 ----
        slash  {menu_audio 1}
        period {menu_audio 0}
!       e      {$self editmodeswitch}
      }
  }
***************
*** 992,1000 ****
  	$c itemconfigure ${self}BASE -outline $frcol -dash \
  		[if {$@valid} {list 8 8 8 8} {list}]
! 	super $canvas
! 	textbox_edit $self $canvas
  	catch {$c raise ${self}TEXT $self}
  }
  
  #this just tells whether an object is part of the selection, that is, what usually 
  #make objects turn blue.
--- 1011,1025 ----
  	$c itemconfigure ${self}BASE -outline $frcol -dash \
  		[if {$@valid} {list 8 8 8 8} {list}]
! 	#super $canvas
! 	textbox_draw $self $canvas
! 	#textbox_edit won't do anything if @edit = 1
! 	#textbox_edit $self $canvas
! 	if {$@isnew} {textbox_edit $self $canvas}
  	catch {$c raise ${self}TEXT $self}
  }
  
+ #def* objectbox erase {canvas} {}
+ 
+ 
  #this just tells whether an object is part of the selection, that is, what usually 
  #make objects turn blue.
***************
*** 1044,1051 ****
--- 1069,1081 ----
  
  def textbox draw {canvas} {
+     # TEXT = the text label
+     # text = the input text field
+     # confusing?;)
      global font look
      mset {x1 y1} [$self xy $canvas]
      puts "x1=$x1 y1=$y1"
+     puts "!!!!edit = $@edit!!!!"
      if {$@edit} {
+    
  	set t .x$canvas.c.${self}text
  	$t configure -width [expr [string length $@text]]
***************
*** 1054,1057 ****
--- 1084,1088 ----
  		-font [format -*-courier-medium--normal--%d-* $font(size)] \
  		-text $@text -fill $look(objectfg) -anchor nw
+ 	puts "text = $@text"
      }
  }
***************
*** 1099,1103 ****
  
  class_new objectbox {textbox}
! def objectbox init {args} {
  	super
  	global font look
--- 1130,1134 ----
  
  class_new objectbox {textbox}
! def* objectbox init {args} {
  	super
  	global font look
***************
*** 1107,1112 ****
  	#set @canvas "deadbeef"
  	set @class ""
! 	set @text $args
! 	# to signal if an object is currently in edit
  	set @edit 0
  	#if {[info exists _($canvas:selection)]} {
--- 1138,1142 ----
  	#set @canvas "deadbeef"
  	set @class ""
! 	#set @text $args
  	set @edit 0
  	#if {[info exists _($canvas:selection)]} {
***************
*** 1142,1146 ****
  	set t $c.${self}text
  	set @text [$t get 1.0 1.end]
!         $c delete ${self}text
  	after 1 "destroy $t"
  	set l {}
--- 1172,1176 ----
  	set t $c.${self}text
  	set @text [$t get 1.0 1.end]
!         $c delete ${self}text ${self}BASE ${self}BASE2 ${self}BASE3
  	after 1 "destroy $t"
  	set l {}
***************
*** 1151,1155 ****
  
  def objectbox complete2 {canvas} {
! 	global font
  	set @selected? 0
  	$self erase $canvas 
--- 1181,1185 ----
  
  def objectbox complete2 {canvas} {
! 	global fonttext_setto
  	set @selected? 0
  	$self erase $canvas 
***************
*** 1510,1519 ****
        default {
  	if {$@editmode} {
! 	puts "clicked on blank space and in edit mode"
  	# my object edit mode code begins --chun
! 	#	if {[llength $@obj_in_edit]} {
! 	#		[lindex $@selection 0] unedit $self
! 	#		set @obj_in_edit {}
! 	#	}
  	#	if {[llength $@selection] > 0} {
  	#		foreach obj $@selection {
--- 1540,1551 ----
        default {
  	if {$@editmode} {
! 	#puts "clicked on blank space and in edit mode"
  	# my object edit mode code begins --chun
! 		if {[llength $@obj_in_edit]} {
! 			#puts "and some object is in edit -> $@obj_in_edit in $self"
! 			#[lindex $@selection 0] unedit $self
! 			$@obj_in_edit unedit $self
! 			set @obj_in_edit {}
! 		}
  	#	if {[llength $@selection] > 0} {
  	#		foreach obj $@selection {
***************
*** 1910,1913 ****
--- 1942,1947 ----
  		obj {set i 4; set class [lindex $d 4]}
  	}
+ 	
+ 	
  	if {![info exists _($x:_class)]} {
  		# new object
***************
*** 1915,1921 ****
  			set _($x:_class) [lindex $classinfo($class) 0]
  		} {
  			set _($x:_class) objectbox
  		}
! 		$x init 
  	}
  	#if {![info exists _($x:cx)]} {
--- 1949,1989 ----
  			set _($x:_class) [lindex $classinfo($class) 0]
  		} {
+ 			post BLEH
+ 			set dlength [llength $d]
+ 			if {$dlength == 4} {
+ 			set _($x:isnew) 1
+ 			set _($x:text) {}
+ 			} else {
+ 			set _($x:isnew) 0
+ 			set _($x:text) [lrange $d 4 end]
+ 			puts "_($x:text) : $_($x:text)"
+ 			}
  			set _($x:_class) objectbox
  		}
! 
! 		$x init
! 		#puts "_($x:_class)=$_($x:_class)"
! 		#if {[info exists _($x:canvas)]} {
! 			# hack
! 		#	set canvas $_($x:canvas)
! 		#	if {![info exists _($canvas:action)]} {
! 			#puts "!!!!!! $canvas not initd !!!!!"
! 		#	$canvas init
! 		#	}
! 		#	if {![info exists _($x:cx)]} {
! 		#		set _($x:cx) [lindex $d 2]
! 		#		set _($x:cy) [lindex $d 3]
! 		#	}
! 		#	$x init
! 		#	set _($x:text) [lrange $d $i end]
! 		#	set _($x:valid) 0
! 		#	$x update_size
! 		#	$x draw $canvas
! 		#	if {[string length $_($x:text)]==0} {$x edit $canvas}
! 		#	set _($_($x:canvas):selection) $x
! 		#}
! 
! 		#$x init 
! 
  	}
  	#if {![info exists _($x:cx)]} {





More information about the Pd-cvs mailing list