[PD-cvs] pd/src desire.tk,1.1.2.548,1.1.2.549
chunlee
chunlee at users.sourceforge.net
Wed Nov 15 17:15:47 CET 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
fixes on moving empty objectbox and Canvas tab_jump
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.548
retrieving revision 1.1.2.549
diff -C2 -d -r1.1.2.548 -r1.1.2.549
*** desire.tk 13 Nov 2006 00:29:21 -0000 1.1.2.548
--- desire.tk 15 Nov 2006 16:15:44 -0000 1.1.2.549
***************
*** 1088,1092 ****
def View selected? {} {return $@selected?}
def View selected?= {x} {set @selected? $x; $self changed} ;# only call this from selection= and such
!
def View select {state} {
set ostate [$self selected?]
--- 1088,1092 ----
def View selected? {} {return $@selected?}
def View selected?= {x} {set @selected? $x; $self changed} ;# only call this from selection= and such
! def View edit? {} {if {[info exists @edit]} {return $@edit} else {return 0}}
def View select {state} {
set ostate [$self selected?]
***************
*** 1916,1939 ****
def TextBox draw {} {
! global font leet
! # "TEXT" is the text label while "text" is the the input text field tk widget.
! # the text should be drawn before, so that update_size works at the right time.
! mset {x1 y1} [$self xy]
! if {$@edit} {
! set t [$@canvas widget].${self}text
! #$t configure -width [string length [$t get 1.0 end]]
! #$t configure -width [string length [$t get $@longline.0 $@longline.end]]
! } {
! if {$leet} {
! set text [string map -nocase {a 4 e 3 t 7 s 5 i 1 o 0 g 9} $@text]
! } else {
! set text $@text
! }
! $self item TEXT text [l+ {2 2} [list $x1 $y1]] \
! -font [$self look font] -text $text \
! -fill [$self look fg] -anchor nw
! }
! $self update_size
! super
}
--- 1916,1940 ----
def TextBox draw {} {
! global font leet
! # "TEXT" is the text label while "text" is the the input text field tk widget.
! # the text should be drawn before, so that update_size works at the right time.
! mset {x1 y1} [$self xy]
! if {$@edit} {
! set t [$@canvas widget].${self}text
! puts " t::: $t"
! $self item text window [list [expr $x1+2] [expr $y1+2]] \
! -window $t -anchor nw -tags "${self}text $self text"
! } {
! if {$leet} {
! set text [string map -nocase {a 4 e 3 t 7 s 5 i 1 o 0 g 9} $@text]
! } else {
! set text $@text
! }
! $self item TEXT text [l+ {2 2} [list $x1 $y1]] \
! -font [$self look font] -text $text \
! -fill [$self look fg] -anchor nw
! }
! $self update_size
! super
}
***************
*** 1947,1951 ****
if {[lsearch [$@canvas selection] $self] < 0} {$@canvas selection+= $self}
set t $c.${self}text
! if {[info exists @isnew]} {set @isnew 0}
set @edit 1
set @tab_repeats 0
--- 1948,1952 ----
if {[lsearch [$@canvas selection] $self] < 0} {$@canvas selection+= $self}
set t $c.${self}text
! #if {[info exists @isnew]} {set @isnew 0}
set @edit 1
set @tab_repeats 0
***************
*** 2131,2134 ****
--- 2132,2136 ----
$self draw_io
if {$@isnew} {$self edit} ;# why this here ?
+ # @isnew indicates a object is newly created, and turn it into edit mode here..
}
***************
*** 2173,2176 ****
--- 2175,2179 ----
set t $c.${self}text
if {$accept} {$self setto [$t get 1.0 "end - 1 chars"]}
+ if {[info exists @isnew]} {set @isnew 0}
after 1 "destroy $t"
if {[winfo exists .completion]} {$@action cancel}
***************
*** 3237,3240 ****
--- 3240,3244 ----
$obj position= [$obj backupxy]
$obj moveto $x1 $y1
+ if {[$obj edit?]} {focus [[$obj canvas] widget].${obj}text}
}
set objs $@selection
***************
*** 3277,3281 ****
set olength [llength $@selection]
set wlength [llength $@selection_wire]
! if {$@keynav_tab_sel == "object"} {set @keynav_tab_sel "wire"} else {set @keynav_tab_sel "object"}
switch $@keynav_tab_sel {
object {$self tab_jump_object}
--- 3281,3289 ----
set olength [llength $@selection]
set wlength [llength $@selection_wire]
! if {$@keynav_tab_sel == "object"} {
! if {[llength $@wires]} {set @keynav_tab_sel "wire"}
! } else {
! set @keynav_tab_sel "object"
! }
switch $@keynav_tab_sel {
object {$self tab_jump_object}
***************
*** 3946,3950 ****
# View xy is virtual (for GOP)
def Box moveto {x1 y1} {
! pd .$@canvas object_moveto !$self $x1 $y1
[$@canvas history] add [list $self moveto $@x1 $@y1]
if {[$self class] == "Canvas"} {
--- 3954,3962 ----
# View xy is virtual (for GOP)
def Box moveto {x1 y1} {
! if {[info exists @isnew]} {
!
! } else {
! pd .$@canvas object_moveto !$self $x1 $y1
! }
[$@canvas history] add [list $self moveto $@x1 $@y1]
if {[$self class] == "Canvas"} {
More information about the Pd-cvs
mailing list