524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
|
wm title $top "Eskil Dir"
wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top]
frame $top.fm
frame $top.fe1
frame $top.fe2
menubutton $top.mf -menu $top.mf.m -text "File" -underline 0
menu $top.mf.m
$top.mf.m add command -label "Close" -underline 0 \
-command [list cleanupAndExit $top]
$top.mf.m add separator
$top.mf.m add command -label "Quit" -underline 0 \
-command [list cleanupAndExit all]
menubutton $top.mo -menu $top.mo.m -text "Preferences" -underline 0
menu $top.mo.m
$top.mo.m add checkbutton -variable Pref(recursive) -label "Recursive"
$top.mo.m add cascade -label "Check" -menu $top.mo.mc
$top.mo.m add checkbutton -variable Pref(dir,onlydiffs) -label "Diffs Only"
$top.mo.m add checkbutton -variable Pref(nodir) -label "No Directory"
$top.mo.m add checkbutton -variable Pref(autocompare) -label "Auto Compare"
menu $top.mo.mc
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 0 \
-label "Do not check contents"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 1 \
-label "Internal compare"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 1b \
-label "Internal compare (bin)"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 2 \
-label "Use Diff"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 3 \
-label "Diff, ignore blanks"
$top.mo.mc add radiobutton -variable Pref(comparelevel) -value 4 \
-label "Diff, ignore case"
$top.mo.mc add checkbutton -variable Pref(dir,ignorekey) \
-label "Ignore \$Keyword:\$"
menubutton $top.mt -text "Tools" -underline 0 -menu $top.mt.m
menu $top.mt.m
$top.mt.m add command -label "New Diff Window" -underline 0 \
-command makeDiffWin
$top.mt.m add command -label "Clip Diff" -underline 0 \
-command makeClipDiffWin
if {$::tcl_platform(platform) eq "windows"} {
if {![catch {package require registry}]} {
$top.mt.m add separator
$top.mt.m add command -label "Setup Registry" -underline 6 \
-command makeRegistryWin
}
}
menubutton $top.mh -text "Help" -underline 0 -menu $top.mh.m
menu $top.mh.m
#$top.mh.m add command -label "Help" -command makeHelpWin -underline 0
$top.mh.m add command -label "Tutorial" -command makeTutorialWin \
-underline 0
$top.mh.m add command -label "About" -command makeAboutWin -underline 0
pack $top.mf $top.mo $top.mt $top.mh -in $top.fm -side left -anchor n
if {$::debug} {
menubutton $top.md -text "Debug" -menu $top.md.m -underline 0
menu $top.md.m
if {$::tcl_platform(platform) eq "windows"} {
$top.md.m add checkbutton -label "Console" -variable consolestate \
-onvalue show -offvalue hide -command {console $consolestate}
$top.md.m add separator
}
$top.md.m add command -label "Reread Source" -underline 0 \
-command {EskilRereadSource}
$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 doDirCompare -underline 0 -padx 10
bind $top <Alt-c> "$top.bc invoke"
pack $top.bc $top.bu -in $top.fm -side right
|
>
>
|
>
|
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
|
|
<
<
|
|
|
|
|
|
|
<
|
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
|
wm title $top "Eskil Dir"
wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top]
frame $top.fm
frame $top.fe1
frame $top.fe2
menu $top.m
$top configure -menu $top.m
$top.m add cascade -menu $top.m.mf -label "File" -underline 0
menu $top.m.mf
$top.m.mf add command -label "Compare" -underline 1 \
-command doDirCompare
$top.m.mf add separator
$top.m.mf add command -label "Close" -underline 0 \
-command [list cleanupAndExit $top]
$top.m.mf add separator
$top.m.mf add command -label "Quit" -underline 0 \
-command [list cleanupAndExit all]
$top.m add cascade -menu $top.m.mo -label "Preferences" -underline 0
menu $top.m.mo
$top.m.mo add checkbutton -variable Pref(recursive) -label "Recursive"
$top.m.mo add cascade -label "Check" -menu $top.m.mo.mc
$top.m.mo add checkbutton -variable Pref(dir,onlydiffs) -label "Diffs Only"
$top.m.mo add checkbutton -variable Pref(nodir) -label "No Directory"
$top.m.mo add checkbutton -variable Pref(autocompare) -label "Auto Compare"
menu $top.m.mo.mc
$top.m.mo.mc add radiobutton -variable Pref(comparelevel) -value 0 \
-label "Do not check contents"
$top.m.mo.mc add radiobutton -variable Pref(comparelevel) -value 1 \
-label "Internal compare"
$top.m.mo.mc add radiobutton -variable Pref(comparelevel) -value 1b \
-label "Internal compare (bin)"
$top.m.mo.mc add radiobutton -variable Pref(comparelevel) -value 2 \
-label "Use Diff"
$top.m.mo.mc add radiobutton -variable Pref(comparelevel) -value 3 \
-label "Diff, ignore blanks"
$top.m.mo.mc add radiobutton -variable Pref(comparelevel) -value 4 \
-label "Diff, ignore case"
$top.m.mo.mc add checkbutton -variable Pref(dir,ignorekey) \
-label "Ignore \$Keyword:\$"
$top.m add cascade -label "Tools" -underline 0 -menu $top.m.mt
menu $top.m.mt
$top.m.mt add command -label "New Diff Window" -underline 0 \
-command makeDiffWin
$top.m.mt add command -label "Clip Diff" -underline 0 \
-command makeClipDiffWin
if {$::tcl_platform(platform) eq "windows"} {
if {![catch {package require registry}]} {
$top.m.mt add separator
$top.m.mt add command -label "Setup Registry" -underline 6 \
-command makeRegistryWin
}
}
$top.m add cascade -label "Help" -underline 0 -menu $top.m.help
menu $top.m.help
$top.m.help add command -label "Tutorial" -command makeTutorialWin \
-underline 0
$top.m.help add command -label "About" -command makeAboutWin -underline 0
if {$::debug} {
$top.m add cascade -label "Debug" -menu $top.m.md -underline 0
menu $top.m.md
if {$::tcl_platform(platform) eq "windows"} {
$top.m.md add checkbutton -label "Console" -variable consolestate \
-onvalue show -offvalue hide -command {console $consolestate}
$top.m.md add separator
}
$top.m.md add command -label "Reread Source" -underline 0 \
-command {EskilRereadSource}
$top.m.md add separator
$top.m.md add command -label "Redraw Window" -command {makeDirDiffWin 1}
}
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 doDirCompare -underline 0 -padx 10
bind $top <Alt-c> "$top.bc invoke"
pack $top.bc $top.bu -in $top.fm -side right
|
658
659
660
661
662
663
664
|
grid $top.sbx1 x x $top.sbx2 -sticky we
grid $map -pady [expr {[$top.sby cget -width] + 2}]
grid rowconfigure $top 2 -weight 1
grid columnconfigure $top {0 3} -weight 1
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
|
grid $top.sbx1 x x $top.sbx2 -sticky we
grid $map -pady [expr {[$top.sby cget -width] + 2}]
grid rowconfigure $top 2 -weight 1
grid columnconfigure $top {0 3} -weight 1
}
# Experimental...
proc makeRegSubWin {} {
set top .ddregsub
if {[winfo exists $top] && [winfo toplevel $top] eq $top} {
raise $top
focus -force $top
return
} else {
destroy $top
toplevel $top
}
wm title $top "Eskil Dir Preprocess"
entry $top.e1 -variable ::dirdiff(pattern) -width 15
entry $top.e2 -variable ::dirdiff(replace) -width 15
label $top.l1 -text "Pattern" -anchor w
label $top.l2 -text "Subst" -anchor w
grid $top.l1 $top.e1 -sticky we
grid $top.l2 $top.e2 -sticky we
grid columnconfigure $top 1 -weight 1
grid rowconfigure $top 2 -weight 1
}
|