[PD-cvs] pd/src desire.tk,1.1.2.390,1.1.2.391
chunlee
chunlee at users.sourceforge.net
Mon Aug 21 13:20:54 CEST 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31488
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
fixed hide status/button bar bug
fixed completion box coords bug
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.390
retrieving revision 1.1.2.391
diff -C2 -d -r1.1.2.390 -r1.1.2.391
*** desire.tk 21 Aug 2006 03:16:25 -0000 1.1.2.390
--- desire.tk 21 Aug 2006 11:20:52 -0000 1.1.2.391
***************
*** 1366,1372 ****
set c .$self.c
toplevel $win -menu $win.m
# turn buttonbar on/off
if {$bar(buttonbar)} {
! if {[catch {pack [[ButtonBar new $self] widget] -side top -fill x -expand no}]} {
global errorInfo
post "Can't show ButtonBar: %s" $errorInfo
--- 1366,1373 ----
set c .$self.c
toplevel $win -menu $win.m
+ set butts [[ButtonBar new $self] widget]
# turn buttonbar on/off
if {$bar(buttonbar)} {
! if {[catch {pack $butts -side top -fill x -expand no}]} {
global errorInfo
post "Can't show ButtonBar: %s" $errorInfo
***************
*** 1500,1504 ****
set x1 [expr $x/$@scale]
set y1 [expr $y/$@scale]
! pd .$self $sel $x1 $y1
}
--- 1501,1505 ----
set x1 [expr $x/$@scale]
set y1 [expr $y/$@scale]
! pd .$self $sel $x $y
}
***************
*** 1627,1633 ****
def TextBox text {} {return $text}
! def TextBox draw {} {
global font
! $self update_size
# "TEXT" is the text label while "text" is the the input text field tk widget
super
--- 1628,1634 ----
def TextBox text {} {return $text}
! def* TextBox draw {} {
global font
! #$self update_size
# "TEXT" is the text label while "text" is the the input text field tk widget
super
***************
*** 1677,1681 ****
}
! def TextBox key {widget x y key iso shift} {
after 0 "$self after_key $widget"
switch -- $key {
--- 1678,1682 ----
}
! def* TextBox key {widget x y key iso shift} {
after 0 "$self after_key $widget"
switch -- $key {
***************
*** 1687,1699 ****
def TextBox after_key {widget} {
$widget configure -state normal
$self update_size
$self changed
}
! def TextBox update_size {{n -1}} {
global font
set n [string length $@text]
catch {set n [string length [.$@canvas.c.${self}text get 1.0 1.end]]}
set textwidth [expr $font(padx)+$font(width)*($n+$@edit)]
set topwidth [expr (2* $@ninlets-1) * [look iowidth]]
set bottomwidth [expr (2*$@noutlets-1) * [look iowidth]]
--- 1688,1702 ----
def TextBox after_key {widget} {
$widget configure -state normal
+ #set @text [$widget get 1.0 1.end]
$self update_size
$self changed
}
! def* TextBox update_size {{n -1}} {
global font
set n [string length $@text]
catch {set n [string length [.$@canvas.c.${self}text get 1.0 1.end]]}
set textwidth [expr $font(padx)+$font(width)*($n+$@edit)]
+ #set textwidth [expr $font(padx)+$font(width)*([string length $@text]+$@edit)]
set topwidth [expr (2* $@ninlets-1) * [look iowidth]]
set bottomwidth [expr (2*$@noutlets-1) * [look iowidth]]
***************
*** 1702,1705 ****
--- 1705,1719 ----
}
+ def* TextBox update_size2 {} {
+ global font
+ set @textwidth [expr $font(padx)+$font(width)*([string length $@text]+$@edit)]
+ set @topwidth [expr (2* $@ninlets-1) * [look iowidth]]
+ set @bottomwidth [expr (2*$@noutlets-1) * [look iowidth]]
+ set @xs [max [look minobjwidth] [max $@bottomwidth [max $@topwidth $@textwidth]]]
+ set @ys [expr $font(pady)+$font(height)]
+ }
+
+
+
#-----------------------------------------------------------------------------------
***************
*** 1748,1752 ****
}
! def ObjectBox draw_box {} {
global font
super
--- 1762,1766 ----
}
! def* ObjectBox draw_box {} {
global font
super
***************
*** 1760,1764 ****
}
! def ObjectBox draw {} {
super
$self draw_io
--- 1774,1779 ----
}
! def* ObjectBox draw {} {
! $self update_size
super
$self draw_io
***************
*** 4427,4430 ****
--- 4442,4447 ----
set v1 [list $x $y1 $x [expr $y + ($height +$yoff)]]
set h1 [list $x1 $y [expr $x + ($width +$xoff)] $y]
+ #set v1 [list $x $y1 $x $vy2]
+ #set h1 [list $x1 $y $vx2 $y]
$self item VHAIR1 line $v1 -fill [look selectframe] -width 0.5 -dash {4 4 4 4}
$self item HHAIR1 line $h1 -fill [look selectframe] -width 0.5 -dash {4 4 4 4}
***************
*** 4633,4642 ****
set textself [string range $textself 0 [expr $cut -1]]
}
! mset {x1 y1 x2 y2} [$textself bbox]
if {[look showcomp] <= 20} {
set @height [look showcomp]} else {set @height 20}
listbox $f -width $@width -height $@height -relief flat \
-bg [look canvasbgedit] -selectbackground [complement [look objectfg]] \
! -activestyle dotbox -selectforeground [look objectfg] -fg [look objectfg]
$self fill_box [$@textbox get 1.0 1.end]
$f configure -width $@width
--- 4650,4662 ----
set textself [string range $textself 0 [expr $cut -1]]
}
! #mset {x1 y1 x2 y2} [$textself bbox]
! mset {x1 y1 x2 y2} [lmap * [$textself bbox] [$@name scale]]
! set x1 [format %0.f $x1];set y1 [format %0.f $y1]
! set x2 [format %0.f $x2];set y2 [format %0.f $y2]
if {[look showcomp] <= 20} {
set @height [look showcomp]} else {set @height 20}
listbox $f -width $@width -height $@height -relief flat \
-bg [look canvasbgedit] -selectbackground [complement [look objectfg]] \
! -activestyle dotbox -selectforeground [look objectfg] -fg [complement [look canvasbgedit]]
$self fill_box [$@textbox get 1.0 1.end]
$f configure -width $@width
More information about the Pd-cvs
mailing list