[PD-cvs] pd/src desire.tk, 1.1.2.600.2.186, 1.1.2.600.2.187 kb-mode.tcl, 1.1.2.2, 1.1.2.3
chunlee
chunlee at users.sourceforge.net
Thu May 31 14:23:31 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15084
Modified Files:
Tag: desiredata
desire.tk kb-mode.tcl
Log Message:
basic keyboard editing
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.186
retrieving revision 1.1.2.600.2.187
diff -C2 -d -r1.1.2.600.2.186 -r1.1.2.600.2.187
*** desire.tk 29 May 2007 00:28:38 -0000 1.1.2.600.2.186
--- desire.tk 31 May 2007 12:23:27 -0000 1.1.2.600.2.187
***************
*** 1914,1917 ****
--- 1914,1922 ----
}
+ def Canvas new_objectxy {x y sel args} {
+ set @curpos [list $x $y]
+ $self new_object $sel $args
+ }
+
def Canvas new_object {sel args} {
$self editmode= 1
***************
*** 3973,3978 ****
--- 3978,3986 ----
wire {$self click_on_wire $id $f $x $y}
nothing {
+ #$self deselect_all
+ if {[lindex $@iohilite 0] == -1} {
$self click_on_nothing $f $target $x $y
return
+ }
}
label {$self click_on_object $id $f}
Index: kb-mode.tcl
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/kb-mode.tcl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** kb-mode.tcl 29 May 2007 00:28:40 -0000 1.1.2.2
--- kb-mode.tcl 31 May 2007 12:23:29 -0000 1.1.2.3
***************
*** 15,24 ****
def Canvas kb-mode_key {x y key iso shift} {
set c [$self widget]
!
! switch -regexp -- $key {
! Up {$@kbcursor move 0 -10}
! Down {$@kbcursor move 0 +10}
! Left {$@kbcursor move -10 0}
! Right {$@kbcursor move +10 0}
default {}
}
--- 15,27 ----
def Canvas kb-mode_key {x y key iso shift} {
set c [$self widget]
! set step [$@kbcursor step]
! switch $key {
! BackSpace {$self delete_selection}
! Up {$@kbcursor move 0 -$step; if {$shift} {$self arrow_key 0 -$step}}
! Down {$@kbcursor move 0 +$step; if {$shift} {$self arrow_key 0 +$step}}
! Left {$@kbcursor move -$step 0; if {$shift} {$self arrow_key -$step 0}}
! Right {$@kbcursor move +$step 0; if {$shift} {$self arrow_key +$step 0}}
! t {$self kbcursor_select}
! Return {$self return_key $x $y $key $iso $shift}
default {}
}
***************
*** 34,63 ****
set @x 200
set @y 200
! set @h 10
! #set c [$@canvas widget]
! #pack configure $c -expand 0 -fill none
}
def Kb_cursor draw {} {
set c [$@canvas widget]
set line1 [list $@x $@y $@x [expr $@y+$@h]]
set line2 [list $@x $@y [expr $@x+3] $@y]
! set line3 [list $@x [expr $@y+$@h] [expr $@x+3] [expr $@y+10]]
$self item LINE1 line $line1 -fill red -width 2
! $self item LINE2 line $line2 -fill red -width 2
! $self item LINE3 line $line3 -fill red -width 2
! set z [$@canvas zoom]
! mset {cx1 cy1 cx2 cy2} [$@canvas get_bbox]
! mset {l r} [$c xview]
! mset {t b} [$c yview]
! set width [winfo width $c]; set height [winfo height $c]
! set w [expr (1 / ($r - $l)) * $width]
! set h [expr (1 / ($b - $t)) * $height]
! set x1 [expr floor(($w*$l+$cx1)/$z)+7]
! set y1 [expr floor(($h*$t+$cy1)/$z)+7]
! set x2 [expr $x1+$width-21]
! set y2 [expr $height+$y1-21]
! #$self item BOUND rect [list $x1 $y1 $x2 $y2] -outline red -width 1
}
--- 37,57 ----
set @x 200
set @y 200
! set @h [expr [font metrics [$self look font] -linespace]+3]
! set @step [expr ceil($@h*1.5)]
}
+ def Kb_cursor xy {} {return [list [expr $@x+4] $@y]}
+ def Kb_cursor step {} {return $@step}
+
def Kb_cursor draw {} {
set c [$@canvas widget]
set line1 [list $@x $@y $@x [expr $@y+$@h]]
set line2 [list $@x $@y [expr $@x+3] $@y]
! set line3 [list $@x [expr $@y+$@h-1] [expr $@x+3] [expr $@y+$@h-1]]
$self item LINE1 line $line1 -fill red -width 2
! $self item LINE2 line $line2 -fill red -width 1
! $self item LINE3 line $line3 -fill red -width 1
! $c raise $self
}
***************
*** 65,69 ****
set @x [expr $@x + $x]
set @y [expr $@y + $y]
- #$self scroll_canvas
$self test_bounds
$self draw
--- 59,62 ----
***************
*** 75,79 ****
puts "xview [$c xview]"
set x2 [expr $x2]; set y2 [expr $y2]
- #$c configure -scrollregion [list $x1 $y1 $x2 $y2]
}
--- 68,71 ----
***************
*** 84,91 ****
set x2 [expr $x1+$width-2]
set y2 [expr $y1+$height-2]
- #puts "----------------------------------------"
- #puts "width :: $width || height :: $height"
- #puts "x1 $x1 || y1 $y1 || x2 $x2 || y2 $y2"
- #puts "x :: $@x || y ::$@y"
if {$@x >= $x2} {$self scroll r [expr int($@x-$x2)]}
if {$@x <= $x1} {$self scroll l [expr int($@x-$x1)]}
--- 76,79 ----
***************
*** 123,124 ****
--- 111,127 ----
$self draw
}
+
+ def Canvas kbcursor_Object {} {mset {x y} [$@kbcursor xy]; $self new_objectxy $x $y obj}
+ def Canvas kbcursor_Message {} {mset {x y} [$@kbcursor xy]; $self new_objectxy $x $y msg}
+ def Canvas kbcursor_bng {} {mset {x y} [$@kbcursor xy]; $self new_objectxy $x $y obj bng}
+ def Canvas kbcursor_tgl {} {mset {x y} [$@kbcursor xy]; $self new_objectxy $x $y obj tgl}
+ def Canvas kbcursor_nbx {} {mset {x y} [$@kbcursor xy]; $self new_objectxy $x $y obj nbx}
+
+ def Canvas kbcursor_select {} {
+ mset {x y} [lmap + [$@kbcursor xy] 4]
+ mset {type id detail} [$self identify_target $x $y 0]
+ puts "type:: $type || id:: $id || detail:: $detail"
+ if {$type == "object"} {
+ if {![$id selected?]} {$self selection+= $id} else {$self selection-= $id}
+ }
+ }
\ No newline at end of file
More information about the Pd-cvs
mailing list