diff -aurN tix8.2.0/unix/Makefile.in funkhouser's/patch/Makefile.in --- tix8.2.0/unix/Makefile.in 2001-01-10 23:43:46.000000000 -0800 +++ unix/Makefile.in 2002-10-11 13:58:52.000000000 -0700 @@ -44,6 +44,9 @@ # Directory in which to install libtix.so or libtix.a: LIB_INSTALL_DIR = $(INSTALL_ROOT)$(libdir) +# Directory in which to install tix.h +INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(includedir) + # Path name to use when installing library scripts. SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(TIX_LIBRARY) @@ -584,7 +587,7 @@ -rm -f config.cache config.log stamp-h stamp-h[0-9]* -rm -f config.status -install: install-binaries install-libraries install-doc +install: install-binaries install-libraries install-doc install-headers install-tools install-strip: $(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM) -s" @@ -619,6 +622,17 @@ "Installing $(TIX_EXE_FILE) as $(BIN_INSTALL_DIR)/$(TIX_EXE_FILE)" @$(INSTALL_PROGRAM) $(TIX_EXE_FILE) $(BIN_INSTALL_DIR)/$(TIX_EXE_FILE) +install-headers: + @echo "Installing header files"; + @for i in $(GENERIC_DIR)/tix.h; \ + do \ + $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ + done; + +install-tools: + @echo "installing the tixindex program for building tclIndex for Tix scripts" + @$(INSTALL_DATA) $(TIX_SRC_DIR)/tools/tixindex $(BIN_INSTALL_DIR) + install-libraries: libraries @for i in $(SCRIPT_INSTALL_DIR); \ do \ diff -aurN tix8.2.0/library/HList.tcl haneef's/patch/HList.tcl --- tix8.2.0/library/HList.tcl 2001-01-23 23:28:35.000000000 -0800 +++ library/HList.tcl 2002-10-11 13:57:35.000000000 -0700 @@ -394,6 +394,9 @@ proc tixHList:AutoScan {w} { case [tixHList:GetState $w] { + {10 11} { + tixHList:GoState 11 $w + } {29 30} { tixHList:GoState 30 $w } @@ -491,17 +494,19 @@ tixHList:GoState 0 $w } +# start auto-scanning inside a single/browse widget proc tixHList:GoState-10 {w} { tixHList:StartScan $w } +# repeat auto-scanning inside a single/browse widget proc tixHList:GoState-11 {w} { global tkPriv tixHList:DoScan $w set oldEnt [$w info anchor] - set ent [tixHList:SetAnchor $w $tkPriv(x) $tkPriv(y)] + set ent [tixHList:SetAnchor $w $tkPriv(x) $tkPriv(y) 0 1] if {$ent == "" || $oldEnt == $ent} { return @@ -718,12 +723,18 @@ tixHList:GoState 0 $w } +# ctrl-button-1 has been pressed in extended selection mode proc tixHList:GoState-33 {w x y} { set ent [tixHList:GetNearest $w $y] if {$ent != ""} { $w anchor set $ent - $w selection set $ent - tixHList:Browse $w $ent + if { [lsearch [$w info selection] $ent] >= 0 } { + # toggle + $w selection clear $ent + } else { + $w selection set $ent + tixHList:Browse $w $ent + } } } @@ -745,13 +756,15 @@ return $ent } -proc tixHList:SetAnchor {w x y {disableOK 0}} { +proc tixHList:SetAnchor {w x y {disableOK 0} {dontsee 0}} { set ent [tixHList:GetNearest $w $y $disableOK] if {$ent != ""} { if {[$w entrycget $ent -state] != "disabled"} { $w anchor set $ent - $w see $ent + if {!$dontsee} { + $w see $ent + } return $ent } elseif $disableOK { return $ent @@ -846,3 +859,230 @@ } +#---------------------------------------------------------------------- +# +# Header resizing. Based on Art Morel's work. +# +#---------------------------------------------------------------------- + +bind TixHListHeader { + tixHList:header:setHeaderCursor [winfo parent %W] %W %x %y +} +bind TixHListHeader { + tixHList:header:setHeaderCursor [winfo parent %W] %W %x %y +} +bind TixHListHeader { + tixHList:header:setHeaderCursor [winfo parent %W] %W %x %y +} +bind TixHListHeader <1> { + tixHList:header:mark [winfo parent %W] %x +} +bind TixHListHeader { + tixHList:header:drag [winfo parent %W] %x +} +bind TixHListHeader { + tixHList:header:drag [winfo parent %W] %x +} +bind TixHListHeader { + tixHList:header:drag [winfo parent %W] %x +} +bind TixHListHeader { + tixHList:header:endDrag [winfo parent %W] %x +} + +# tixHList:header:setHeaderCursor -- +# Change the header window's cursor to <-> when it's placed on top +# of the border between two header columns. +# Arguments: +# hlist The HList whose column is being resized. +# header The private header window of the HList. +# x Mouse X location (relative to header window) +# y Mouse Y location (relative to header window) +# Results: +# Returns nothing +# +proc tixHList:header:setHeaderCursor {hlist header x y} { + global tixPriv + + if {$y >= 0 && $y < [winfo height $header] && + [tixHList:header:getColumn $hlist $x] != -1} { + if {![info exists tixPriv(hlist:oldcursor)]} { + set col [tixHList:header:getColumn $hlist $x] + set colx [tixHList:header:getColumnX $hlist $col] + set tixPriv(hlist:col) $col + set tixPriv(hlist:startx) $colx + set tixPriv(hlist:oldcursor) [$hlist cget -cursor] + $hlist config -cursor sb_h_double_arrow + } + } else { + if {[info exists tixPriv(hlist:oldcursor)]} { + $hlist config -cursor $tixPriv(hlist:oldcursor) + unset tixPriv(hlist:oldcursor) + } + } +} + +# tixHList:header:mark -- +# Initialize the header dragging indicator line. +# Arguments: +# hlist The Hlist whose column is being resized. +# x Mouse X location (relative to header window) +# Results: +# Returns nothing +# +proc tixHList:header:mark {hlist x} { + global tixPriv + + if {![info exists tixPriv(hlist:oldcursor)]} { + return + } + + set col [tixHList:header:getColumn $hlist $x] + set colx [tixHList:header:getColumnX $hlist $col] + tixHList:header:drawDragLines set $hlist $colx + + set tixPriv(hlist:startx) $x + set tixPriv(hlist:col) $col +} + +# tixHList:header:drag -- +# Move the header dragging indicator line. +# Arguments: +# hlist The Hlist whose column is being resized. +# x Mouse X location (relative to header window) +# Results: +# Returns nothing +# +proc tixHList:header:drag {hlist x} { + global tixPriv + + if {![info exists tixPriv(hlist:oldcursor)]} { + return + } + + set x [tixHList:header:restrictDrag $hlist $tixPriv(hlist:col) $x] + set delta [expr $x - $tixPriv(hlist:startx)] + set colx [tixHList:header:getColumnX $hlist $tixPriv(hlist:col)] + + tixHList:header:drawDragLines update $hlist [expr $colx + $delta] +} + +# tixHList:header:endDrag -- +# End header dragging and resize the affected column +# Arguments: +# hlist The Hlist whose column is being resized. +# x Mouse X location (relative to header window) +# Results: +# Returns nothing +# +proc tixHList:header:endDrag {hlist x} { + global tixPriv + + if {![info exists tixPriv(hlist:oldcursor)]} { + return + } + tixHList:header:drawDragLines cancel $hlist + + set x [tixHList:header:restrictDrag $hlist $tixPriv(hlist:col) $x] + set width [$hlist column width $tixPriv(hlist:col)] + set delta [expr $x - $tixPriv(hlist:startx)] + set nwidth [expr $delta + $width] + if {$nwidth < 8} { + set nwidth 8 + } + $hlist column width $tixPriv(hlist:col) $nwidth + $hlist config -cursor $tixPriv(hlist:oldcursor) + + unset tixPriv(hlist:startx) + unset tixPriv(hlist:oldcursor) + unset tixPriv(hlist:col) + $hlist config -cursor {} +} + +# Returns the vertical line that divides col and col+1 +proc tixHList:header:getColumnX {hlist col} { + set colx 0 + for {set i 0} {$i <= $col} {incr i} { + incr colx [$hlist column width $i] + } + incr colx -[$hlist xview] + + return $colx +} + +proc tixHList:header:restrictDrag {hlist col x} { + set min [expr [tixHList:header:getColumnX $hlist [expr $col - 1]] + 8] + set max [expr [winfo width $hlist] - [$hlist cget -bd] - 2] + + if {$x < $min} { + set x $min + } + if {$x > $max} { + set x $max + } + + if {$x < 0} { + set x 0 + } + if {$x > [winfo width $hlist]} { + set x [expr [winfo width $hlist] - 1] + } + return $x +} + + +proc tixHList:header:drawDragLines {mode {hlist {}} {x {}}} { + global tixPriv + + if {$mode != "set"} { + if {[info exists tixPriv(hlist:drX)]} { + set oldX $tixPriv(hlist:drX) + set oldY1 $tixPriv(hlist:drY1) + set oldY2 $tixPriv(hlist:drY2) + + tixTmpLine $oldX $oldY1 $oldX $oldY2 $hlist + } + } + + if {$mode == "cancel"} { + catch { + unset tixPriv(hlist:drX) + unset tixPriv(hlist:drY1) + unset tixPriv(hlist:drY2) + } + return + } + + set y1 [$hlist cget -bd] + set y2 [expr [winfo height $hlist] - 2 * $y1] + + incr x [winfo rootx $hlist] + incr y1 [winfo rooty $hlist] + incr y2 [winfo rooty $hlist] + + tixTmpLine $x $y1 $x $y2 $hlist + + set tixPriv(hlist:drX) $x + set tixPriv(hlist:drY1) $y1 + set tixPriv(hlist:drY2) $y2 +} + +# Returns the column which is just to the left of the mouse cursor +proc tixHList:header:getColumn {hlist x} { + set fuzzy 3 + set sum 0 + set max [expr [$hlist cget -columns] - 1] + incr x [$hlist xview] + + for {set col 0} {$col < $max} {incr col} { + set width [$hlist column width $col] + incr sum $width + if {abs($x - $sum) <= $fuzzy} { + return $col + break + } + } + + return -1 +} +