Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Allow print to cancel. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
264df1032d2521f4f5704ef624a44f7e |
User & Date: | peter 2020-10-30 13:46:32.323 |
Context
2020-12-07
| ||
11:54 | Refactor insertLine a bit. check-in: d6f65d2a50 user: peter tags: trunk | |
2020-10-30
| ||
13:46 | Allow print to cancel. check-in: 264df1032d user: peter tags: trunk | |
13:43 | Correct parent in dialogs. check-in: bfd46ab53e user: peter tags: trunk | |
Changes
Changes to src/print.tcl.
︙ | ︙ | |||
237 238 239 240 241 242 243 | PdfPrint $top $wraplength $maxlen $wraplines1 $wraplines2 $quiet # Finished normalCursor $top } | | | 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | PdfPrint $top $wraplength $maxlen $wraplines1 $wraplines2 $quiet # Finished normalCursor $top } proc PdfPrint {top cpl cpln wraplines1 wraplines2 {quiet 0}} { if {$::eskil($top,printFile) != ""} { set pdfFile $::eskil($top,printFile) } else { set pdfFile ~/eskil.pdf } |
︙ | ︙ | |||
439 440 441 442 443 444 445 | set ::Pref(printColorNew1) \ [list $::TmpPref(n1r) $::TmpPref(n1g) $::TmpPref(n1b)] set ::Pref(printColorNew2) \ [list $::TmpPref(n2r) $::TmpPref(n2g) $::TmpPref(n2b)] if { ! [winfo exists $W.cf.l1e]} return foreach num {1 2 3} p {ch n1 n2} { | | | | | 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | set ::Pref(printColorNew1) \ [list $::TmpPref(n1r) $::TmpPref(n1g) $::TmpPref(n1b)] set ::Pref(printColorNew2) \ [list $::TmpPref(n2r) $::TmpPref(n2g) $::TmpPref(n2b)] if { ! [winfo exists $W.cf.l1e]} return foreach num {1 2 3} p {ch n1 n2} { set r [expr {int(255*$::TmpPref(${p}r))}] set g [expr {int(255*$::TmpPref(${p}g))}] set b [expr {int(255*$::TmpPref(${p}b))}] set col [format \#%02X%02X%02X $r $g $b] $W.cf.l${num}e configure -background $col } } # Create a print dialog for PDF. proc doPrint {top {quiet 0}} { |
︙ | ︙ | |||
471 472 473 474 475 476 477 | MySpinBox $W.lfs.hss -textvariable ::Pref(printHeaderSize) \ -from 5 -to 16 -width 3 -format %.0f ttk::label $W.lfs.cll -anchor w -text "Chars per line" addBalloon $W.lfs.cll "Font size is scaled to fit this" ttk::entryX $W.lfs.cle -textvariable ::Pref(printCharsPerLine) -width 4 ttk::frame $W.lfs.clf | | | | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | MySpinBox $W.lfs.hss -textvariable ::Pref(printHeaderSize) \ -from 5 -to 16 -width 3 -format %.0f ttk::label $W.lfs.cll -anchor w -text "Chars per line" addBalloon $W.lfs.cll "Font size is scaled to fit this" ttk::entryX $W.lfs.cle -textvariable ::Pref(printCharsPerLine) -width 4 ttk::frame $W.lfs.clf set values [CharsPerLineOptions $top] foreach {value label balloon} $values { ttk::radiobutton $W.lfs.clf.$value -variable ::Pref(printCharsPerLine) \ -value $value -text $label addBalloon $W.lfs.clf.$value $balloon pack $W.lfs.clf.$value -side left -padx 3 -pady 3 } # Select paper size set paperlist [lsort -dictionary [pdf4tcl::getPaperSizeList]] ttk::label $W.lfs.psl -anchor w -text "Paper Size" ttk::combobox $W.lfs.psc -values $paperlist -textvariable ::Pref(printPaper) \ -width 6 -state readonly grid $W.lfs.hsl $W.lfs.hss -sticky we -padx 3 -pady 3 grid $W.lfs.psl $W.lfs.psc -sticky we -padx 3 -pady 3 grid $W.lfs.cll $W.lfs.cle $W.lfs.clf - -sticky we -padx 3 -pady 3 grid columnconfigure $W.lfs 1 -weight 1 # Color foreach {::TmpPref(chr) ::TmpPref(chg) ::TmpPref(chb)} \ $::Pref(printColorChange) break foreach {::TmpPref(n1r) ::TmpPref(n1g) ::TmpPref(n1b)} \ $::Pref(printColorNew1) break foreach {::TmpPref(n2r) ::TmpPref(n2g) ::TmpPref(n2b)} \ $::Pref(printColorNew2) break |
︙ | ︙ | |||
556 557 558 559 560 561 562 | if {$::eskil($top,printFile) eq ""} { set ::eskil($top,printFile) "~/eskil.pdf" } ttk::frame $W.fb ttk::button $W.b1 -text "Print to File" \ -command "destroy $W; update; PrintDiffs $top" | | | | 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | if {$::eskil($top,printFile) eq ""} { set ::eskil($top,printFile) "~/eskil.pdf" } ttk::frame $W.fb ttk::button $W.b1 -text "Print to File" \ -command "destroy $W; update; PrintDiffs $top" ttk::button $W.b2 -text "Cancel" -command "destroy $W" pack $W.b1 -in $W.fb -side left -padx {0 3} -pady 3 -ipadx 5 pack $W.b2 -in $W.fb -side right -padx {3 0} -pady 3 -ipadx 5 # Top Layout grid $W.lfs -sticky we -padx 3 -pady 3 grid $W.cf -sticky we -padx 3 -pady 3 grid $W.lff -sticky we -padx 3 -pady 3 grid $W.fb -sticky swe -padx 3 -pady 3 grid columnconfigure $W 0 -weight 1 grid rowconfigure $W $W.fb -weight 1 } |