Eskil

Check-in [462ea1c612]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added zoomrow function.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 462ea1c612c5e41e7d5ecce620db750d8a905e73
User & Date: spjutp 2001-03-13 09:08:18.000
Context
2001-04-26
10:57
Added -print option for script based generation of postscript. check-in: 8e6f2b163b user: spjutp tags: trunk
2001-03-13
09:08
Added zoomrow function. check-in: 462ea1c612 user: spjutp tags: trunk
2001-03-06
13:51
Handle conflict files without conflicts better. check-in: 11fe3c8515 user: spjutp tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/eskil.tcl.
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#                               New -conflict flag to handle merge conflicts.
#
#-----------------------------------------------
# the next line restarts using wish \
exec wish "$0" "$@"

set debug 1
set diffver "Version 1.8.1  001128"
set tmpcnt 0
set tmpfiles {}
set thisscript [file join [pwd] [info script]]
set thisdir [file dirname $thisscript]

if {$tcl_platform(platform) == "windows"} {
    cd $thisdir







|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#                               New -conflict flag to handle merge conflicts.
#
#-----------------------------------------------
# the next line restarts using wish \
exec wish "$0" "$@"

set debug 1
set diffver "Version 1.8.2  2001-03-13"
set tmpcnt 0
set tmpfiles {}
set thisscript [file join [pwd] [info script]]
set thisdir [file dirname $thisscript]

if {$tcl_platform(platform) == "windows"} {
    cd $thisdir
1888
1889
1890
1891
1892
1893
1894
































































































1895
1896
1897
1898
1899
1900
1901
    grid .pr.b2 -sticky e

}

#####################################
# GUI stuff
#####################################

































































































# Procedures for common y-scroll
proc my_yview args {
    foreach w {.ft1.tl .ft1.tt .ft2.tl .ft2.tt} {
        eval $w yview $args
    }
}







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
    grid .pr.b2 -sticky e

}

#####################################
# GUI stuff
#####################################

proc zoomRow {w X Y x y} {
    global Pref
    # Find out row
    set index [$w index @$x,$y]
    set row [lindex [split $index "."] 0]

    set data1 [.ft1.tt dump -tag -text $row.0 $row.end]
    set data2 [.ft2.tt dump -tag -text $row.0 $row.end]
    set font [.ft1.tt cget -font]
    set wx $X
    set wy [expr {$Y + 4}]

    destroy .balloon
    toplevel .balloon -bg black
    wm iconify .balloon
    wm overrideredirect .balloon 1
    
    set wid 0
    foreach x {1 2} {
        text .balloon.t$x -relief flat -font $font -bg #ffffaa -fg black \
                -padx 2 -pady 0 -height 1 -wrap word
        .balloon.t$x tag configure new1 -foreground $Pref(colornew1) \
                -background $Pref(bgnew1)
        .balloon.t$x tag configure change -foreground $Pref(colorchange) \
                -background $Pref(bgchange)
        .balloon.t$x tag configure new2 -foreground $Pref(colornew2) \
                -background $Pref(bgnew2)
        pack .balloon.t$x -side top -padx 1 -pady 1 -fill both -expand 1
        
        set data [set data$x]
        set tags {}
        foreach {key value index} $data {
            if {$key == "tagon"} {
                lappend tags $value
                set tags [lsort -unique $tags]
            } elseif {$key == "tagoff"} {
                set i [lsearch $tags $value]
                if {$i >= 0} {
                    set tags [lreplace $tags $i $i]
                }
            } else {
                .balloon.t$x insert end $value $tags
            }
        }
        set text [.balloon.t$x get 1.0 1.end]
        regsub -all "\t" $text "        " text
        .balloon.t$x configure -width [string length $text]
    }

    wm geometry .balloon +${wx}+${wy}
    update
    wm withdraw .balloon
    puts "[winfo width .balloon] [winfo rootx .] [winfo width .]"

    # Is the balloon within the diff window?
    set wid [winfo width .balloon]
    if {$wid + $wx > [winfo rootx .] + [winfo width .]} {
        # No.
        # Center on diff window
        set wx [expr {([winfo width .] - $wid) / 2 + [winfo rootx .]}]
        # Is the balloon not within the screen?
        if {$wx + $wid > [winfo screenwidth .]} {
            # Center in screen
            set wx [expr {([winfo screenwidth .] - $wid) / 2}]
        }
        wm geometry .balloon +$wx+$wy
    }
            
    # Does the balloon fit within the screen?
    if {$wid > [winfo screenwidth .]} {
        # Add a row and fill screen width
        .balloon.t1 configure -height 2
        .balloon.t2 configure -height 2
        update idletasks
        wm geometry .balloon \
                [winfo screenwidth .]x[winfo reqheight .balloon]+0+$wy
        set apa {
            set h [.balloon.t1 cget -height]
            incr h
            .balloon.t1 configure -height $h
            .balloon.t2 configure -height $h
            update idletasks
            wm geometry .balloon \
                    [winfo screenwidth .]x[winfo reqheight .balloon]
        }
        bind .balloon <Button-1> $apa
        bind . <Button-1> $apa
    }
    wm deiconify .balloon
}

proc unzoomRow {} {
    destroy .balloon
    bind . <Button-1> ""
}

# Procedures for common y-scroll
proc my_yview args {
    foreach w {.ft1.tl .ft1.tt .ft2.tl .ft2.tt} {
        eval $w yview $args
    }
}
2056
2057
2058
2059
2060
2061
2062




2063
2064
2065
2066
2067
2068
2069
    scrollbar .sbx2 -orient horizontal -command ".ft2.tt xview"
    label .le -textvariable eqLabel -width 1
    canvas .c -width 6 -bd 0 -selectborderwidth 0 -highlightthickness 0

    applyColor
    .ft1.tt tag configure last -underline 1
    .ft2.tt tag configure last -underline 1





    grid .l1 .le - .l2 -row 1 -sticky news
    grid .ft1 .c .sby .ft2 -row 2 -sticky news
    grid .sbx1 x x .sbx2 -row 3 -sticky news
    grid columnconfigure . {0 3} -weight 1
    grid rowconfigure . 2 -weight 1
    grid .c -pady [expr {[.sby cget -width] + 2}]







>
>
>
>







2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
    scrollbar .sbx2 -orient horizontal -command ".ft2.tt xview"
    label .le -textvariable eqLabel -width 1
    canvas .c -width 6 -bd 0 -selectborderwidth 0 -highlightthickness 0

    applyColor
    .ft1.tt tag configure last -underline 1
    .ft2.tt tag configure last -underline 1
    foreach w {.ft1.tt .ft1.tl .ft2.tt .ft2.tl} {
        bind $w <ButtonPress-3> "zoomRow %W %X %Y %x %y"
        bind $w <ButtonRelease-3> "unzoomRow"
    }

    grid .l1 .le - .l2 -row 1 -sticky news
    grid .ft1 .c .sby .ft2 -row 2 -sticky news
    grid .sbx1 x x .sbx2 -row 3 -sticky news
    grid columnconfigure . {0 3} -weight 1
    grid rowconfigure . 2 -weight 1
    grid .c -pady [expr {[.sby cget -width] + 2}]