︙ | | | ︙ | |
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
global doingLine1 doingLine2
if {$::eskil($top,view) eq "table"} {
insertMatchingLinesTable $top $line1 $line2
return
}
# FIXA: fully implement filter
if {$::eskil(filter) != ""} {
if {[regexp $::eskil(filter) $line1]} {
insertLine $top 1 $doingLine1 $line1
insertLine $top 2 $doingLine2 $line2
incr doingLine1
incr doingLine2
set ::eskil(filterflag) 1
return
}
set ::eskil(filterflag) 0
}
if {$::Pref(parse) != 0} {
set opts $::Pref(ignore)
if {$::Pref(nocase)} {lappend opts -nocase}
if {$::Pref(lineparsewords)} {lappend opts -words}
if {$::eskil($top,separator) ne ""} {
set res [diffWithSeparator $::eskil($top,separator) $line1 $line2 \
$opts]
|
<
<
<
<
<
<
<
<
<
<
<
<
<
|
317
318
319
320
321
322
323
324
325
326
327
328
329
330
|
global doingLine1 doingLine2
if {$::eskil($top,view) eq "table"} {
insertMatchingLinesTable $top $line1 $line2
return
}
if {$::Pref(parse) != 0} {
set opts $::Pref(ignore)
if {$::Pref(nocase)} {lappend opts -nocase}
if {$::Pref(lineparsewords)} {lappend opts -words}
if {$::eskil($top,separator) ne ""} {
set res [diffWithSeparator $::eskil($top,separator) $line1 $line2 \
$opts]
|
︙ | | | ︙ | |
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
# If block parsing is turned off, only do line parsing for
# blocks of equal size.
for {set t 0} {$t < $n1} {incr t} {
gets $ch1 textline1
gets $ch2 textline2
insertMatchingLines $top $textline1 $textline2
}
if {$::eskil(filter) != "" && $::eskil(filterflag)} {
addMapLines $top $n1
} else {
addChange $top $n1 change $line1 $n1 $line2 $n2
nextHighlight $top
}
} else {
# Collect blocks
set block1 {}
for {set t 0} {$t < $n1} {incr t} {
gets $ch1 apa
lappend block1 $apa
}
set block2 {}
for {set t 0} {$t < $n2} {incr t} {
gets $ch2 apa
lappend block2 $apa
}
insertMatchingBlocks $top $block1 $block2 $line1 $line2 1
}
# Empty return value
return
}
proc enableRedo {top} {
$top.m.mf entryconfigure "Redo Diff" -state normal
$top.m.mt entryconfigure "Merge" -state normal
}
proc disableRedo {top} {
$top.m.mf entryconfigure "Redo Diff" -state disabled
$top.m.mt entryconfigure "Merge" -state disabled
}
proc busyCursor {top} {
global oldcursor oldcursor2
if {$::eskil($top,view) eq "table"} {
set items wTable
} else {
|
<
<
<
|
|
<
|
|
|
|
|
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
|
# If block parsing is turned off, only do line parsing for
# blocks of equal size.
for {set t 0} {$t < $n1} {incr t} {
gets $ch1 textline1
gets $ch2 textline2
insertMatchingLines $top $textline1 $textline2
}
addChange $top $n1 change $line1 $n1 $line2 $n2
nextHighlight $top
} else {
# Collect blocks
set block1 {}
for {set t 0} {$t < $n1} {incr t} {
gets $ch1 apa
lappend block1 $apa
}
set block2 {}
for {set t 0} {$t < $n2} {incr t} {
gets $ch2 apa
lappend block2 $apa
}
insertMatchingBlocks $top $block1 $block2 $line1 $line2 1
}
# Empty return value
return
}
proc enableRedo {top} {
{*}$::widgets($top,configureRedoDiffCmd) -state normal
{*}$::widgets($top,configureMergeCmd) -state normal
}
proc disableRedo {top} {
{*}$::widgets($top,configureRedoDiffCmd) -state disabled
{*}$::widgets($top,configureMergeCmd) -state disabled
}
proc busyCursor {top} {
global oldcursor oldcursor2
if {$::eskil($top,view) eq "table"} {
set items wTable
} else {
|
︙ | | | ︙ | |
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
|
}
}
# Clear Editing state
proc resetEdit {top} {
set ::eskil($top,leftEdit) 0
set ::eskil($top,rightEdit) 0
$top.m.mt entryconfigure "Edit Mode" -state normal
if {$::eskil($top,view) eq "table"} {
return
}
resetEditW $::widgets($top,wDiff1)
resetEditW $::widgets($top,wDiff2)
}
|
|
|
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
|
}
}
# Clear Editing state
proc resetEdit {top} {
set ::eskil($top,leftEdit) 0
set ::eskil($top,rightEdit) 0
{*}$::widgets($top,configureEditModeCmd) -state normal
if {$::eskil($top,view) eq "table"} {
return
}
resetEditW $::widgets($top,wDiff1)
resetEditW $::widgets($top,wDiff2)
}
|
︙ | | | ︙ | |
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
|
$W configure -undo 1
set ::eskil($W,allowChange) line
}
# Turn on editing on sides where it has not been disallowed
proc allowEdit {top} {
$top.m.mt entryconfigure "Edit Mode" -state disable
if {$::eskil($top,leftEdit) == 0} {
set ::eskil($top,leftEdit) 1
turnOnEdit $::widgets($top,wDiff1)
}
if {$::eskil($top,rightEdit) == 0} {
set ::eskil($top,rightEdit) 1
turnOnEdit $::widgets($top,wDiff2)
}
}
# Turn off editing on sides that do not correspond to a file
proc disallowEdit {top {side 0}} {
if {$side == 0 || $side == 1} {
set ::eskil($top,leftEdit) -1
}
if {$side == 0 || $side == 2} {
set ::eskil($top,rightEdit) -1
}
if {$::eskil($top,leftEdit) == -1 && $::eskil($top,rightEdit) == -1} {
$top.m.mt entryconfigure "Edit Mode" -state disabled
}
}
# Ask if editing is allowed on a side
proc mayEdit {top side} {
if {$side == 1} {
return [expr {$::eskil($top,leftEdit) == 1}]
|
|
|
|
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
|
$W configure -undo 1
set ::eskil($W,allowChange) line
}
# Turn on editing on sides where it has not been disallowed
proc allowEdit {top} {
{*}$::widgets($top,configureEditModeCmd) -state disable
if {$::eskil($top,leftEdit) == 0} {
set ::eskil($top,leftEdit) 1
turnOnEdit $::widgets($top,wDiff1)
}
if {$::eskil($top,rightEdit) == 0} {
set ::eskil($top,rightEdit) 1
turnOnEdit $::widgets($top,wDiff2)
}
}
# Turn off editing on sides that do not correspond to a file
proc disallowEdit {top {side 0}} {
if {$side == 0 || $side == 1} {
set ::eskil($top,leftEdit) -1
}
if {$side == 0 || $side == 2} {
set ::eskil($top,rightEdit) -1
}
if {$::eskil($top,leftEdit) == -1 && $::eskil($top,rightEdit) == -1} {
{*}$::widgets($top,configureEditModeCmd) -state disabled
}
}
# Ask if editing is allowed on a side
proc mayEdit {top side} {
if {$side == 1} {
return [expr {$::eskil($top,leftEdit) == 1}]
|
︙ | | | ︙ | |
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
|
}
################
# Align function
################
proc enableAlign {top} {
eval $::widgets($top,enableAlignCmd)
}
proc disableAlign {top} {
eval $::widgets($top,disableAlignCmd)
}
# Remove one or all alignment pairs
proc clearAlign {top {leftline {}}} {
if {$leftline == ""} {
set ::eskil($top,aligns) {}
} else {
|
|
|
|
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
|
}
################
# Align function
################
proc enableAlign {top} {
{*}$::widgets($top,configureAlignCmd) -state normal
}
proc disableAlign {top} {
{*}$::widgets($top,configureAlignCmd) -state disabled
}
# Remove one or all alignment pairs
proc clearAlign {top {leftline {}}} {
if {$leftline == ""} {
set ::eskil($top,aligns) {}
} else {
|
︙ | | | ︙ | |
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
|
proc DisableDiffUtilC {} {
uplevel \#0 [list source $::eskil(thisDir)/../lib/diffutil/tcl/diffutil.tcl]
}
# Add a debug menu to a toplevel window
proc AddDebugMenu {top} {
set dMenu [debugMenu $top.m]
$dMenu add checkbutton -label "Wrap" -variable wrapstate \
-onvalue char -offvalue none -command \
"$top.ft1.tt configure -wrap \$wrapstate ;\
$top.ft2.tt configure -wrap \$wrapstate"
$dMenu add command -label "Date Filter" \
-command {set ::eskil(filter) {^Date}}
$dMenu add separator
$dMenu add command -label "Reread Source" -underline 0 \
-command {EskilRereadSource}
$dMenu add separator
$dMenu add command -label "Normal Cursor" \
-command [list normalCursor $top]
$dMenu add command -label "Fill X" \
-command [list fillWindowX $top]
$dMenu add separator
# Runtime disable of C version of DiffUtil
$dMenu add command -label "Tcl DiffUtil" -command DisableDiffUtilC
$dMenu add command -label "Evalstats" -command {evalstats}
$dMenu add command -label "_stats" -command {parray _stats}
}
# Build the main window
# "other" is related window. Currently unused
proc makeDiffWin {{other {}} args} {
global tcl_platform
|
>
|
|
|
<
|
|
|
<
<
>
|
<
|
<
>
|
|
|
|
>
|
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
|
proc DisableDiffUtilC {} {
uplevel \#0 [list source $::eskil(thisDir)/../lib/diffutil/tcl/diffutil.tcl]
}
# Add a debug menu to a toplevel window
proc AddDebugMenu {top} {
set dMenu [debugMenu $top.m]
$dMenu add checkbutton -label "Wrap" -variable wrapstate \
-onvalue char -offvalue none -command \
"$::widgets($top,wDiff1) configure -wrap \$wrapstate ;\
$::widgets($top,wDiff2) configure -wrap \$wrapstate"
psmenu::psmenu $dMenu -top $top {
---
"&Reread Source" -cmd EskilRereadSource
---
"Normal Cursor" -cmd "normalCursor $top"
"Fill X" -cmd "fillWindowX $top"
---
# Runtime disable of C version of DiffUtil
"Tcl DiffUtil" -cmd DisableDiffUtilC
"Evalstats" -cmd {evalstats}
"_stats" -cmd {parray _stats}
}
}
# Build the main window
# "other" is related window. Currently unused
proc makeDiffWin {{other {}} args} {
global tcl_platform
|
︙ | | | ︙ | |
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
|
ttk::frame $top.f
grid $top.f -row 0 -columnspan 5 -sticky nws
lappend ::widgets(toolbars) $top.f
if { ! $::Pref(toolbar)} {
grid remove $top.f
}
menu $top.m
$top configure -menu $top.m
$top.m add cascade -label "File" -underline 0 -menu $top.m.mf
menu $top.m.mf
$top.m.mf add command -label "Redo Diff" -underline 5 \
-command [list redoDiff $top] -state disabled
if {$::eskil(debug) == 1} {
$top.m.mf entryconfigure "Redo Diff" -state normal
}
$top.m.mf add separator
$top.m.mf add command -label "Open Both..." -underline 0 \
-command [list openBoth $top 0]
$top.m.mf add command -label "Open Both (forget)..." \
-command [list openBoth $top 1]
$top.m.mf add command -label "Open Left File..." \
-command [list openLeft $top]
$top.m.mf add command -label "Open Right File..." \
-command [list openRight $top]
$top.m.mf add separator
$top.m.mf add command -label "Open Ancestor File..." \
-command [list openAncestor $top]
$top.m.mf add command -label "Open Conflict File..." \
-command [list openConflict $top]
$top.m.mf add command -label "Open Patch File..." \
-command [list openPatch $top]
$top.m.mf add command -label "Revision Diff..." -underline 0 \
-command [list openRev $top]
$top.m.mf add separator
$top.m.mf add command -label "Print Pdf..." -underline 0 \
-command [list doPrint $top]
$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 {cleanupAndExit all}
$top.m add cascade -label "Options" -underline 0 -menu $top.m.mo
menu $top.m.mo
$top.m.mo add cascade -label "Font" -underline 0 -menu $top.m.mo.f
$top.m.mo add cascade -label "Ignore" -underline 0 -menu $top.m.mo.i
$top.m.mo add command -label "Preprocess..." -underline 0 \
-command [list EditPrefPreprocess $top]
$top.m.mo add command -label "Plugins..." -underline 1 \
-command [list editPrefPlugins $top]
$top.m.mo add cascade -label "Parse" -underline 1 -menu $top.m.mo.p
$top.m.mo add command -label "Colours..." -underline 0 -command makePrefWin
$top.m.mo add cascade -label "Context" -underline 1 -menu $top.m.mo.c
$top.m.mo add cascade -label "Pivot" -underline 2 -menu $top.m.mo.piv
$top.m.mo add separator
$top.m.mo add checkbutton -label "Toolbar" -variable ::Pref(toolbar)
$top.m.mo add separator
$top.m.mo add command -label "Save default" \
-command [list saveOptions $top]
menu $top.m.mo.f
$top.m.mo.f add command -label "Select..." -command makeFontWin \
-underline 0
$top.m.mo.f add radiobutton -label 6 -variable ::Pref(fontsize) -value 6 \
-command chFont
$top.m.mo.f add radiobutton -label 7 -variable ::Pref(fontsize) -value 7 \
-command chFont
$top.m.mo.f add radiobutton -label 8 -variable ::Pref(fontsize) -value 8 \
-command chFont
$top.m.mo.f add radiobutton -label 9 -variable ::Pref(fontsize) -value 9 \
-command chFont
$top.m.mo.f add radiobutton -label 10 -variable ::Pref(fontsize) -value 10 \
-command chFont
menu $top.m.mo.i
$top.m.mo.i add radiobutton -label "No spaces" \
-variable ::Pref(ignore) -value " "
$top.m.mo.i add radiobutton -label "Space changes (-b)" \
-variable ::Pref(ignore) -value "-b"
$top.m.mo.i add radiobutton -label "All spaces (-w)" \
-variable ::Pref(ignore) -value "-w"
$top.m.mo.i add separator
$top.m.mo.i add checkbutton -label "Case (-i)" \
-variable ::Pref(nocase)
$top.m.mo.i add checkbutton -label "Empty" \
-variable ::Pref(noempty)
$top.m.mo.i add checkbutton -label "Digits" \
-variable ::Pref(nodigit)
menu $top.m.mo.p
$top.m.mo.p add radiobutton -label "Nothing" -variable ::Pref(parse) -value 0
$top.m.mo.p add radiobutton -label "Lines" -variable ::Pref(parse) -value 1
$top.m.mo.p add radiobutton -label "Blocks (small)" -variable ::Pref(parse) \
-value 2
$top.m.mo.p add radiobutton -label "Blocks" -variable ::Pref(parse) -value 3
$top.m.mo.p add separator
$top.m.mo.p add radiobutton -label "Characters" \
-variable ::Pref(lineparsewords) -value "0"
$top.m.mo.p add radiobutton -label "Words" \
-variable ::Pref(lineparsewords) -value "1"
$top.m.mo.p add separator
$top.m.mo.p add checkbutton -label "Fine chunks" -variable ::Pref(finegrainchunks)
$top.m.mo.p add separator
$top.m.mo.p add checkbutton -label "Mark last" -variable ::Pref(marklast)
menu $top.m.mo.c
$top.m.mo.c add radiobutton -label "Show all lines" \
-variable ::Pref(context) -value -1
$top.m.mo.c add radiobutton -label "Show only diffs" \
-variable ::Pref(context) -value 0
$top.m.mo.c add separator
$top.m.mo.c add radiobutton -label "Context 2 lines" \
-variable ::Pref(context) -value 2
$top.m.mo.c add radiobutton -label "Context 5 lines" \
-variable ::Pref(context) -value 5
$top.m.mo.c add radiobutton -label "Context 10 lines" \
-variable ::Pref(context) -value 10
$top.m.mo.c add radiobutton -label "Context 20 lines" \
-variable ::Pref(context) -value 20
menu $top.m.mo.piv
$top.m.mo.piv add radiobutton -label "1" \
-variable ::Pref(pivot) -value 1
$top.m.mo.piv add radiobutton -label "10" \
-variable ::Pref(pivot) -value 10
$top.m.mo.piv add radiobutton -label "100" \
-variable ::Pref(pivot) -value 100
$top.m.mo.piv add radiobutton -label "1000" \
-variable ::Pref(pivot) -value 1000
$top.m.mo.piv add radiobutton -label "Max" \
-variable ::Pref(pivot) -value 2000000000
$top.m add cascade -label "Search" -underline 0 -menu $top.m.ms
menu $top.m.ms
if {[info procs textSearch::searchMenu] != ""} {
textSearch::searchMenu $top.m.ms
} else {
$top.m.ms add command -label "Text search not available" \
-state disabled
}
$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 [list makeDiffWin $top]
$top.m.mt add command -label "Directory Diff" -underline 0 \
-command makeDirDiffWin
$top.m.mt add command -label "Clip Diff" -underline 0 \
-command makeClipDiffWin
$top.m.mt add command -label "Fourway Diff" -underline 0 \
-command makeFourWayWin
$top.m.mt add command -label "Table Diff" -underline 0 \
-command [list makeDiffWin $top -table]
$top.m.mt add command -label "Merge" -underline 0 \
-command [list makeMergeWin $top] -state disabled
$top.m.mt add command -label "Edit Mode" -underline 0 -accelerator Ctrl-E \
-command [list allowEdit $top] -state disabled
bind $top <Control-Key-E> [list allowEdit $top]
$top.m.mt add command -label "Paste Patch" -underline 0 \
-command [list doPastePatch $top]
$top.m.mt add command -label "Clear Align" \
-command [list clearAlign $top] -state disabled
$top.m.mt add command -label "Highlight tabs" \
-command [list highlightTabs $top]
set ::widgets($top,enableAlignCmd) [list \
$top.m.mt entryconfigure "Clear Align" -state normal]
set ::widgets($top,disableAlignCmd) [list \
$top.m.mt entryconfigure "Clear Align" -state disabled]
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 "General" -command makeHelpWin -underline 0
$top.m.help add command -label "Tutorial" -command makeTutorialWin \
-underline 0
foreach label {{Revision Control} {Edit Mode} {Plugins}} \
file {revision.txt editmode.txt plugins.txt} {
$top.m.help add command -label $label \
-command [list makeDocWin $file] -underline 0
}
$top.m.help add separator
$top.m.help add command -label "About" -command makeAboutWin -underline 0
# Toolbar
ttk::label $top.lr1 -text "Rev 1"
addBalloon $top.lr1 "Revision number for version diff."
ttk::entryX $top.er1 -width 12 -textvariable ::eskil($top,doptrev1)
set ::widgets($top,rev1) $top.er1
bind $top.er1 <Key-Return> [list redoDiff $top]
|
|
<
<
|
<
>
|
<
|
<
<
<
>
|
|
<
|
<
|
<
<
>
|
<
|
<
|
<
|
<
<
>
|
>
>
>
>
>
>
>
|
<
<
<
<
<
|
>
|
<
<
<
>
|
>
>
>
>
>
|
>
>
|
<
|
|
<
|
|
|
|
<
>
|
|
>
>
>
>
|
<
|
<
<
|
<
<
<
<
|
>
|
|
|
>
>
|
<
<
>
|
<
|
<
|
|
<
|
>
|
|
|
|
|
|
|
<
<
>
|
<
|
<
<
<
<
|
>
>
|
|
|
>
>
>
>
>
>
>
>
>
>
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
>
>
>
>
|
|
|
|
|
<
<
<
<
<
<
|
<
<
>
|
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
|
ttk::frame $top.f
grid $top.f -row 0 -columnspan 5 -sticky nws
lappend ::widgets(toolbars) $top.f
if { ! $::Pref(toolbar)} {
grid remove $top.f
}
set redoState [expr {$::eskil(debug) == 1 ? "normal" : "disabled"}]
psmenu::psmenu $top {
"&File" {
"Redo &Diff" -cmd "redoDiff $top" -state $redoState \
-cfgvar ::widgets($top,configureRedoDiffCmd)
---
"&Open Both..." -cmd "openBoth $top 0"
"Open Both (forget)..." -cmd "openBoth $top 1"
"Open Left File..." -cmd "openLeft $top"
"Open Right File..." -cmd "openRight $top"
---
"Open Ancestor File..." -cmd "openAncestor $top"
"Open Conflict File..." -cmd "openConflict $top"
"Open Patch File..." -cmd "openPatch $top"
"&Revision Diff..." -cmd "openRev $top"
---
"&Print Pdf..." -cmd "doPrint $top"
---
"&Close" -cmd "list cleanupAndExit $top"
---
"&Quit" -cmd "cleanupAndExit all"
}
"&Options" {
"&Font" {
"&Select..." -command makeFontWin
_Radio -var ::Pref(fontsize) -command chFont {
6 7 8 9 10
}
}
"&Ignore" {
"No spaces" -var ::Pref(ignore) -value " "
"Space changes (-b)" -var ::Pref(ignore) -value "-b"
"All spaces (-w)" -var ::Pref(ignore) -value "-w"
---
"Case (-i)" -var ::Pref(nocase)
"Empty" -var ::Pref(noempty)
"Digits" -var ::Pref(nodigit)
}
"&Preprocess..." -cmd "EditPrefPreprocess $top"
"P&lugins..." -cmd "editPrefPlugins $top"
"P&arse" {
"Nothing" -var ::Pref(parse) -value 0
"Lines" -var ::Pref(parse) -value 1
"Blocks (small)" -var ::Pref(parse) -value 2
"Blocks" -var ::Pref(parse) -value 3
---
"Characters" -var ::Pref(lineparsewords) -value "0"
"Words" -var ::Pref(lineparsewords) -value "1"
---
"Fine chunks" -var ::Pref(finegrainchunks)
---
"Mark last" -var ::Pref(marklast)
}
"&Colours..." -cmd makePrefWin
"C&ontext" {
"Show all lines" -var ::Pref(context) -value -1
"Show only diffs" -var ::Pref(context) -value 0
---
"Context 2 lines" -var ::Pref(context) -value 2
"Context 5 lines" -var ::Pref(context) -value 5
"Context 10 lines" -var ::Pref(context) -value 10
"Context 20 lines" -var ::Pref(context) -value 20
}
"Pi&vot" {
"1" -var ::Pref(pivot) -value 1
"10" -var ::Pref(pivot) -value 10
"100" -var ::Pref(pivot) -value 100
"1000" -var ::Pref(pivot) -value 1000
"Max" -var ::Pref(pivot) -value 2000000000
}
---
"Toolbar" -var ::Pref(toolbar)
---
"Save default" -cmd "saveOptions $top"
}
"&Search" -var searchMenu {
# Added below
}
"&Tools" {
"&New Diff Window" -cmd "makeDiffWin $top"
"&Directory Diff" -cmd makeDirDiffWin
"&Clip Diff" -cmd makeClipDiffWin
"&Fourway Diff" -cmd makeFourWayWin
"&Table Diff" -cmd "makeDiffWin $top -table"
"&Merge" -cmd "makeMergeWin $top" -state disabled \
-cfgvar ::widgets($top,configureMergeCmd)
"&Edit Mode" -cmd "allowEdit $top" -acc Ctrl-E -state disabled \
-cfgvar ::widgets($top,configureEditModeCmd)
"&Paste Patch" -cmd "doPastePatch $top"
"Clear Align" -cmd "clearAlign $top" -state disabled \
-cfgvar ::widgets($top,configureAlignCmd)
"Highlight tabs" -cmd "highlightTabs $top"
if {$::tcl_platform(platform) eq "windows"} {
if { ! [catch {package require registry}]} {
---
"Setup &Registry" -cmd makeRegistryWin
}
}
}
"&Help" {
"&General" -cmd makeHelpWin
"&Tutorial" -cmd makeTutorialWin
"&Revision Control" -cmd "makeDocWin revision.txt"
"&Edit Mode" -cmd "makeDocWin editmode.txt"
"&Plugins" -cmd "makeDocWin plugins.txt"
---
"&About" -cmd makeAboutWin
}
}
if {[info procs textSearch::searchMenu] != ""} {
textSearch::searchMenu $searchMenu
} else {
$searchMenu add command -label "Text search not available" -state disabled
}
# Toolbar
ttk::label $top.lr1 -text "Rev 1"
addBalloon $top.lr1 "Revision number for version diff."
ttk::entryX $top.er1 -width 12 -textvariable ::eskil($top,doptrev1)
set ::widgets($top,rev1) $top.er1
bind $top.er1 <Key-Return> [list redoDiff $top]
|
︙ | | | ︙ | |