From 3338e9e505dda8c8b3bf1cbbada616c11e6b682c Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 5 Dec 2021 22:05:00 +0000 Subject: Fix indentation ('Indents are 4 Spaces' and 'Continuation Lines are Indented 8 Spaces', see TIP #247 aka Tcl Engineering Manual). --- library/fontchooser.tcl | 78 ++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index e9a1f0e..4958691 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -22,13 +22,13 @@ namespace eval ::tk::fontchooser { set S(-title) {} set S(-command) "" set S(-font) TkDefaultFont - + set S(bad) [list ] } proc ::tk::fontchooser::Canonical {} { variable S - + set S(styles) [list \ [::msgcat::mc Regular] \ [::msgcat::mc Italic] \ @@ -57,8 +57,8 @@ proc ::tk::fontchooser::Setup {} { } } bind [winfo class .] <> \ - [list +ttk::style layout FontchooserFrame \ - [ttk::style layout FontchooserFrame]] + [list +ttk::style layout FontchooserFrame \ + [ttk::style layout FontchooserFrame]] namespace ensemble create -map { show ::tk::fontchooser::Show @@ -109,10 +109,10 @@ proc ::tk::fontchooser::Configure {args} { foreach spec $specs { foreach {name xx yy default} $spec break lappend result $name \ - [expr {[info exists S($name)] ? $S($name) : $default}] + [expr {[info exists S($name)] ? $S($name) : $default}] } lappend result -visible \ - [expr {[winfo exists $S(W)] && [winfo ismapped $S(W)]}] + [expr {[winfo exists $S(W)] && [winfo ismapped $S(W)]}] return $result } if {[llength $args] == 1} { @@ -123,8 +123,8 @@ proc ::tk::fontchooser::Configure {args} { return $S($option) } return -code error -errorcode [list TK LOOKUP OPTION $option] \ - "bad option \"$option\": must be\ - -command, -font, -parent, -title or -visible" + "bad option \"$option\": must be\ + -command, -font, -parent, -title or -visible" } set cache [dict create -parent $S(-parent) -title $S(-title) \ -font $S(-font) -command $S(-command)] @@ -178,40 +178,40 @@ proc ::tk::fontchooser::Create {} { ::tk::AmpWidget ::ttk::label $S(W).style -text [::msgcat::mc "Font st&yle:"] ::tk::AmpWidget ::ttk::label $S(W).size -text [::msgcat::mc "&Size:"] -width $sizeWidth ttk::entry $S(W).efont -width 18 \ - -textvariable [namespace which -variable S](font) + -textvariable [namespace which -variable S](font) ttk::entry $S(W).estyle -width 10 \ - -textvariable [namespace which -variable S](style) + -textvariable [namespace which -variable S](style) ttk::entry $S(W).esize -textvariable [namespace which -variable S](size) \ - -width 3 -validate key -validatecommand {regexp -- {^-*[0-9]*$} %P} + -width 3 -validate key -validatecommand {regexp -- {^-*[0-9]*$} %P} ttk_slistbox $S(W).lfonts -height 7 -exportselection 0 \ - -selectmode browse -activestyle none \ - -listvariable [namespace which -variable S](fonts) + -selectmode browse -activestyle none \ + -listvariable [namespace which -variable S](fonts) ttk_slistbox $S(W).lstyles -width 5 -height 7 -exportselection 0 \ - -selectmode browse -activestyle none \ - -listvariable [namespace which -variable S](styles) + -selectmode browse -activestyle none \ + -listvariable [namespace which -variable S](styles) ttk_slistbox $S(W).lsizes -width 4 -height 7 -exportselection 0 \ - -selectmode browse -activestyle none \ - -listvariable [namespace which -variable S](sizes) + -selectmode browse -activestyle none \ + -listvariable [namespace which -variable S](sizes) set WE $S(W).effects ::ttk::labelframe $WE -text [::msgcat::mc "Effects"] ::tk::AmpWidget ::ttk::checkbutton $WE.strike \ - -variable [namespace which -variable S](strike) \ - -text [::msgcat::mc "Stri&keout"] \ - -command [namespace code [list Click strike]] + -variable [namespace which -variable S](strike) \ + -text [::msgcat::mc "Stri&keout"] \ + -command [namespace code [list Click strike]] ::tk::AmpWidget ::ttk::checkbutton $WE.under \ - -variable [namespace which -variable S](under) \ - -text [::msgcat::mc "&Underline"] \ - -command [namespace code [list Click under]] + -variable [namespace which -variable S](under) \ + -text [::msgcat::mc "&Underline"] \ + -command [namespace code [list Click under]] set bbox [::ttk::frame $S(W).bbox] ::ttk::button $S(W).ok -text [::msgcat::mc OK] -default active\ - -command [namespace code [list Done 1]] + -command [namespace code [list Done 1]] ::ttk::button $S(W).cancel -text [::msgcat::mc Cancel] \ - -command [namespace code [list Done 0]] + -command [namespace code [list Done 0]] ::tk::AmpWidget ::ttk::button $S(W).apply -text [::msgcat::mc "&Apply"] \ - -command [namespace code [list Apply]] + -command [namespace code [list Apply]] wm protocol $S(W) WM_DELETE_WINDOW [namespace code [list Done 0]] # Calculate minimum sizes @@ -221,11 +221,11 @@ proc ::tk::fontchooser::Create {} { set minsize(gap) 10 set minsize(bbox) [winfo reqwidth $S(W).ok] set minsize(fonts) \ - [expr {[font measure TkDefaultFont "Helvetica"] + $scroll_width}] + [expr {[font measure TkDefaultFont "Helvetica"] + $scroll_width}] set minsize(styles) \ - [expr {[font measure TkDefaultFont "Bold Italic"] + $scroll_width}] + [expr {[font measure TkDefaultFont "Bold Italic"] + $scroll_width}] set minsize(sizes) \ - [expr {[font measure TkDefaultFont "-99"] + $scroll_width}] + [expr {[font measure TkDefaultFont "-99"] + $scroll_width}] set min [expr {$minsize(gap) * 4}] foreach {what width} [array get minsize] {incr min $width} wm minsize $S(W) $min 260 @@ -249,7 +249,7 @@ proc ::tk::fontchooser::Create {} { set WS $S(W).sample ::ttk::labelframe $WS -text [::msgcat::mc "Sample"] ::ttk::label $WS.sample -relief sunken -anchor center \ - -textvariable [namespace which -variable S](sampletext) + -textvariable [namespace which -variable S](sampletext) set S(sample) $WS.sample grid $WS.sample -sticky news -padx 6 -pady 4 grid rowconfigure $WS 0 -weight 1 @@ -285,15 +285,15 @@ proc ::tk::fontchooser::Create {} { Init $S(-font) trace add variable [namespace which -variable S](size) \ - write [namespace code [list Tracer]] + write [namespace code [list Tracer]] trace add variable [namespace which -variable S](style) \ - write [namespace code [list Tracer]] + write [namespace code [list Tracer]] trace add variable [namespace which -variable S](font) \ - write [namespace code [list Tracer]] + write [namespace code [list Tracer]] trace add variable [namespace which -variable S](strike) \ - write [namespace code [list Tracer]] + write [namespace code [list Tracer]] trace add variable [namespace which -variable S](under) \ - write [namespace code [list Tracer]] + write [namespace code [list Tracer]] } else { Init $S(-font) } @@ -321,7 +321,7 @@ proc ::tk::fontchooser::Done {ok} { trace vdelete S(under) w [namespace code [list Tracer]] destroy $S(W) if {$ok} { - if {$S(-command) ne ""} { + if {$S(-command) ne ""} { uplevel #0 $S(-command) [list $S(result)] } event generate $S(-parent) <> @@ -359,9 +359,9 @@ proc ::tk::fontchooser::Init {{defaultFont ""}} { set defaultFont [[entry .___e] cget -font] destroy .___e } - # We loose pixel size with 'font actual' + # We loose pixel size with 'font actual' #array set F [font actual $defaultFont] - array set F [actual $defaultFont] + array set F [actual $defaultFont] set S(font) $F(-family) set S(size) $F(-size) set S(strike) $F(-overstrike) @@ -483,7 +483,7 @@ proc ::tk::fontchooser::Tracer {var1 var2 op} { } $S(W).l${var2}s see $n } - if {[llength $S(bad)] == 0} { + if {[llength $S(bad)] == 0} { set S(nstate) normal Update } else { -- cgit v0.12