.hframe.t raise $text
incr x [expr 2 * $ox + 17]
}
+ incr x 7
.hframe.t raise "$curcanvas"
.hframe.t itemconfigure "tab && $curcanvas" -fill #e0e0e0
+ .hframe.t configure -scrollregion "0 0 $x 18"
+ update
+ set width [lindex [.hframe.t configure -width] 4]
+ set lborder [lindex [.hframe.t bbox "tab && $curcanvas"] 0]
+ set rborder [lindex [.hframe.t bbox "tab && $curcanvas"] 2]
+ set lmargin [expr [lindex [.hframe.t xview] 0] * $x - 1]
+ set rmargin [expr [lindex [.hframe.t xview] 1] * $x + 1]
+ if { $lborder < $lmargin } {
+ .hframe.t xview moveto [expr 1.0 * ($lborder - 10) / $x]
+ }
+ if { $rborder > $rmargin } {
+ .hframe.t xview moveto [expr 1.0 * ($rborder - $width + 10) / $x]
+ }
redrawAll
return
deleteSelection
set i [lsearch $canvas_list $curcanvas]
set canvas_list [lreplace $canvas_list $i $i]
- switchCanvas prev
+ set curcanvas [lindex $canvas_list $i]
+ if { $curcanvas == "" } {
+ set curcanvas [lindex $canvas_list end]
+ }
+ switchCanvas none
set changed 1
updateUndoLog
}
-xscrollcommand ".hframe.scroll set" \
-yscrollcommand ".vframe.scroll set"]
canvas .hframe.t -width 300 -height 18 -bd 0 -highlightthickness 0 \
- -background gray
+ -background gray \
+ -xscrollcommand ".hframe.ts set"
bind .hframe.t <1> {
set canvas [lindex [.hframe.t gettags current] 1]
if { $canvas != "" && $canvas != $curcanvas } {
-bd 1 -width 14
scrollbar .vframe.scroll -command "$c yview" \
-bd 1 -width 14
-scrollbar .hframe.ts -orient horiz -command "" \
+scrollbar .hframe.ts -orient horiz -command ".hframe.t xview" \
-bd 1 -width 14
pack .hframe.ts .hframe.t -side left -padx 0 -pady 0
pack .hframe.scroll -side left -padx 0 -pady 0 -fill both -expand true