[PD-cvs] extensions/gui/ix mat.wid,1.7,1.8 mat-demo.pd,1.6,1.7

carmen rocco ix9 at users.sourceforge.net
Sun Jun 19 04:21:17 CEST 2005


Update of /cvsroot/pure-data/extensions/gui/ix
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15443

Modified Files:
	mat.wid mat-demo.pd 
Log Message:
...

Index: mat.wid
===================================================================
RCS file: /cvsroot/pure-data/extensions/gui/ix/mat.wid,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** mat.wid	15 Jun 2005 13:02:15 -0000	1.7
--- mat.wid	19 Jun 2005 02:21:13 -0000	1.8
***************
*** 8,14 ****
  	set vel [$p.m itemcget $item -fillopacity]
  	pd [concat $t.rp _cb note [dict get $_($t) $id y] $vel $len \;]}
! 
      proc mat_click {m button action p t x y} {
  	variable _
  	switch $m {
  	    control {mat_draw $action $p $t $x $y}	    
--- 8,24 ----
  	set vel [$p.m itemcget $item -fillopacity]
  	pd [concat $t.rp _cb note [dict get $_($t) $id y] $vel $len \;]}
!     namespace eval actions {
! 	proc action {p t o} {puts gah}
! 	proc draw {p t o} {puts draw}
! 	proc resize_canvas {p t o} {}
! 	proc move_canvas {p t o} {puts cvda}
! 	proc move_object {p t o} {
! 	    puts hiihect
! 	}
!     }
      proc mat_click {m button action p t x y} {
  	variable _
+ 	set a [$p.m itemcget mode -text]
+ 	eval actions::$a $p $t o
  	switch $m {
  	    control {mat_draw $action $p $t $x $y}	    
***************
*** 22,25 ****
--- 32,41 ----
  			    }
  			}
+ 			if {$clicked ne "" && [lindex [$p.m itemcget $item -tags] 0] eq "item"} {
+ 			    mat_mode $p $t {move_object}
+ 			} {mat_mode $p $t {move_canvas}}
+ 			    set junk ""
+ 			    foreach cfg [$p.m itemconfigure $clicked] {set junk "$junk\n$cfg"}
+ 			    mat_info $p $t $junk
  		    }
  		    first {
***************
*** 28,31 ****
--- 44,48 ----
  			#		}
  			foreach xy {x y}  {set _($t:f$xy) [set $xy]}
+ 			switch $button {2 {mat_mode $p $t resize_canvas}}
  		    }
  		    motion {
***************
*** 82,85 ****
--- 99,107 ----
  			}			
  		    }
+ 		    release {
+ 			switch $button {
+ 			    2 {mat_mode $p $t move_canvas}
+ 			}
+ 		    }
  		}
  		foreach xy {x y}  {set _($t:c$xy) [set $xy]}
***************
*** 122,125 ****
--- 144,169 ----
  	mat_gridlines $p $t}
  
+     proc mat_key {p t k b} {
+ 	puts $k
+ 	switch $b {
+ 	    1 {
+ 		switch $k {
+ 		    37 {mat_mode  $p $t draw}
+ 		}
+ 	    }
+ 	    0 {
+ 		switch $k {
+ 		    37 {mat_mode  $p $t {move_canvas}}
+ 		}
+ 	    }
+ 	}
+     }
+     proc mat_mode {p t m} {
+ 	$p.m itemconfigure mode -text $m
+     }
+     proc mat_info {p t m} {
+ 	$p.m itemconfigure info -text $m
+     }
+ 
      proc mat_new {path target w h bg ln xa xb ya yb qx qy} {
  	variable _
***************
*** 130,133 ****
--- 174,179 ----
  	    canvas $path.m -bg $bg -width $w -height $h
  	    pack $path.m -side left
+ 	    bind $path.m <Key> "::ix::mat_key $path $target %k 1"
+ 	    bind $path.m <KeyRelease> "::ix::mat_key $path $target %k 0"
  	    bind $path.m <Motion> "::ix::mat_click {} 0 hover $path $target %x %y"
  	    foreach m {"Control-" "" "Shift-"} {
***************
*** 138,141 ****
--- 184,189 ----
  	    set bd [expr {[$path cget -bd] * 2}]
              $path configure -bg gray -width [expr [winfo width $path.m] + $bd] -height [expr [winfo height $path.m] + $bd]
+ 	    $path.m create text {20 20} -fill blue -justify left -anchor w -font {{bitstream vera sans} 18} -tags mode -text action
+ 	    $path.m create text {20 32} -fill gray49 -justify left -anchor nw -font {{bitstream vera sans} 12} -tags info
  	    mat_gridlines $path $target}}
      

Index: mat-demo.pd
===================================================================
RCS file: /cvsroot/pure-data/extensions/gui/ix/mat-demo.pd,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mat-demo.pd	15 Jun 2005 13:02:15 -0000	1.6
--- mat-demo.pd	19 Jun 2005 02:21:14 -0000	1.7
***************
*** 1,4 ****
! #N canvas 1036 0 914 718 12;
! #X obj 17 22 widget mat n1 #w 881 #bg gray83 #divX 8 #divY 5 #h 494
  #Yb 1 #Ya 88 #qYv 2 #qYa 8 #ln white;
  #X msg 1080 -13 -height 26 -width 26 -bg gray95;
--- 1,4 ----
! #N canvas 80 85 910 775 12;
! #X obj 15 29 widget mat n1 #w 881 #bg gray83 #divX 8 #divY 5 #h 494
  #Yb 1 #Ya 88 #qYv 2 #qYa 8 #ln white;
  #X msg 1080 -13 -height 26 -width 26 -bg gray95;
***************
*** 8,18 ****
  #X obj 587 565 rr ss;
  #X obj 587 546 rg;
! #X obj 27 538 route note;
! #X obj 19 603 unpack f f f;
  #X obj 47 638 * 127;
  #X obj 26 668 pack f f f;
  #X obj 49 692 makenote 99 250;
  #X obj 102 728 noteout;
! #X obj 108 584 rp ss kbd;
  #X obj 158 583 rp ss kb2;
  #X obj 138 537 widget kbd k1 #bg blue #fg green #ln gray50 -height
--- 8,17 ----
  #X obj 587 565 rr ss;
  #X obj 587 546 rg;
! #X obj 20 603 unpack f f f;
  #X obj 47 638 * 127;
  #X obj 26 668 pack f f f;
  #X obj 49 692 makenote 99 250;
  #X obj 102 728 noteout;
! #X obj 77 559 rp ss kbd;
  #X obj 158 583 rp ss kb2;
  #X obj 138 537 widget kbd k1 #bg blue #fg green #ln gray50 -height
***************
*** 24,50 ****
  #X obj 158 602 Append 2;
  #X msg 74 575 1;
! #X connect 0 0 7 0;
  #X connect 2 0 0 0;
! #X connect 3 0 12 1;
! #X connect 4 0 12 0;
  #X connect 6 0 5 0;
! #X connect 7 0 8 0;
! #X connect 8 0 10 0;
! #X connect 8 1 9 0;
! #X connect 8 2 10 2;
! #X connect 9 0 10 1;
  #X connect 10 0 11 0;
! #X connect 11 0 12 0;
! #X connect 11 1 12 1;
  #X connect 13 0 18 0;
! #X connect 14 0 19 0;
  #X connect 15 0 18 0;
  #X connect 15 0 13 0;
! #X connect 16 0 19 0;
! #X connect 16 0 14 0;
! #X connect 17 0 4 0;
! #X connect 17 1 3 0;
! #X connect 17 2 12 2;
! #X connect 18 0 17 0;
! #X connect 19 0 17 0;
! #X connect 20 0 10 2;
--- 23,53 ----
  #X obj 158 602 Append 2;
  #X msg 74 575 1;
! #X obj 3 533 widget dd dd1 -bg green -fg red;
! #X obj 3 493 a2l;
! #X obj 3 549 widget dd s2 #symbol 0;
! #X connect 0 0 21 0;
  #X connect 2 0 0 0;
! #X connect 3 0 11 1;
! #X connect 4 0 11 0;
  #X connect 6 0 5 0;
! #X connect 7 0 9 0;
! #X connect 7 1 8 0;
! #X connect 7 2 9 2;
! #X connect 8 0 9 1;
! #X connect 9 0 10 0;
  #X connect 10 0 11 0;
! #X connect 10 1 11 1;
! #X connect 12 0 17 0;
  #X connect 13 0 18 0;
! #X connect 14 0 17 0;
! #X connect 14 0 12 0;
  #X connect 15 0 18 0;
  #X connect 15 0 13 0;
! #X connect 16 0 4 0;
! #X connect 16 1 3 0;
! #X connect 16 2 11 2;
! #X connect 17 0 16 0;
! #X connect 18 0 16 0;
! #X connect 19 0 9 2;
! #X connect 21 0 20 0;
! #X connect 22 0 20 0;





More information about the Pd-cvs mailing list