Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Updated to require Tcl/Tk 8.4. Changed version to 2.0a1. Fixed a few bugs introduced by multiple windows in row popup menus and row zooming. Some pad polishing of DirDiff window. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4e6b144ed324d2ca95a9d2f2507b77ba |
User & Date: | peter 2003-09-28 13:55:44.000 |
Context
2003-12-05
| ||
20:47 | Made search for tmp dir more robust. Moved Merge to Tools menu. Some support for ClearCase. Made dirdiff more robust, including an dark gray invalid marker. check-in: 7d209f7c33 user: peter tags: trunk | |
2003-09-28
| ||
13:55 | Updated to require Tcl/Tk 8.4. Changed version to 2.0a1. Fixed a few bugs introduced by multiple windows in row popup menus and row zooming. Some pad polishing of DirDiff window. check-in: 4e6b144ed3 user: peter tags: trunk | |
2003-09-26
| ||
21:02 | Better emacs locate. Added "Setup registry" dialog. Fixed tab-sequence in dirdiff window. Added -clip command line parameter. check-in: 25aae51c1c user: peter tags: trunk | |
Changes
Changes to src/eskil.tcl.
︙ | ︙ | |||
12 13 14 15 16 17 18 | #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- # the next line restarts using wish \ exec wish "$0" "$@" package provide app-diff 1.0 | | | | < | < | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #---------------------------------------------------------------------- # $Revision$ #---------------------------------------------------------------------- # the next line restarts using wish \ exec wish "$0" "$@" package provide app-diff 1.0 package require Tcl 8.4 package require Tk 8.4 catch {package require textSearch} if {[catch {package require psballoon}]} { # Add a dummy if it does not exists. proc addBalloon {args} {} } else { namespace import -force psballoon::addBalloon } set debug 1 set diffver "Version 2.0a1 2003-09-28" set thisScript [file join [pwd] [info script]] set thisDir [file dirname $thisScript] # Follow any link set tmplink $thisScript while {[file type $tmplink] == "link"} { set tmplink [file readlink $tmplink] set tmplink [file normalize [file join $thisDir $tmplink]] set thisDir [file dirname $tmplink] } unset tmplink set ::util(cvsExists) [expr {![string equal [auto_execok cvs] ""]}] set ::util(diffexe) diff set ::util(diffWrapped) 0 |
︙ | ︙ | |||
109 110 111 112 113 114 115 | if {$::tcl_platform(platform) == "unix"} { set util(editor) emacs } else { set util(editor) wordpad foreach dir [lsort -decreasing -dictionary \ [glob -nocomplain c:/apps/emacs*]] { set em [file join $dir bin runemacs.exe] | < | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | if {$::tcl_platform(platform) == "unix"} { set util(editor) emacs } else { set util(editor) wordpad foreach dir [lsort -decreasing -dictionary \ [glob -nocomplain c:/apps/emacs*]] { set em [file join $dir bin runemacs.exe] set em [file normalize $em] if {[file exists $em]} { set util(editor) $em break } } } } |
︙ | ︙ | |||
2698 2699 2700 2701 2702 2703 2704 | proc rowPopup {w X Y x y} { set top [winfo toplevel $w] if {[info exists ::diff($top,nopopup)] && $::diff($top,nopopup)} return destroy .lpm menu .lpm | | | 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 | proc rowPopup {w X Y x y} { set top [winfo toplevel $w] if {[info exists ::diff($top,nopopup)] && $::diff($top,nopopup)} return destroy .lpm menu .lpm regexp {(\d+)\D*$} $w -> n if {[alignMenu .lpm $top $n $x $y]} { return } set ::diff($top,nopopup) 1 tk_popup .lpm $X $Y after idle [list after 1 [list set ::diff($top,nopopup) 0]] |
︙ | ︙ | |||
2727 2728 2729 2730 2731 2732 2733 | set top [winfo toplevel $w] # Get the row that was clicked set index [$w index @$x,$y] set row [lindex [split $index "."] 0] # Check if it is selected if {[lsearch [$w tag names $index] sel] >= 0} { | | | 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 | set top [winfo toplevel $w] # Get the row that was clicked set index [$w index @$x,$y] set row [lindex [split $index "."] 0] # Check if it is selected if {[lsearch [$w tag names $index] sel] >= 0} { regexp {(\d+)\D*$} $w -> n hlPopup $top $n "" $X $Y $x $y return } # Extract the data set data(1) [$::diff($top,wDiff1) dump -tag -text $row.0 $row.end] set data(2) [$::diff($top,wDiff2) dump -tag -text $row.0 $row.end] |
︙ | ︙ | |||
2782 2783 2784 2785 2786 2787 2788 | } # Let geometry requests propagate update idletasks # Is the balloon within the diff window? set wid [winfo reqwidth $top.balloon] | | | | | | | | | 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 | } # Let geometry requests propagate update idletasks # Is the balloon within the diff window? set wid [winfo reqwidth $top.balloon] if {$wid + $wx > [winfo rootx $top] + [winfo width $top]} { # No. # Center on diff window set wx [expr {([winfo width $top] - $wid) / 2 + [winfo rootx $top]}] if {$wx < 0} {set wx 0} # Is the balloon not within the screen? if {$wx + $wid > [winfo screenwidth $top]} { # Center in screen set wx [expr {([winfo screenwidth $top] - $wid) / 2}] if {$wx < 0} {set wx 0} } } # Does the balloon fit within the screen? if {$wid > [winfo screenwidth $top]} { # How many rows does it take? set rows [expr {ceil(double($wid) / [winfo screenwidth $top])}] # Add rows and fill screen width $top.balloon.t1 configure -height $rows $top.balloon.t2 configure -height $rows # Let geometry requests propagate update idletasks wm geometry $top.balloon \ [winfo screenwidth $top]x[winfo reqheight $top.balloon] set wx 0 } wm geometry $top.balloon +$wx+$wy wm deiconify $top.balloon } proc unzoomRow {w} { |
︙ | ︙ | |||
2939 2940 2941 2942 2943 2944 2945 | set font [$w cget -font] destroy $w entry $w -relief flat -bd 0 -highlightthickness 0 \ -foreground $fg -background $bg -font $font eval $w configure $args | | < < < | 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 | set font [$w cget -font] destroy $w entry $w -relief flat -bd 0 -highlightthickness 0 \ -foreground $fg -background $bg -font $font eval $w configure $args $w configure -takefocus 0 -state readonly -readonlybackground $bg set i [lsearch $args -textvariable] if {$i >= 0} { set var [lindex $args [expr {$i + 1}]] uplevel \#0 "trace variable $var w \ {after idle {$w xview end} ;#}" } |
︙ | ︙ | |||
3290 3291 3292 3293 3294 3295 3296 | -command [list makeDiffWin $top] $top.md.m add separator $top.md.m add command -label "Normal Cursor" \ -command [list normalCursor $top] $top.md.m add separator $top.md.m add command -label "Evalstats" -command {evalstats} $top.md.m add command -label "_stats" -command {parray _stats} | | | | 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 | -command [list makeDiffWin $top] $top.md.m add separator $top.md.m add command -label "Normal Cursor" \ -command [list normalCursor $top] $top.md.m add separator $top.md.m add command -label "Evalstats" -command {evalstats} $top.md.m add command -label "_stats" -command {parray _stats} $top.md.m add command -label "Nuisance" -command [list makeNuisance \ $top "It looks like you are trying out the debug menu."] pack $top.md -in $top.f -side left -padx 20 -anchor n } initDiffData $top } # Set new preferences. |
︙ | ︙ | |||
3494 3495 3496 3497 3498 3499 3500 | exampleFont $lb } ##################################### # Registry section ##################################### | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 | exampleFont $lb } ##################################### # Registry section ##################################### proc makeRegistryFrame {w label key newvalue} { set old {} catch {set old [registry get $key {}]} set l [labelframe $w -text $label -padx 4 -pady 4] label $l.key1 -text "Key:" label $l.key2 -text $key label $l.old1 -text "Old value:" label $l.old2 -text $old label $l.new1 -text "New value:" label $l.new2 -text $newvalue |
︙ | ︙ | |||
3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 | grid $l.new1 $l.new2 -sticky w -padx 4 -pady 4 grid $l.change - -sticky e -padx 4 -pady 4 grid columnconfigure $l 1 -weight 1 } proc makeRegistryWin {} { global thisDir thisScript util set top .reg destroy $top toplevel $top wm title $top "Register Diff" # Registry keys #set keyg {HKEY_CLASSES_ROOT\Folder\shell\Grep\command} set keydd {HKEY_CLASSES_ROOT\Folder\shell\Diff\command} set keyd {HKEY_CLASSES_ROOT\*\shell\Diff\command} set keyc {HKEY_CLASSES_ROOT\*\shell\DiffC\command} set keye {HKEY_CLASSES_ROOT\*\shell\Emacs\command} | > > > > > > > > > > > > > > > < < < | 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 | grid $l.new1 $l.new2 -sticky w -padx 4 -pady 4 grid $l.change - -sticky e -padx 4 -pady 4 grid columnconfigure $l 1 -weight 1 } proc makeRegistryWin {} { global thisDir thisScript util # Locate executable for this program set exe [info nameofexecutable] if {[regexp {^(.*wish)\d+\.exe$} $exe -> pre]} { set alt $pre.exe if {[file exists $alt]} { set a [tk_messageBox -icon question -title "Which Wish" -message \ "Would you prefer to use the executable\n\ \"$alt\"\ninstead of\n\ \"$exe\"\nin the registry settings?" -type yesno] if {$a == "yes"} { set exe $alt } } } set top .reg destroy $top toplevel $top wm title $top "Register Diff" # Registry keys #set keyg {HKEY_CLASSES_ROOT\Folder\shell\Grep\command} set keydd {HKEY_CLASSES_ROOT\Folder\shell\Diff\command} set keyd {HKEY_CLASSES_ROOT\*\shell\Diff\command} set keyc {HKEY_CLASSES_ROOT\*\shell\DiffC\command} set keye {HKEY_CLASSES_ROOT\*\shell\Emacs\command} # Are we in a starkit? if {[info exists ::starkit::topdir]} { # In a starpack ? set exe [file normalize $exe] if {[string equal [file normalize $::starkit::topdir] $exe]} { set myexe [list $exe] } else { |
︙ | ︙ | |||
4178 4179 4180 4181 4182 4183 4184 | -onvalue show -offvalue hide -command {console $consolestate} $top.md.m add separator } $top.md.m add command -label "Reread Source" -underline 0 \ -command {source $thisScript} $top.md.m add separator $top.md.m add command -label "Redraw Window" -command {makeDirDiffWin 1} | | | | > | | > | | > | > | > | 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 | -onvalue show -offvalue hide -command {console $consolestate} $top.md.m add separator } $top.md.m add command -label "Reread Source" -underline 0 \ -command {source $thisScript} $top.md.m add separator $top.md.m add command -label "Redraw Window" -command {makeDirDiffWin 1} pack $top.md -in $top.fm -side left -padx 20 -anchor n } button $top.bu -text "Up Both" -command upDir -underline 0 -padx 10 bind $top <Alt-u> "$top.bu invoke" button $top.bc -text "Compare" -command doCompare -underline 0 -padx 10 bind $top <Alt-c> "$top.bc invoke" pack $top.bc $top.bu -in $top.fm -side right pack $top.bu -padx 6 catch {font delete myfont} font create myfont -family $Pref(fontfamily) -size $Pref(fontsize) entry $top.e1 -textvariable dirdiff(leftDir) button $top.bu1 -text "Up" -padx 10 -command {upDir 1} button $top.bb1 -text "Browse" -padx 10 \ -command {browseDir dirdiff(leftDir)} entry $top.e2 -textvariable dirdiff(rightDir) button $top.bu2 -text "Up" -padx 10 -command {upDir 2} button $top.bb2 -text "Browse" -padx 10 \ -command {browseDir dirdiff(rightDir)} bind $top.e1 <Return> doCompare bind $top.e2 <Return> doCompare pack $top.bb1 $top.bu1 -in $top.fe1 -side right -pady 1 pack $top.bu1 -padx 6 pack $top.e1 -in $top.fe1 -side left -fill x -expand 1 pack $top.bb2 $top.bu2 -in $top.fe2 -side right -pady 1 pack $top.bu2 -padx 6 pack $top.e2 -in $top.fe2 -side left -fill x -expand 1 text $top.t1 -height 40 -width 60 -wrap none -font myfont \ -xscrollcommand "$top.sbx1 set" -takefocus 0 scrollbar $top.sby -orient vertical scrollbar $top.sbx1 -orient horizontal -command "$top.t1 xview" text $top.t2 -height 40 -width 60 -wrap none -font myfont \ |
︙ | ︙ | |||
4327 4328 4329 4330 4331 4332 4333 | grid columnconfigure $top {0 1} -weight 1 } ##################################### # Help and startup functions ##################################### | | | | | | | | | | | | | | | | | > | | | 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 | grid columnconfigure $top {0 1} -weight 1 } ##################################### # Help and startup functions ##################################### proc makeNuisance {top {str {Hi there!}}} { global thisDir if {[lsearch [image names] nuisance] < 0} { set file [file join $thisDir Nuisance.gif] if {![file exists $file]} return image create photo nuisance -file $file } destroy $top.nui toplevel $top.nui wm transient $top.nui $top wm geometry $top.nui +400+400 wm title $top.nui "" label $top.nui.l -image nuisance pack $top.nui.l wm protocol $top.nui WM_DELETE_WINDOW [list destroy $top.nui2 $top.nui] update destroy $top.nui2 toplevel $top.nui2 -bg yellow wm transient $top.nui2 $top.nui wm overrideredirect $top.nui2 1 wm title $top.nui2 "" label $top.nui2.l -text "$str\nDo you want help?" -justify left -bg yellow button $top.nui2.b -text "No, get out of my face!" \ -command [list destroy $top.nui2 $top.nui] -bg yellow pack $top.nui2.l $top.nui2.b -side top -fill x wm geometry $top.nui2 +[expr {405 + [winfo width $top.nui]}]+400 } proc helpWin {w title} { destroy $w toplevel $w wm title $w $title |
︙ | ︙ | |||
4594 4595 4596 4597 4598 4599 4600 | set nextArg revision } elseif {[string range $arg 0 1] == "-r"} { set opts(doptrev$revNo) [string range $arg 2 end] incr revNo } elseif {[string range $arg 0 0] == "-"} { append opts(dopt) " $arg" } else { | | | | | 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 | set nextArg revision } elseif {[string range $arg 0 1] == "-r"} { set opts(doptrev$revNo) [string range $arg 2 end] incr revNo } elseif {[string range $arg 0 0] == "-"} { append opts(dopt) " $arg" } else { set apa [file normalize [file join [pwd] $arg]] if {![file exists $apa]} { puts "Ignoring argument: $arg" } else { lappend files $apa } } } # Do we start in clip diff mode? if {$doclip} { makeClipDiffWin |
︙ | ︙ |