[PD-cvs] pd/src desire.tk,1.1.2.95,1.1.2.96

Mathieu Bouchard matju at users.sourceforge.net
Wed Nov 2 12:49:46 CET 2005


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

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


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.95
retrieving revision 1.1.2.96
diff -C2 -d -r1.1.2.95 -r1.1.2.96
*** desire.tk	1 Nov 2005 20:56:44 -0000	1.1.2.95
--- desire.tk	2 Nov 2005 11:49:43 -0000	1.1.2.96
***************
*** 87,91 ****
  	}
  	set @q [list]
! 	after 500 "$self call"
  }
  
--- 87,91 ----
  	}
  	set @q [list]
! 	after 50 "$self call"
  }
  
***************
*** 230,234 ****
  	frame $f.1 -borderwidth 2 -relief groove
  	canvas $f.1.mtr -width 100 -height 10 -bg #222222
! 	$f.1.mtr create line 0 0 0 0 -width 24 -fill [switch $z {in {set 0 blue} out {set 0 green}}] -tags m
  	canvas $f.1.clip -width 5 -height 10 -bg #222222
  	pack $f.1.mtr $f.1.clip -side left -pady 2 -padx 0
--- 230,235 ----
  	frame $f.1 -borderwidth 2 -relief groove
  	canvas $f.1.mtr -width 100 -height 10 -bg #222222
! 	$f.1.mtr create line 0 0 0 0 -width 24 \
! 		-fill [switch $z {in {set 0 blue} out {set 0 green}}] -tags m
  	canvas $f.1.clip -width 5 -height 10 -bg #222222
  	pack $f.1.mtr $f.1.clip -side left -pady 2 -padx 0
***************
*** 551,554 ****
--- 552,613 ----
  
  #-----------------------------------------------------------------------------------#
+ class_new view {observable thing}
+ 
+ def view init {} {
+ 	set @selected? 0
+ 	super
+ }
+ 
+ def* view erase {canvas} {item_delete $self $canvas}
+ def* view   click     {args} {}
+ def* view   clickedit {args} {}
+ def* view unclick     {args} {}
+ def* view unclickedit {args} {}
+ def* view  motion     {args} {}
+ def* view  motionedit {args} {}
+ 
+ def view selected?  {}  {return $@selected?}
+ def view selected?= {x} {set @selected? $x}
+ 
+ def* view select {state} {
+ 	set ostate [$self selected?]
+ 	set @selected? $state
+ 	if {$state!=$ostate} {$self changed}
+ }
+ 
+ def* view delete {canvas} {
+ 	$self erase $canvas
+ 	$self _delete
+ }
+ 
+ def view xy {canvas} {
+ 	global focus
+ #	if {[info exists focus(createdby)]} {
+ #		switch $focus(createdby) {
+ #		  butt {mset {@x1 @y1} 40 40}
+ #		  ctrl {
+ #		    if {[string length $focus(objname)] > 0} {
+ #			mset {@x1 @y1} $focus(oldpos)
+ #		    } else {
+ #			mset {@x1 @y1} $_($canvas:current)
+ #			set focus(oldpos) [list $@x1 $@y1]}}}}
+ 	# todo: should compute GOP stuff here
+ 	set cx $@x1
+ 	set cy $@y1
+ 	return [list $cx $cy]
+ }
+ 
+ #def view connect {} {
+ #}
+ 
+ # in the future, one view may have several canvases. (??)
+ # this would mean that the following proc will have to die.
+ def view canvas  {}  {return $@canvas}
+ def view canvas= {c} {set @canvas $c}
+ 
+ #-----------------------------------------------------------------------------------#
+ 
+ class_new canvas {view}
+ 
  def canvas close  {} {pd $name menuclose 0}
  def canvas save   {} {$self checkgeometry; pd $name menusave}
***************
*** 685,689 ****
  #-----------------------------------------------------------------------------------#
  
- class_new canvas {view}
  def* canvas init {{width 300} {height 400} {geometry 400x300+0+0} {editable 0}} {
      super
--- 744,747 ----
***************
*** 953,1028 ****
  
  #-----------------------------------------------------------------------------------#
- def view xy {canvas} {
- 	global focus
- 	if {![info exists @cx]} {
- 		#don't delete these two lines
- 		#set @cx 40; catch {set @cx $_($canvas:current_x)}
- 		#set @cy 40; catch {set @cy $_($canvas:current_y)}
- 		if {[info exists focus(createdby)]} {
- 		switch $focus(createdby) {
- 		  butt {
- 			set @cx 40
- 			set @cy 40
- 		  }
- 		  ctrl {
- 		    if {[string length $focus(objname)] > 0} {
- 			set @cx $focus(old_cx)
- 			set @cy $focus(old_cy)
- 		    } else {
- 			set @cx $_($canvas:current_x)
- 			set @cy $_($canvas:current_y)
- 			set focus(old_cx) $@cx
- 			set focus(old_cy) $@cy
- 		    }
- 		  }
- 		}}
- 	}
- 	return [list $@cx $@cy]
- }
- 
- #def view connect {} {
- #}
- 
- # in the future, one view may have several canvases. (??)
- # this would mean that the following proc will have to die.
- def view canvas  {}  {return $@canvas}
- def view canvas= {c} {set @canvas $c}
- 
- def* objectbox draw {canvas} {
- 	$self update_size
- 	set xs $@xs
- 	set ys $@ys
- 	set ins $@ninlets
- 	set outs $@noutlets
-         global look font
-         mset {x1 y1} [$self xy $canvas]
- 	set x2 [expr $x1+$xs]
-         set y2 [expr $y1+$ys]
-         set xya [list $x1 $y1 $x2 $y2]
- 	set xyb [l+ [list $x2 $y1 $x1 $y1 $x1 $y2] [list -1 +1 +1 +1 +1 -1]]
- 	set xyc [l+ [list $x2 $y1 $x2 $y2 $x1 $y2] [list -1 +1 -1 -1 +1 -1]]
- 	#shadow_draw $self $canvas $xya
- 	item $self $canvas BASE  rectangle $xya -fill $look(objectbg)
- 	item $self $canvas BASE2 line      $xyb -fill $look(objectframe2)
- 	item $self $canvas BASE3 line      $xyc -fill $look(objectframe3)
-         io_draw $self $canvas
-         if {[$canvas selected? $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
- 	set c .x$canvas.c
- 	$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.
! def canvas selected? {member} {
      set i [lsearch $@selection $member]
      return [expr $i>=0]
--- 1011,1017 ----
  
  #-----------------------------------------------------------------------------------#
  #this just tells whether an object is part of the selection, that is, what usually 
  #make objects turn blue.
! def canvas selection_include? {member} {
      set i [lsearch $@selection $member]
      return [expr $i>=0]
***************
*** 1034,1037 ****
--- 1023,1029 ----
  
  #-----------------------------------------------------------------------------------#
+ # wtf is this supposed to be, again?
+ class_new io {ganymeda}
+ 
  def io draw/2 {canvas which n y} {
      global look
***************
*** 1109,1113 ****
  	bind $t <Return>         "$self unedit $canvas"
  	set t .x$canvas.c.${self}text
! 	.x$canvas.c create window [expr $@cx+1] [expr $@cy+1] \
  		-window $t -anchor nw -tags "${self}text $self"
  	$self draw $canvas
--- 1101,1106 ----
  	bind $t <Return>         "$self unedit $canvas"
  	set t .x$canvas.c.${self}text
! 	mset {cx cy} [$self xy $canvas]
! 	.x$canvas.c create window [expr $cx+1] [expr $cy+1] \
  		-window $t -anchor nw -tags "${self}text $self"
  	$self draw $canvas
***************
*** 1118,1129 ****
  
  def* textbox key {canvas widget x y key iso shift} {
! 	after 1 "$self after_key $canvas $widget"
  }
  
  def* textbox after_key {canvas widget} {
  	set @text [$widget get 1.0 1.end]
! 	post "@text is '%s'" $@text
! 	$self update_size
! 	$self draw $canvas
  }
  
--- 1111,1131 ----
  
  def* textbox key {canvas widget x y key iso shift} {
! 	after 0 "$self after_key $canvas $widget"
  }
  
  def* textbox after_key {canvas widget} {
  	set @text [$widget get 1.0 1.end]
! 	$self changed
! #	post "@text is '%s'" $@text
! #	$self update_size
! #	$self draw $canvas
! }
! 
! def* textbox update_size {} {
! 	global font
! 	##added +1 below that fixs the initial box size on my side - chun
! 	#set @xs [expr $font(padx)+$font(width)*([string length $@text]+1-$@valid)]
! 	set @xs  [expr $font(padx)+$font(width)*([string length $@text]   +$@edit)]
! 	set @ys  [expr $font(pady)+$font(height)]
  }
  
***************
*** 1131,1134 ****
--- 1133,1137 ----
  
  class_new objectbox {textbox}
+ 
  def* objectbox init {args} {
  	super
***************
*** 1161,1170 ****
  def canvas selection {objs} {return @selection}
  
! def* textbox update_size {} {
! 	global font
! 	##added +1 below that fixs the initial box size on my side - chun
! 	#set @xs [expr $font(padx)+$font(width)*([string length $@text]+1-$@valid)]
! 	set @xs  [expr $font(padx)+$font(width)*([string length $@text]   +$@edit)]
! 	set @ys  [expr $font(pady)+$font(height)]
  }
  
--- 1164,1195 ----
  def canvas selection {objs} {return @selection}
  
! def* objectbox draw {canvas} {
! 	$self update_size
! 	set xs $@xs
! 	set ys $@ys
! 	set ins $@ninlets
! 	set outs $@noutlets
!         global look font
!         mset {x1 y1} [$self xy $canvas]
! 	set x2 [expr $x1+$xs]
!         set y2 [expr $y1+$ys]
!         set xya [list $x1 $y1 $x2 $y2]
! 	set xyb [l+ [list $x2 $y1 $x1 $y1 $x1 $y2] [list -1 +1 +1 +1 +1 -1]]
! 	set xyc [l+ [list $x2 $y1 $x2 $y2 $x1 $y2] [list -1 +1 -1 -1 +1 -1]]
! 	#shadow_draw $self $canvas $xya
! 	item $self $canvas BASE  rectangle $xya -fill $look(objectbg)
! 	item $self $canvas BASE2 line      $xyb -fill $look(objectframe2)
! 	item $self $canvas BASE3 line      $xyc -fill $look(objectframe3)
!         io_draw $self $canvas
!         if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
! 	set c .x$canvas.c
! 	$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}
  }
  
***************
*** 1185,1188 ****
--- 1210,1214 ----
  def objectbox complete2 {canvas} {
  	global fonttext_setto
+ 	# why?
  	set @selected? 0
  	$self erase $canvas 
***************
*** 1199,1203 ****
  		}
  	}
! 	text_new $canvas $self [expr $@cx+2] [expr $@cy+2] \
  		$obj_name $font(size) #000000
  }
--- 1225,1230 ----
  		}
  	}
! 	mset cx cy [$self xy $canvas]
! 	text_new $canvas $self [expr $cx+2] [expr $cy+2] \
  		$obj_name $font(size) #000000
  }
***************
*** 1296,1302 ****
  
  def view move {canvas dx dy} {
! 	set @cx [expr $@cx+$dx]
! 	set @cy [expr $@cy+$dy]
! 	.x$@canvas.c move $self $dx $dy
  }
  
--- 1323,1331 ----
  
  def view move {canvas dx dy} {
! 	mset x y [$self xy $canvas]
! 	set @x1 [expr $@x1+$dx]
! 	set @y1 [expr $@y1+$dy]
! 	mset u v [$self xy $canvas]
! 	.x$@canvas.c move $self [expr $u-$x] [expr $v-$y]
  }
  
***************
*** 1304,1311 ****
  def objectbox hilite_io {canvas type x y} {
  	global look
  	set c .x$canvas.c
  	set ports 0; catch {set ports $@ninlets}
  	if {$ports==0} return
! 	set port [expr int(($x-$@cx)*$ports/$@xs)]
  	set p ${self}${type}${port}
  	#if {![llength $@wire_from]} {}
--- 1333,1342 ----
  def objectbox hilite_io {canvas type x y} {
  	global look
+ 	mset {cx cy} [$self xy $canvas]
  	set c .x$canvas.c
  	set ports 0; catch {set ports $@ninlets}
  	if {$ports==0} return
! 	set port [expr int(($x-$cx)*$ports/$@xs)]
! 	if {$port >= $ports} {set port [expr $ports-1]}
  	set p ${self}${type}${port}
  	#if {![llength $@wire_from]} {}
***************
*** 1365,1370 ****
  	if {$@editmode} {set event motionedit} {set event motion}
  	$id $event $self $x $y $mods
! 	if {$@editmode && [llength [$id bbox]]} {
! 	  mset {x1 y1 x2 y2} [$id bbox]
  	  if {abs($y1+3-$y)<=3} {
  		set port [$id hilite_io $self i $x $y]
--- 1396,1401 ----
  	if {$@editmode} {set event motionedit} {set event motion}
  	$id $event $self $x $y $mods
! 	if {$@editmode && [llength [$id bbox $self]]} {
! 	  mset {x1 y1 x2 y2} [$id bbox $self]
  	  if {abs($y1+3-$y)<=3} {
  		set port [$id hilite_io $self i $x $y]
***************
*** 1409,1412 ****
--- 1440,1445 ----
  
  #-----------------------------------------------------------------------------------#
+ class_new statusbar {yadda}
+ 
  proc statusbar_new {self} {
  	set f .x$self.stat
***************
*** 1438,1449 ****
        object {
  	if {[info exists _($id:class)]} {set class $_($id:class)} {set class unknown}
! 	$bar.what configure -text "$id \[$class\] ($tags)"
        }
!       wire    {$bar.what configure -text "$id wire"}
!       default {$bar.what configure -text "... $tags"}
      }
      if {[string length $@focus]} {
! 	$bar.what configure -text "focus: $@focus"
      }
      $bar.mode configure -text [if {$@editmode} {list "Edit"} {list "Run "}]
      $bar.action configure -text $@action
--- 1471,1483 ----
        object {
  	if {[info exists _($id:class)]} {set class $_($id:class)} {set class unknown}
! 	set t "$id \[$class\] ($tags)"
        }
!       wire    {set t "$id wire"}
!       default {set t "... $tags"}
      }
      if {[string length $@focus]} {
! 	set t "focus: $@focus"
      }
+     $bar.what configure -text $t
      $bar.mode configure -text [if {$@editmode} {list "Edit"} {list "Run "}]
      $bar.action configure -text $@action
***************
*** 1451,1455 ****
  }
  
! def objectbox bbox {} {list $@cx $@cy [expr $@cx+$@xs] [expr $@cy+$@ys]}
  
  #-----------------------------------------------------------------------------------#
--- 1485,1492 ----
  }
  
! def objectbox bbox {canvas} {
! 	mset {x y} [$self xy $canvas]
! 	list $x $y [expr $x+$@xs] [expr $y+$@ys]
! }
  
  #-----------------------------------------------------------------------------------#
***************
*** 1470,1474 ****
  	if {!($f&8) && $@editmode && [llength [$id bbox]]} {
  	    #$self start_wire
! 	    mset {x1 y1 x2 y2} [$id bbox]
  	    if {abs($y2-3-$y)<=3} {
  		set outs 0
--- 1507,1511 ----
  	if {!($f&8) && $@editmode && [llength [$id bbox]]} {
  	    #$self start_wire
! 	    mset {x1 y1 x2 y2} [$id bbox $self]
  	    if {abs($y2-3-$y)<=3} {
  		set outs 0
***************
*** 1494,1500 ****
  				#puts "____complete [lindex $@selection 0] first!____"
  				set old_obj [lindex $@selection 0]
! 				if {$@select_by == "click"} {
! 					$old_obj unedit $self
! 				}
  				set @obj_in_edit {}
  			}
--- 1531,1535 ----
  				#puts "____complete [lindex $@selection 0] first!____"
  				set old_obj [lindex $@selection 0]
! 				if {$@select_by == "click"} {$old_obj unedit $self}
  				set @obj_in_edit {}
  			}
***************
*** 1530,1533 ****
--- 1565,1588 ----
  }
  
+ def* canvas clickedit {x y b f} {
+ 	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 {$c itemconfigure ${obj}BASE -outline $look(objectframe3)}
+ #		set @selection {}
+ #	}
+ #	if {[llength $@selection_wire] > 0} {
+ #		foreach wire $@selection_wire {$c itemconfigure $wire -fill $look(wirefg)}
+ #		set @selection_wire {}
+ #	}
+ #	focus $c
+ #	set @action rect
+ #	$c create line $x $y $x $y $x $y $x $y $x $y -tags {selrect1 selrect} -fill black -dash {3 3 3 3} -dashoffset 3
+ }
+ 
  def* canvas click {x y b f} {
      global OS mouse font look focus
***************
*** 1541,1571 ****
      #  object {$self click_on_object $x $y $b $f $id}
      #  wire   {$self click_on_wire   $x $y $b $f $id}
!       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 {
! 	#			$c itemconfigure ${obj}BASE -outline $look(objectframe3)
! 	#		}
! 	#		set @selection {}
! 	#	}
! 	#	if {[llength $@selection_wire] > 0} {
! 	#		foreach wire $@selection_wire {
! 	#			$c itemconfigure $wire -fill $look(wirefg)
! 	#		}
! 	#		set @selection_wire {}
! 	#	}
! 	#	focus $c
! 	#	set @action rect
! 	#	$c create line $x $y $x $y $x $y $x $y $x $y -tags {selrect1 selrect} -fill black -dash {3 3 3 3} -dashoffset 3
! 	}
!       }
      }
  }
--- 1596,1600 ----
      #  object {$self click_on_object $x $y $b $f $id}
      #  wire   {$self click_on_wire   $x $y $b $f $id}
!       default {if {$@editmode} {$self clickedit $x $y $b $f}}
      }
  }
***************
*** 1903,1913 ****
  # real classes
  set fields(obj)    [eval list $fields1]
! set fields(tgl)    [eval list $fields1 w                  isa   $fields2 on nonzero]
! set fields(bng)    [eval list $fields1 w hold break       isa   $fields2]
! set fields(nbx)    [eval list $fields1 w h min max is_log isa   $fields2 val log_height]
! set fields(hsl)    [eval list $fields1 w h min max is_log isa   $fields2 val steady]
! set fields(hradio) [eval list $fields1 w change           isa n $fields2 on]
! set fields(vu)     [eval list $fields1 w h        rcv lab ldx ldy fstyle fs bcol lcol scale isa]
! set fields(cnv)    [eval list $fields1 hh w h snd rcv lab ldx ldy fstyle fs bcol lcol       isa]
  set fields(dropper) [eval list $fields1 w isa $fields2]
  set fields(vsl)    $fields(hsl)
--- 1932,1942 ----
  # real classes
  set fields(obj)    [eval list $fields1]
! set fields(tgl)    [eval list $fields1    w                  isa   $fields2 on nonzero]
! set fields(bng)    [eval list $fields1    w hold break       isa   $fields2]
! set fields(nbx)    [eval list $fields1    w h min max is_log isa   $fields2 val log_height]
! set fields(hsl)    [eval list $fields1    w h min max is_log isa   $fields2 val steady]
! set fields(hradio) [eval list $fields1    w change           isa n $fields2 on]
! set fields(vu)     [eval list $fields1    w h        rcv lab ldx ldy fstyle fs bcol lcol scale isa]
! set fields(cnv)    [eval list $fields1 hh w h    snd rcv lab ldx ldy fstyle fs bcol lcol       isa]
  set fields(dropper) [eval list $fields1 w isa $fields2]
  set fields(vsl)    $fields(hsl)
***************
*** 2017,2032 ****
  ############ rendering
  
- class_new view {observable thing}
- def* view erase {canvas} {item_delete $self $canvas}
- def* view   click     {args} {}
- def* view   clickedit {args} {}
- def* view unclick     {args} {}
- def* view unclickedit {args} {}
- def* view  motion     {args} {}
- def* view  motionedit {args} {}
- def* view wb_activate {args} {}
- def* view wb_select   {args} {}
- def* view wb_delete   {canvas} {$self erase $canvas; $self ~}
- 
  proc item {self canvas suffix type coords args} {
  	set c .x$canvas.c
--- 2046,2049 ----
***************
*** 2043,2046 ****
--- 2060,2066 ----
  proc item_delete {self canvas} {.x$canvas.c delete $self}
  
+ # fix me
+ class_new shadow {qwerty}
+ 
  def shadow draw {canvas coords} {
  	global look
***************
*** 2063,2067 ****
  	item $self $canvas BASE polygon $points -fill $look(objectbg) -outline $look(objectframe3)
  	io_draw $self $canvas
! 	if {[$canvas selected? $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  }
--- 2083,2087 ----
  	item $self $canvas BASE polygon $points -fill $look(objectbg) -outline $look(objectframe3)
  	io_draw $self $canvas
! 	if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  }
***************
*** 2087,2091 ****
  	item $self $canvas BASE polygon $points -tag -fill $look(objectbg) -outline $look(objectframe3)
  	io_draw $self $canvas
! 	if {[$canvas selected? $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  }
--- 2107,2111 ----
  	item $self $canvas BASE polygon $points -tag -fill $look(objectbg) -outline $look(objectframe3)
  	io_draw $self $canvas
! 	if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  }
***************
*** 2123,2127 ****
  	io_draw $self $canvas
  	label_draw $self $canvas
! 	if {[$canvas selected? $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  	puts "/numbox_draw $self $canvas"
--- 2143,2147 ----
  	io_draw $self $canvas
  	label_draw $self $canvas
! 	if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  	puts "/numbox_draw $self $canvas"
***************
*** 2214,2217 ****
--- 2234,2238 ----
  }
  
+ class_new bluebox {view}
  def bluebox draw {canvas x1 y1 xs ys ins outs} {
  	global look
***************
*** 2227,2231 ****
  	item $self $canvas BASE3 line      $xyc -fill [darker $color]
  	io_draw $self $canvas
! 	if {[$canvas selected? $self]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  }
--- 2248,2252 ----
  	item $self $canvas BASE3 line      $xyc -fill [darker $color]
  	io_draw $self $canvas
! 	if {[$self selected?]} {set frcol $look(objectframe4)} {set frcol $look(objectframe3)}
  	$canvas itemconfigure ${self}BASE -outline $frcol
  }
***************
*** 2273,2278 ****
  class_new radio {view}
  def radio click {canvas x y b f} {
! 	set x [expr $x-$@x1]
! 	set y [expr $y-$@y1]
  	set orient [radio_orient $self]
  	set i [expr ($orient?$y:$x)/$@w]
--- 2294,2300 ----
  class_new radio {view}
  def radio click {canvas x y b f} {
! 	mset {x1 y1} [$self xy $canvas]
! 	set x [expr $x-$x1]
! 	set y [expr $y-$y1]
  	set orient [radio_orient $self]
  	set i [expr ($orient?$y:$x)/$@w]
***************
*** 2377,2386 ****
  }
  
! def slider unfocus {canvas} {
! 	slider_draw $self $canvas
! }
  
! #class_new label_new {view}
! def label draw {canvas} {
  	mset {x1 y1} [$self xy $canvas]
  	set lx [expr $x1+$@ldx]
--- 2399,2407 ----
  }
  
! def slider unfocus {canvas} {$self draw $canvas}
  
! class_new labelled {view}
! 
! def labelled draw {canvas} {
  	mset {x1 y1} [$self xy $canvas]
  	set lx [expr $x1+$@ldx]
***************
*** 2395,2399 ****
  }
  
! def label erase {canvas} {
  	$canvas delete ${self}LABEL
  }
--- 2416,2420 ----
  }
  
! def labelled erase {canvas} {
  	$canvas delete ${self}LABEL
  }
***************
*** 2651,2654 ****
--- 2672,2677 ----
  ############ evaluator
  
+ class_new listener {mumble}
+ 
  def listener new {name command} {
  	set @hist {}
***************
*** 2731,2750 ****
  
  set butt {
! 	{object  {pd %W obj 0 \;}}
! 	{message {msg 0}}
! 	{number  {floatatom 0}}
! 	{symbol  {symbolatom 0}}
! 	{comment {text 0}}
! 	{bang    {bng 0}}
! 	{toggle  {toggle 0}}
! 	{number2 {numbox 0}}
! 	{vslider {vslider 0}}
! 	{hslider {hslider 0}}
! 	{vradio  {vradio 0}}
! 	{hradio  {hradio 0}}
! 	{vu      {vumeter 0}}
! 	{dropper {dropper 0}}
! 	{canvas  {mycnv 0}}
! 	{graph   {graph}}
  	{array   {pd %W menuarray 0}}
  }
--- 2754,2773 ----
  
  set butt {
! 	{object  {obj_create $focus(canvas) butt}}
! 	{message {pd %W msg 0}}
! 	{number  {pd %W floatatom 0}}
! 	{symbol  {pd %W symbolatom 0}}
! 	{comment {pd %W text 0}}
! 	{bang    {pd %W bng 0}}
! 	{toggle  {pd %W toggle 0}}
! 	{number2 {pd %W numbox 0}}
! 	{vslider {pd %W vslider 0}}
! 	{hslider {pd %W hslider 0}}
! 	{vradio  {pd %W vradio 0}}
! 	{hradio  {pd %W hradio 0}}
! 	{vu      {pd %W vumeter 0}}
! 	{dropper {pd %W dropper 0}}
! 	{canvas  {pd %W mycnv 0}}
! 	{graph   {pd %W graph}}
  	{array   {pd %W menuarray 0}}
  }
***************
*** 2783,2797 ****
  	pack $self.edit -side left 
  	foreach b $butt {
! 		catch {
! 			if {[lindex $b 0] == "object"} {
! 			button "$self.[lindex $b 0]" -image "icon_[lindex $b 0]" -border 1 \
! 				-command {obj_create $focus(canvas) butt}
! 			pack $self.[lindex $b 0] -side left
! 			} else {
! 			button "$self.[lindex $b 0]" -image "icon_[lindex $b 0]" -border 1 \
! 				-command [list pd $doc [lindex $b 1]]
! 			pack $self.[lindex $b 0] -side left
! 			}
! 		}
  	}
  	entry $self.name -font {courier 9} -width 10 -border 0
--- 2806,2814 ----
  	pack $self.edit -side left 
  	foreach b $butt {
! 	  catch {
! 		button "$self.[lindex $b 0]" -image "icon_[lindex $b 0]" -border 1 \
! 			-command [regsub -all -- %W [lindex $b 1] $doc]
! 		pack $self.[lindex $b 0] -side left
! 	  }
  	}
  	entry $self.name -font {courier 9} -width 10 -border 0





More information about the Pd-cvs mailing list