[PD-cvs] pd/src u_main.tk,1.1.1.4.2.7.4.23,1.1.1.4.2.7.4.24

Mathieu Bouchard matju at users.sourceforge.net
Sun Mar 28 04:30:44 CEST 2004


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

Modified Files:
      Tag: impd_0_37
	u_main.tk 
Log Message:
 .pdrc editor : first spike


Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.7.4.23
retrieving revision 1.1.1.4.2.7.4.24
diff -C2 -d -r1.1.1.4.2.7.4.23 -r1.1.1.4.2.7.4.24
*** u_main.tk	26 Mar 2004 07:12:12 -0000	1.1.1.4.2.7.4.23
--- u_main.tk	28 Mar 2004 02:30:42 -0000	1.1.1.4.2.7.4.24
***************
*** 109,114 ****
  	set f .controls.$z
  	frame $f
! 	frame $f.1 -borderwidth 2 -relief ridge
! 	frame $f.1.pad -height 5
  	entry $f.1.level -textvariable ctrls_${z}level -width 3
  	button $f.1.clip -text "Clip" -state disabled
--- 109,114 ----
  	set f .controls.$z
  	frame $f
! 	frame $f.1 -borderwidth 2 -relief groove
! 	frame $f.1.pad -height 1
  	entry $f.1.level -textvariable ctrls_${z}level -width 3
  	button $f.1.clip -text "Clip" -state disabled
***************
*** 393,396 ****
--- 393,397 ----
  	{}
  	{"Class List" {show_class_list} ""}
+ 	{".pdrc Editor" {pdrc_editor_new} ""}
  	{"Message"    {menu_send} "Ctrl+m"}
  	{"Path..."    {pd "pd start-path-dialog ;"} ""}
***************
*** 725,730 ****
      	bind $name.c <Button-5> "$name.c yview scroll +1 units"
      }}
!     #image create photo lena -file "/home/matju/lena.ppm"
!     #$name.c create image 0 0 -image lena -anchor nw
  }
  
--- 726,731 ----
      	bind $name.c <Button-5> "$name.c yview scroll +1 units"
      }}
!     #image create photo mybackground -file "/home/matju/lena.ppm"
!     #$name.c create image 0 0  -anchor nw -image mybackground
  }
  
***************
*** 754,766 ****
  
  proc pdtk_canvas_click {name x y b f} {
!     pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b $f \;}
! proc pdtk_canvas_shiftclick {name x y b} {
!     pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b 1 \;}
! proc pdtk_canvas_ctrlclick {name x y b} {
!     pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b 2 \;}
! proc pdtk_canvas_altclick {name x y b} {
!     pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b 3 \;}
! proc pdtk_canvas_dblclick {name x y b} {
!     pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b 4 \;}
  
  set pdtk_canvas_mouseup(name) 0
--- 755,766 ----
  
  proc pdtk_canvas_click {name x y b f} {
!     pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b $f \;
!     set tags [$name gettags [lindex [$name find overlapping $x $y $x $y] end]]
!     puts stderr "click $name $x $y $b $f : $tags "
!     if {![regexp {^([a-f0-9]{7})} $tags tag]} {return}
!     global _
!     if {[info exists _($tag:class)]} {set class $_($tag:class)} {set class unknown}
!     puts stderr " -> $tag ($class)"
! }
  
  set pdtk_canvas_mouseup(name) 0
***************
*** 978,990 ****
      foreach {name label type options} $struct {
          switch -- $type {
- 	    entry {
- 		frame .$self.$name
- 		label .$self.$name.label -text $label
- 		pack  .$self.$name.label -side left
- 		eval "entry .$self.$name.entry -textvariable _($self:$name) $options"
- 		pack .$self.$name.entry -side left
- 		bind .$self.$name.entry <Return> "$ok .$self"
- 		pack .$self.$name -side top
- 	    }
  	    side {
  		frame .$self.$name
--- 978,981 ----
***************
*** 1029,1032 ****
--- 1020,1036 ----
  		pack .$self.$name -side top
  	    }
+ 	    default {
+ 		frame .$self.$name
+ 		label .$self.$name.label -text $label
+ 		pack  .$self.$name.label -side left
+ 		eval "entry .$self.$name.entry -textvariable _($self:$name) $options"
+ 		pack .$self.$name.entry -side left
+ 		bind .$self.$name.entry <Return> "$ok .$self"
+ 		if {[string compare $type "entry"]} {
+ 			label .$self.$name.type -text "($type)"
+ 			pack .$self.$name.type
+ 		}
+ 		pack .$self.$name -side top
+ 	    }
  	}
      }
***************
*** 1082,1086 ****
  	$_($self:wherelabel) \
      	$_($self:symfrom) \
! 	[gatom_escape $_($self:symto)] \;"
  }
  
--- 1086,1090 ----
  	$_($self:wherelabel) \
      	$_($self:symfrom) \
! 	[gatom_escape $_($self:symto)] ;"
  }
  
***************
*** 1523,1535 ****
  
  # create a new text object
! proc pdtk_text_new {canvasname myname x y text font color} {
!     $canvasname create text $x $y \
      	-font [format -*-courier-medium--normal--%d-* $font] \
      	-tags $myname -text $text -fill $color  -anchor nw 
  }
  
  # change the text
! proc pdtk_text_set {canvasname myname text} {
!     $canvasname itemconfig $myname -text $text
  }
  
--- 1527,1549 ----
  
  # create a new text object
! proc pdtk_text_new {canvas myname x y text font color} {
!     $canvas create rectangle $x $y $x $y -tags ${myname}_R -fill yellow -width 0
!     $canvas create text $x $y \
      	-font [format -*-courier-medium--normal--%d-* $font] \
      	-tags $myname -text $text -fill $color  -anchor nw 
+     foreach {x1 y1 x2 y2} [$canvas bbox ${myname}] {}
+     $canvas coords ${myname}_R $x1 $y1 $x2 $y2
  }
  
  # change the text
! proc pdtk_text_set {canvas myname text} {
!     $canvas itemconfigure $myname -text $text
!     foreach {x1 y1 x2 y2} [$canvas bbox ${myname}] {
! 	$canvas coords ${myname}_R $x1 $y1 $x2 $y2
!     }
! }
! 
! proc pdtk_text_delete {canvas myname} {
!     $canvas delete ${myname}_R $myname
  }
  
***************
*** 2227,2230 ****
--- 2241,2268 ----
  }
  
+ proc pdrc_editor_ok {self} {pdrc_editor_apply $self; pdrc_editor_cancel $self}
+ proc pdrc_editor_cancel {self} {destroy $self}
+ proc pdrc_editor_apply {self} {error "BOO"}
+ 
+ proc pdrc_editor_new {} {
+ 	global _ pdrc_options
+ 	set self pdrc
+ 	toplevel .$self
+ 	frame .$self.1
+ 	canvas .$self.1.1
+ 	frame .$self.1.1.2 -width 420 -height 420
+ 	.$self.1.1 create window 0 0 -window .$self.1.1.2
+ 	scrollbar .$self.1.2 -command ".$self.1.1 yview"
+ 	foreach {x y z} $pdrc_options {
+ 		puts "$x $y $z"
+ 		properties_dialog $self pdrc_editor_ok [list $x "$x: $z" $y {}]
+ 	}
+ 	pack .$self.1.1 -expand yes -fill both -side left
+ 	pack .$self.1.2 -expand yes -fill y -side left
+ 	pack .$self.1
+ 	cancel_apply_ok $self pdrc_editor
+ 	return $self
+ }
+ 
  ############ tooltips
  





More information about the Pd-cvs mailing list