[PD-cvs] pd/src desire.tk,1.1.2.489,1.1.2.490

chunlee chunlee at users.sourceforge.net
Mon Oct 2 17:31:08 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
hooked up array with canvaspropertiesdialog


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.489
retrieving revision 1.1.2.490
diff -C2 -d -r1.1.2.489 -r1.1.2.490
*** desire.tk	29 Sep 2006 15:24:35 -0000	1.1.2.489
--- desire.tk	2 Oct 2006 15:31:05 -0000	1.1.2.490
***************
*** 1331,1336 ****
  	  puts "  pixwidth:: $@pixwidth <------------"
  	  switch [llength $mess] {
! 	    8  {set @gop 0; set @goprect 0}
! 	    9  {set @gop [lindex $mess 8]; set @goprect 0}
  	    11 {
  		set @gop [lindex $mess 8]
--- 1331,1336 ----
  	  puts "  pixwidth:: $@pixwidth <------------"
  	  switch [llength $mess] {
! 	    8  {set @gop 0; set @goprect 0; set @mess_len 8}
! 	    9  {set @gop [lindex $mess 8]; set @goprect 0; set @mess_len 9}
  	    11 {
  		set @gop [lindex $mess 8]
***************
*** 1338,1341 ****
--- 1338,1342 ----
  		set @xmargin [lindex $mess 9]
  		set @ymargin [lindex $mess 10]
+ 		set @mess_len 11
  	    }
  	    default {error "what???"}
***************
*** 1355,1359 ****
  
  def Canvas get_mess {} {
! 	return [list $@coordsx1 $@coordsy1 $@coordsx2 $@coordsy2 $@pixwidth $@pixheight]
  }
  
--- 1356,1365 ----
  
  def Canvas get_mess {} {
! 	if {$@mess_len != 11} {
! 		return [list $@coordsx1 $@coordsy1 $@coordsx2 $@coordsy2 $@pixwidth $@pixheight]
! 	} else {
! 		return [list $@coordsx1 $@coordsy1 $@coordsx2 $@coordsy2 $@pixwidth $@pixheight\
! 			   $@xmargin $@ymargin]
! 	}
  }
  
***************
*** 2631,2634 ****
--- 2637,2641 ----
  		1 {$self selection_wire+= $id}
  		2 {# ctrl-click on wire?
+ 			set c [$self widgety]
  			set wire [lindex $@wires_pair [expr [lsearch $@wires_pair $id]-1]]
  			$self disconnect $wire
***************
*** 3672,3712 ****
  def CanvasPropertiesDialog init {of} {
  	global fields classinfo
- 	#set class [$of class]
  	super $of
- 	#X coords 0 0 1 1 100 100 1 100 200;
- 	#foreach var {xscale yscale graphme} {set @$var $_($of:$var)}
  	wm title .$self "[say canvas] [say popup_properties]"
! 	#set props {
! 	#	xscale "" entry {-width 10}
! 	#	yscale "" entry {-width 10}
! 	#}
! 	#"pdtk_canvas_dialog %%s %g %g %d %g %g %g %g %d %d %d %d\n",
! 	#glist_dpixtodx(x, 1), -glist_dpixtody(x, 1), 1,
! 	#x->gl_x1, x->gl_y1, x->gl_x2, x->gl_y2, 
! 	#(int)x->gl_pixwidth, (int)x->gl_pixheight,
! 	#(int)x->gl_xmargin, (int)x->gl_ymargin);
! 
! 	#puts "[lrange $fields($class) 0 end]"
! 	#$self add .$self $props
! 	set @gop 0; #dummy
! 	set @properties [list "gop" "width" "height" "xmargin" "ymargin"]
  	foreach prop $@properties {
  		set label [say $prop]
  		if {[string length $label] > $@max_label} {set @max_label [string length $label]}
  	}
- 
  	$self add .$self [list gop toggle -command "$self gop_setting"]
! 	$self add .$self [list width integer -width 7]
! 	$self add .$self [list height integer -width 7]
! 	$self add .$self [list xmargin integer -width 7]
! 	$self add .$self [list ymargin integer -width 7]
  	$self gop_setting
- 	#pack [checkbutton .$self.graphme -text "graph on parent" \
- 	#	  -variable @graphme -anchor w] -side top
- 	#set e .$self.xscale.entry
- 	#bind $e <KeyPress-Return> "canvas_ok $id"
- 	#$e select from 0
- 	#$e select adjust end
- 	#focus $e
  }
  
--- 3679,3707 ----
  def CanvasPropertiesDialog init {of} {
  	global fields classinfo
  	super $of
  	wm title .$self "[say canvas] [say popup_properties]"
! 	set @gop [$of gop]
! 	set @properties [list "gop" "xfrom" "xto" "yfrom" "yto" "width" "height" "xmargin" "ymargin"]
! 	set mess [$of get_mess]
! 	set @xfrom [lindex $mess 0]
! 	set @xto [lindex $mess 2]
! 	set @yfrom [lindex $mess 1]
! 	set @yto [lindex $mess 3]
! 	set @width [lindex $mess 4]
! 	set @height [lindex $mess 5]
! 	if {[llength $mess] == 8} {
! 		set @xmargin [lindex $mess 6]; set @ymargin [lindex $mess 7]
! 	} else {
! 		set @xmargin 0; set @ymargin 0
! 	}
  	foreach prop $@properties {
  		set label [say $prop]
  		if {[string length $label] > $@max_label} {set @max_label [string length $label]}
  	}
  	$self add .$self [list gop toggle -command "$self gop_setting"]
! 	for {set i 1} {$i<[llength $@properties]} {incr i} {
! 		$self add .$self [list [lindex $@properties $i] integer -width 7]
! 	}
  	$self gop_setting
  }
  
***************
*** 3723,3727 ****
  
  def CanvasPropertiesDialog apply {} {
! 	pd .$@of donecanvasdialog $@xscale $@yscale $@graphme
  }
  
--- 3718,3724 ----
  
  def CanvasPropertiesDialog apply {} {
! 	#pd .$@of donecanvasdialog $@xscale $@yscale $@graphme
! 	pd .$@of coords $@xfrom $@yfrom $@xto $@yto $@width $@height $@gop
! 	#donecanvasdialogy sends back weird scientific notation values....
  }
  
***************
*** 5439,5443 ****
  			default {
  				frame $f
- 				
  				pack [label $f.label -text $label] -side left
  				balloon $f.label $name
--- 5436,5439 ----





More information about the Pd-cvs mailing list