[PD-cvs] pd/src desire.tk,1.1.2.37,1.1.2.38
Mathieu Bouchard
matju at users.sourceforge.net
Sat Sep 10 12:21:13 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7072
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
cleanup
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.37
retrieving revision 1.1.2.38
diff -C2 -d -r1.1.2.37 -r1.1.2.38
*** desire.tk 10 Sep 2005 09:50:14 -0000 1.1.2.37
--- desire.tk 10 Sep 2005 10:21:11 -0000 1.1.2.38
***************
*** 516,520 ****
set _($object_id:name_len) [string length $obj_name]
set _($canvas_id:obj_in_edit) 0
! set _($object_id:class) textobj
puts "obj x: [lindex $line 2] y: [lindex $line 3]"
--- 516,520 ----
set _($object_id:name_len) [string length $obj_name]
set _($canvas_id:obj_in_edit) 0
! set _($object_id:class) objectbox
puts "obj x: [lindex $line 2] y: [lindex $line 3]"
***************
*** 784,788 ****
set canvasmenu(put) {
! {Object {textobj_new} "Ctrl+1"}
{Message {pd "%W msg 0 ;"} "Ctrl+2"}
{Number {pd "%W floatatom 0 ;"} "Ctrl+3"}
--- 784,788 ----
set canvasmenu(put) {
! {Object {objectbox_new} "Ctrl+1"}
{Message {pd "%W msg 0 ;"} "Ctrl+2"}
{Number {pd "%W floatatom 0 ;"} "Ctrl+3"}
***************
*** 1175,1183 ****
}
- def brokenbox draw {canvas} {
- puts "brokenbox_draw:: $self $canvas"
- $canvas itemconfigure ${self}BASE -width 1 -dash {8 8 8 8}
- }
-
def objectbox draw {canvas} {
set xs 42; catch {set xs $@xs}
--- 1175,1178 ----
***************
*** 1218,1221 ****
--- 1213,1222 ----
$canvas itemconfigure ${self}BASE -outline $frcol
#$canvas itemconfigure ${self}BASE -outline $look(objectframe3)
+
+ if {$@isnew} {
+ $canvas itemconfigure ${self}BASE -dash {8 8 8 8}
+ } {
+ $canvas itemconfigure ${self}BASE -dash {}
+ }
}
***************
*** 1323,1332 ****
set @sx sx
set @sy sy
! if {[expr $@isnew == 1]} {
! brokenbox_draw $self $canvas
! } {
! objectbox_draw $self $canvas
! }
!
text ${canvas}.${self}text -height 1 -width $name_len -relief flat \
-bg ${look(objectbg)} -borderwidth 0 \
--- 1324,1328 ----
set @sx sx
set @sy sy
! objectbox_draw $self $canvas
text ${canvas}.${self}text -height 1 -width $name_len -relief flat \
-bg ${look(objectbg)} -borderwidth 0 \
***************
*** 1370,1383 ****
set _($self:sx) [expr ($font(width) * ($name_len+1) + $font(padx))]
set _($self:sy) [expr $font(height) + $font(pady)]
! if {[expr $_($self:isnew) == 1]} {
! brokenbox_draw $self $canvas
! } {
! objectbox_draw $self $canvas
! }
}
#-----------------------------------------------------------------------------------#
#proc object_new {} {
! class_new textobj {
global offset _
set canvas $_(focus)
--- 1366,1375 ----
set _($self:sx) [expr ($font(width) * ($name_len+1) + $font(padx))]
set _($self:sy) [expr $font(height) + $font(pady)]
! objectbox_draw $self $canvas
}
#-----------------------------------------------------------------------------------#
#proc object_new {} {
! class_new objectbox {
global offset _
set canvas $_(focus)
***************
*** 1385,1393 ****
if {$_($self:mode) == "edit"} {
! set offset [expr $offset + 1]
! set object_id [format %x [expr 0x81168b0 - $offset]]
! set _($object_id:class) textobj
! puts "new object id -> $object_id"
! object_add $object_id $canvas
}
}
--- 1377,1386 ----
if {$_($self:mode) == "edit"} {
! set offset [expr $offset + 1]
! set object_id [format %x [expr 0x81168b0 - $offset]]
! set _($object_id:class) objectbox
! set _($object_id:_class) objectbox
! puts "new object id -> $object_id"
! object_add $object_id $canvas
}
}
***************
*** 1422,1426 ****
set @sx [expr $font(width) + $font(padx)]
set @sy [expr $font(height) + $font(pady)]
! brokenbox_draw $self $canvas
text_create $self $canvas $font(size) ""
}
--- 1415,1419 ----
set @sx [expr $font(width) + $font(padx)]
set @sy [expr $font(height) + $font(pady)]
! objectbox_draw $self $canvas
text_create $self $canvas $font(size) ""
}
***************
*** 1444,1451 ****
objectbox_erase $self $canvas
! objectbox_draw $self $canvas \
! [expr ($@name_len*$font(width)) + $font(padx)] \
! [expr $font(height) + $font(pady)] 1 3
!
#wire_update $wire_id $_($wire_id)
#wire_draw2 $wire_id $canvas
--- 1437,1443 ----
objectbox_erase $self $canvas
! set @sx [expr ($@name_len*$font(width)) + $font(padx)]
! set @sy [expr $font(height) + $font(pady)]
! objectbox_draw $self $canvas
#wire_update $wire_id $_($wire_id)
#wire_draw2 $wire_id $canvas
***************
*** 1477,1486 ****
}
}
! #pdtk_text_new \
! #$canvas ${self}TEXT 41.000000 42.000000 $obj_name $font(size) #000000
! pdtk_text_new \
! $canvas ${self}TEXT [expr $@cx+2] [expr $@cy+2] \
! $obj_name $font(size) #000000
! #puts "destroy check = [winfo exists ${canvas}.${self}text]"
}
--- 1469,1474 ----
}
}
! pdtk_text_new $canvas ${self}TEXT [expr $@cx+2] [expr $@cy+2] \
! $obj_name $font(size) #000000
}
***************
*** 1574,1579 ****
puts "**** class==> $_($obj:class) *****"
switch $_($obj:class) {
! textobj {
! puts "move textobj"
set $_($obj:sx) [expr ($_($obj:name_len)*$font(width)) + $font(padx)]
set $_($obj:sy) [expr $font(height) + $font(pady)]
--- 1562,1567 ----
puts "**** class==> $_($obj:class) *****"
switch $_($obj:class) {
! objectbox {
! puts "move objectbox"
set $_($obj:sx) [expr ($_($obj:name_len)*$font(width)) + $font(padx)]
set $_($obj:sy) [expr $font(height) + $font(pady)]
***************
*** 1860,1864 ****
#}
! #textobj {
# may need to call canvas_select_object here to work out
# the shift+click selection
--- 1848,1852 ----
#}
! #objectbox {
# may need to call canvas_select_object here to work out
# the shift+click selection
***************
*** 2139,2143 ****
switch $_($_($self:selection):class) {
! textobj {
if {$_($self:obj_in_edit) == 0} {
set _($self:obj_in_edit) 1
--- 2127,2131 ----
switch $_($_($self:selection):class) {
! objectbox {
if {$_($self:obj_in_edit) == 0} {
set _($self:obj_in_edit) 1
***************
*** 2322,2329 ****
#-----------------------------------------------------------------------------------#
-
- # modes:
- # 0: creation
- # 1: resize (or move)
def wire draw {canvas thick x1 y1 x2 y2} {
puts "wire_draw:: $self $canvas $thick $x1 $y1 $x2 $y2"
--- 2310,2313 ----
***************
*** 2357,2361 ****
}
- #-----------------------------------------------------------------------------------#
def wire draw2 {canvas} {
puts "wire_draw2:: $self $canvas"
--- 2341,2344 ----
***************
*** 2368,2372 ****
wire_draw $self $canvas 1 $x1 $y1 $x2 $y2
}
! #-----------------------------------------------------------------------------------#
def wire select {canvas flag} {
puts "wire_select:: $self $canvas $flag"
--- 2351,2355 ----
wire_draw $self $canvas 1 $x1 $y1 $x2 $y2
}
!
def wire select {canvas flag} {
puts "wire_select:: $self $canvas $flag"
***************
*** 2375,2379 ****
$canvas itemconfigure $self -fill $colour
}
! #-----------------------------------------------------------------------------------#
def wire erase {canvas} {
puts "wire_erase:: $self $canvas"
--- 2358,2362 ----
$canvas itemconfigure $self -fill $colour
}
!
def wire erase {canvas} {
puts "wire_erase:: $self $canvas"
***************
*** 2381,2385 ****
$canvas delete $self
}
! #-----------------------------------------------------------------------------------#
def wire update {d} {
puts "wire_update:: $self $d"
--- 2364,2368 ----
$canvas delete $self
}
!
def wire update {d} {
puts "wire_update:: $self $d"
***************
*** 2387,2391 ****
[lrange $d 0 3] {}
}
! #-----------------------------------------------------------------------------------#
#def wire status {d} {
# puts "wire_update:: $self $d"
--- 2370,2374 ----
[lrange $d 0 3] {}
}
!
#def wire status {d} {
# puts "wire_update:: $self $d"
***************
*** 2393,2398 ****
# [lrange $d 0 3] {}
#}
- #-----------------------------------------------------------------------------------#
############ colouring
--- 2376,2381 ----
# [lrange $d 0 3] {}
#}
+ #-----------------------------------------------------------------------------------#
############ colouring
***************
*** 2479,2482 ****
--- 2462,2466 ----
set class objectbox
catch {set class [lindex $classinfo($_($self:class)) 1]}
+ set _($self:_class) $class
eval [linsert $args 0 ${class}_$sel $self]
}
***************
*** 2502,2511 ****
############ rendering
! # for future use
! proc update_item {self canvas suffix type coords args} {
if {![llength [$canvas gettags ${self}${suffix}]]} {
! $canvas create $type $coords -tags ${self}$suffix $args...
} {
! $canvas itemconfigure ${self}$suffix $args...
}
}
--- 2486,2494 ----
############ rendering
! proc item {self canvas suffix type coords args} {
if {![llength [$canvas gettags ${self}${suffix}]]} {
! eval [concat [list $canvas create $type $coords -tags ${self}$suffix] $args]
} {
! eval [concat [list $canvas itemconfigure ${self}$suffix] $args]
}
}
***************
*** 2524,2529 ****
}
- def brokenbox erase {canvas} {objectbox_erase $self $canvas}
-
def message draw {canvas xs ys ins outs} {
global look
--- 2507,2510 ----
More information about the Pd-cvs
mailing list