Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17424
Modified Files: Tag: desiredata desire.tk defaults.ddrc Log Message: auto scrollbar show/hide
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.58 retrieving revision 1.1.2.600.2.59 diff -C2 -d -r1.1.2.600.2.58 -r1.1.2.600.2.59 *** desire.tk 11 Dec 2006 02:18:42 -0000 1.1.2.600.2.58 --- desire.tk 11 Dec 2006 03:38:21 -0000 1.1.2.600.2.59 *************** *** 1632,1635 **** --- 1632,1636 ---- set win .$self set c [$self widget] + if {[winfo exists $win.yscroll]} {return} set size [$c bbox all] if {$size != ""} { *************** *** 1647,1650 **** --- 1648,1652 ---- set win .$self set c [$self widget] + if {![winfo exists $win.yscroll]} {return} destroy $win.yscroll destroy $win.xscroll *************** *** 1655,1658 **** --- 1657,1661 ---- set c [$self widget] set size [$c bbox all] + if {[$self look scrollbar]} {$self auto_scrollbars} if {$size != ""} { mset {xmin ymin xmax ymax} {0 0 100 100} *************** *** 1668,1671 **** --- 1671,1690 ---- }
+ def Canvas auto_scrollbars {} { + set win .$self + set c [$self widget] + mset {l r} [$c xview] + mset {t b} [$c yview] + mset {w h} [$c bbox all] + set w2 [winfo width $c] + set h2 [winfo height $c] + if {[winfo exists $win.yscroll]} { + if {$l == $r && $t == $b} {$self remove_scrollbars; return} + if {$l == 0 && $r == 1 && $t == 0 && $b == 1} {$self remove_scrollbars; return} + } else { + if {$w > $w2 || $h > $h2} {$self init_scrollbars} + } + } + def Canvas delete_window {} { set wl {} *************** *** 5721,5730 **** mset {l r} [$c xview] mset {t b} [$c yview] ! set w [expr (1 / ($r - $l)) * [winfo width $c]] ! set h [expr (1 / ($b - $t)) * [winfo height $c]] set x1 [expr ($w*$l+$cx1)/$z] set y1 [expr ($h*$t+$cy1)/$z] ! set h1 [list $x1 $y [expr $x1+[winfo width $c]] $y] ! set v1 [list $x $y1 $x [expr [winfo height $c]+$y1]] $self item VHAIR1 line $v1 -fill [$@canvas look crosshair] -width 0.5 -dash {4 4 4 4} $self item HHAIR1 line $h1 -fill [$@canvas look crosshair] -width 0.5 -dash {4 4 4 4} --- 5740,5752 ---- 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 ($w*$l+$cx1)/$z] set y1 [expr ($h*$t+$cy1)/$z] ! set x2 [expr $x1+$width-7] ! set y2 [expr $height+$y1-7] ! set h1 [list $x1 $y $x2 $y] ! set v1 [list $x $y1 $x $y2] $self item VHAIR1 line $v1 -fill [$@canvas look crosshair] -width 0.5 -dash {4 4 4 4} $self item HHAIR1 line $h1 -fill [$@canvas look crosshair] -width 0.5 -dash {4 4 4 4} *************** *** 7022,7025 **** --- 7044,7048 ---- toggle Canvas statusbar toggle Canvas menubar + toggle Canvas scrollbar toggle View tooltip toggle Wire wirearrow
Index: defaults.ddrc =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/defaults.ddrc,v retrieving revision 1.1.2.10.2.5 retrieving revision 1.1.2.10.2.6 diff -C2 -d -r1.1.2.10.2.5 -r1.1.2.10.2.6 *** defaults.ddrc 9 Dec 2006 17:01:11 -0000 1.1.2.10.2.5 --- defaults.ddrc 11 Dec 2006 03:38:23 -0000 1.1.2.10.2.6 *************** *** 17,20 **** --- 17,21 ---- statusbar 1 menubar 1 + scrollbar 0 } Comment {