diff options
author | treectrl <treectrl> | 2005-06-04 23:38:22 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2005-06-04 23:38:22 (GMT) |
commit | 184161ed726e304d36ed4c2dad5918eb002b96e2 (patch) | |
tree | 77ff58ff2edfd39c0c3fe4c07b79c28284bcf1db /library | |
parent | f0cab39937e3b0d82741a3893983b9c0feed0057 (diff) | |
download | tktreectrl-184161ed726e304d36ed4c2dad5918eb002b96e2.zip tktreectrl-184161ed726e304d36ed4c2dad5918eb002b96e2.tar.gz tktreectrl-184161ed726e304d36ed4c2dad5918eb002b96e2.tar.bz2 |
Examine -padx and -ipadx of -union elements when calculating max width of the text widget.
Remove the <Scroll> binding from the entry/text widget if they are destroyed.
Diffstat (limited to 'library')
-rw-r--r-- | library/filelist-bindings.tcl | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/library/filelist-bindings.tcl b/library/filelist-bindings.tcl index ea512ec..ed2743a 100644 --- a/library/filelist-bindings.tcl +++ b/library/filelist-bindings.tcl @@ -359,6 +359,19 @@ proc ::TreeCtrl::FileListEdit {T I C S E} { } else { set pade [set padw $padx] } + foreach E2 [$T style elements $S] { + if {[lsearch -exact [$T style layout $S $E2 -union] $E] == -1} continue + foreach option {-padx -ipadx} { + set pad [$T style layout $S $E2 $option] + if {[llength $pad] == 2} { + incr padw [lindex $pad 0] + incr pade [lindex $pad 1] + } else { + incr padw $pad + incr pade $pad + } + } + } TextExpanderOpen $T $I $C $E [expr {$x2 - $x1 - $padw - $pade}] # Single-line edit @@ -592,6 +605,9 @@ proc ::TreeCtrl::EntryExpanderOpen {T item column element} { TreeCtrl::EntryClose %T 0 focus $TreeCtrl::Priv(entry,%T,focus) } + bind $T.entry <Destroy> { + [winfo parent %W] notify bind %W <Scroll> {} + } $T.entry configure -font $font -background [$T cget -background] $T.entry insert end $text @@ -711,6 +727,9 @@ proc ::TreeCtrl::TextOpen {T item column element {width 0} {height 0}} { TreeCtrl::TextClose %T 0 focus $TreeCtrl::Priv(text,%T,focus) } + bind $T.text <Destroy> { + [winfo parent %W] notify bind %W <Scroll> {} + } $T.text tag configure TAG -justify [$T element cget $element -justify] $T.text configure -font $font @@ -791,6 +810,9 @@ proc ::TreeCtrl::TextExpanderOpen {T item column element width} { TreeCtrl::TextClose %T 0 focus $TreeCtrl::Priv(text,%T,focus) } + bind $T.text <Destroy> { + [winfo parent %W] notify bind %W <Scroll> {} + } $T.text tag configure TAG -justify $justify $T.text configure -font $font -background [$T cget -background] @@ -806,10 +828,10 @@ proc ::TreeCtrl::TextExpanderOpen {T item column element width} { "%d %d" width height set tbw [$T.text cget -borderwidth] - set tx [expr {$x1 - $tbw - 1}] - place $T.text -x $tx -y [expr {$y1 - $tbw - 1}] \ - -width [expr {$width + ($tbw + 1) * 2}] \ - -height [expr {$height + ($tbw + 1) * 2}] \ + incr tbw + place $T.text -x [expr {$x1 - $tbw}] -y [expr {$y1 - $tbw}] \ + -width [expr {$width + $tbw * 2}] \ + -height [expr {$height + $tbw * 2}] \ -bordermode outside focus $T.text @@ -855,10 +877,11 @@ proc ::TreeCtrl::TextExpanderKeypress {T} { "%d %d" width height set tbw [$T.text cget -borderwidth] + incr tbw place configure $T.text \ - -x [expr {$center - $width / 2 - $tbw - 1}] \ - -width [expr {$width + ($tbw + 1) * 2}] \ - -height [expr {$height + ($tbw + 1) * 2}] + -x [expr {$center - ($width + $tbw * 2) / 2}] \ + -width [expr {$width + $tbw * 2}] \ + -height [expr {$height + $tbw * 2}] $T.text tag add TAG 1.0 end |