382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
|
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
|
+
+
+
+
+
-
-
+
+
+
+
-
+
|
set ::eskil($top,printFile) $apa
$entry xview end
}
}
# Fix to give spinbox nicer appearance
proc MySpinBox {w args} {
# Handle if ttk::spinbox is not there since it was introduced later
if {[info commands ttk::spinbox] eq ""} {
set cmd [list tk::spinbox $w]
} else {
set cmd [list ttk::spinbox $w]
ttk::spinbox $w -command [list $w selection clear] -state readonly \
{*}$args
lappend cmd -command [list $w selection clear] -state readonly
}
lappend cmd {*}$args
{*}$cmd
}
# Create a print dialog for PDF.
proc doPrint {top {quiet 0}} {
if {$quiet} {
PrintDiffs $top 1
return
}
destroy .pr
toplevel .pr -padx 3 -pady 3
wm title .pr "Print diffs to PDF"
# Layout
ttk::label .pr.hsl -anchor w -text "Header Size"
MySpinBox .pr.hss -textvariable ::Pref(printHeaderSize) \
-from 5 -to 16 -width 3 -format %g
-from 5 -to 16 -width 3 -format %.0f
ttk::label .pr.cll -anchor w -text "Chars per line"
ttk::entryX .pr.cle -textvariable ::Pref(printCharsPerLine) -width 4
ttk::frame .pr.clf
set values [CharsPerLineOptions $top]
foreach {value label balloon} $values {
|