diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/demos/images/earth.gif | bin | 51712 -> 51559 bytes | |||
-rw-r--r-- | library/fontchooser.tcl | 255 | ||||
-rw-r--r-- | library/msgs/fi.msg | 89 | ||||
-rw-r--r-- | library/msgs/zh_cn.msg | 92 | ||||
-rw-r--r-- | library/ttk/utils.tcl | 4 |
5 files changed, 340 insertions, 100 deletions
diff --git a/library/demos/images/earth.gif b/library/demos/images/earth.gif Binary files differindex 2c229eb..d667244 100644 --- a/library/demos/images/earth.gif +++ b/library/demos/images/earth.gif diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index fb6c6d3..27c8def 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -12,34 +12,48 @@ namespace eval ::tk::fontchooser { variable S set S(W) .__tk__fontchooser - set S(fonts) [lsort -dictionary [font families]] + set S(fonts) [lsort -dictionary -unique [font families]] set S(styles) [list \ - [::msgcat::mc "Regular"] \ - [::msgcat::mc "Italic"] \ - [::msgcat::mc "Bold"] \ - [::msgcat::mc "Bold Italic"] \ + [::msgcat::mc Regular] \ + [::msgcat::mc Italic] \ + [::msgcat::mc Bold] \ + [::msgcat::mc {Bold Italic}] \ ] - set S(sizes) {8 9 10 11 12 14 16 18 20 22 24 26 28 36 48 72} set S(strike) 0 set S(under) 0 set S(first) 1 - set S(sampletext) [::msgcat::mc "AaBbYyZz01"] set S(-parent) . - set S(-title) [::msgcat::mc "Font"] + set S(-title) {} set S(-command) "" set S(-font) TkDefaultFont + set S(bad) [list ] } -proc ::tk::fontchooser::Setup {} { +proc ::tk::fontchooser::Canonical {} { variable S + foreach style $S(styles) { + lappend S(styles,lcase) [string tolower $style] + } + set S(sizes,lcase) $S(sizes) + set S(sampletext) [::msgcat::mc "AaBbYyZz01"] + # Canonical versions of font families, styles, etc. for easier searching set S(fonts,lcase) {} - foreach font $S(fonts) {lappend S(fonts,lcase) [string tolower $font]} + foreach font $S(fonts) { + lappend S(fonts,lcase) [string tolower $font] + } set S(styles,lcase) {} - foreach style $S(styles) {lappend S(styles,lcase) [string tolower $style]} - set S(sizes,lcase) $S(sizes) + foreach style $S(styles) { + lappend S(styles,lcase) [string tolower $style] + } +} + +proc ::tk::fontchooser::Setup {} { + variable S + + Canonical ::ttk::style layout FontchooserFrame { Entry.field -sticky news -border true -children { @@ -47,8 +61,8 @@ proc ::tk::fontchooser::Setup {} { } } bind [winfo class .] <<ThemeChanged>> \ - [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 @@ -60,14 +74,24 @@ proc ::tk::fontchooser::Setup {} { proc ::tk::fontchooser::Show {} { variable S + + Canonical + if {![winfo exists $S(W)]} { Create wm transient $S(W) [winfo toplevel $S(-parent)] tk::PlaceWindow $S(W) widget $S(-parent) + if {[string trim $S(-title)] eq ""} { + wm title $S(W) [::msgcat::mc "Font"] + } else { + wm title $S(W) $S(-title) + } } - set S(fonts) [lsort -dictionary [font families]] + set S(fonts) [lsort -dictionary -unique [font families]] set S(fonts,lcase) {} - foreach font $S(fonts) { lappend S(fonts,lcase) [string tolower $font]} + foreach font $S(fonts) { + lappend S(fonts,lcase) [string tolower $font] + } wm deiconify $S(W) } @@ -91,10 +115,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} { @@ -105,25 +129,32 @@ 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)] + -font $S(-font) -command $S(-command)] set r [tclParseConfigSpec [namespace which -variable S] $specs DONTSETDEFAULTS $args] if {![winfo exists $S(-parent)]} { - set code [list TK LOOKUP WINDOW $S(-parent)] + set code [list TK LOOKUP WINDOW $S(-parent)] set err "bad window path name \"$S(-parent)\"" array set S $cache return -code error -errorcode $code $err } - if {[string trim $S(-title)] eq ""} { - set S(-title) [::msgcat::mc "Font"] - } - if {[winfo exists $S(W)] && ("-font" in $args)} { - Init $S(-font) - event generate $S(-parent) <<TkFontchooserFontChanged>> + + if {[winfo exists $S(W)]} { + if {{-font} in $args} { + Init $S(-font) + event generate $S(-parent) <<TkFontchooserFontChanged>> + } + + if {[string trim $S(-title)] eq {}} { + wm title $S(W) [::msgcat::mc Font] + } else { + wm title $S(W) $S(-title) + } + $S(W).ok configure -state $S(nstate) + $S(W).apply configure -state $S(nstate) } return $r } @@ -140,7 +171,9 @@ proc ::tk::fontchooser::Create {} { # Now build the dialog if {![winfo exists $S(W)]} { toplevel $S(W) -class TkFontDialog - if {[package provide tcltest] ne {}} {set ::tk_dialog $S(W)} + if {[package provide tcltest] ne {}} { + set ::tk_dialog $S(W) + } wm withdraw $S(W) wm title $S(W) $S(-title) wm transient $S(W) [winfo toplevel $S(-parent)] @@ -153,40 +186,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 {string is double %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 @@ -196,13 +229,15 @@ 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} + foreach {what width} [array get minsize] { + incr min $width + } wm minsize $S(W) $min 260 bind $S(W) <Return> [namespace code [list Done 1]] @@ -224,7 +259,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 @@ -233,9 +268,7 @@ proc ::tk::fontchooser::Create {} { grid $S(W).ok -in $bbox -sticky new -pady {0 2} grid $S(W).cancel -in $bbox -sticky new -pady 2 - if {$S(-command) ne ""} { - grid $S(W).apply -in $bbox -sticky new -pady 2 - } + grid $S(W).apply -in $bbox -sticky new -pady 2 grid columnconfigure $bbox 0 -weight 1 grid $WE.strike -sticky w -padx 10 @@ -262,15 +295,19 @@ 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]] - } else { - Init $S(-font) + write [namespace code [list Tracer]] + trace add variable [namespace which -variable S](strike) \ + write [namespace code [list Tracer]] + trace add variable [namespace which -variable S](under) \ + write [namespace code [list Tracer]] } + Init $S(-font) + return } @@ -290,9 +327,14 @@ proc ::tk::fontchooser::Done {ok} { trace vdelete S(size) w [namespace code [list Tracer]] trace vdelete S(style) w [namespace code [list Tracer]] trace vdelete S(font) w [namespace code [list Tracer]] + trace vdelete S(strike) w [namespace code [list Tracer]] + trace vdelete S(under) w [namespace code [list Tracer]] destroy $S(W) - if {$ok && $S(-command) ne ""} { - uplevel #0 $S(-command) [list $S(result)] + if {$ok} { + if {$S(-command) ne ""} { + uplevel #0 $S(-command) [list $S(result)] + } + event generate $S(-parent) <<TkFontchooserFontChanged>> } } @@ -322,16 +364,17 @@ proc ::tk::fontchooser::Init {{defaultFont ""}} { variable S if {$S(first) || $defaultFont ne ""} { + Canonical if {$defaultFont eq ""} { set defaultFont [[entry .___e] cget -font] destroy .___e } array set F [font actual $defaultFont] set S(font) $F(-family) + set S(style) [::msgcat::mc "Regular"] set S(size) $F(-size) set S(strike) $F(-overstrike) set S(under) $F(-underline) - set S(style) [::msgcat::mc "Regular"] if {$F(-weight) eq "bold" && $F(-slant) eq "italic"} { set S(style) [::msgcat::mc "Bold Italic"] } elseif {$F(-weight) eq "bold"} { @@ -339,12 +382,8 @@ proc ::tk::fontchooser::Init {{defaultFont ""}} { } elseif {$F(-slant) eq "italic"} { set S(style) [::msgcat::mc "Italic"] } - set S(first) 0 } - - Tracer a b c - Update } # ::tk::fontchooser::Click -- @@ -356,7 +395,6 @@ proc ::tk::fontchooser::Init {{defaultFont ""}} { # proc ::tk::fontchooser::Click {who} { variable S - if {$who eq "font"} { set S(font) [$S(W).lfonts get [$S(W).lfonts curselection]] } elseif {$who eq "style"} { @@ -364,7 +402,6 @@ proc ::tk::fontchooser::Click {who} { } elseif {$who eq "size"} { set S(size) [$S(W).lsizes get [$S(W).lsizes curselection]] } - Update } # ::tk::fontchooser::Tracer -- @@ -376,32 +413,43 @@ proc ::tk::fontchooser::Click {who} { # proc ::tk::fontchooser::Tracer {var1 var2 op} { variable S - - set bad 0 - set nstate normal - # Make selection in each listbox - foreach var {font style size} { - set value [string tolower $S($var)] - $S(W).l${var}s selection clear 0 end - set n [lsearch -exact $S(${var}s,lcase) $value] - $S(W).l${var}s selection set $n + # We don't need to process strike and under + if {$var2 ni [list strike under]} { + # Make selection in listbox + set value [string tolower $S($var2)] + $S(W).l${var2}s selection clear 0 end + set n [lsearch -exact $S(${var2}s,lcase) $value] + $S(W).l${var2}s selection set $n if {$n >= 0} { - set S($var) [lindex $S(${var}s) $n] - $S(W).e$var icursor end - $S(W).e$var selection clear - } else { ;# No match, try prefix - # Size is weird: valid numbers are legal but don't display - # unless in the font size list - set n [lsearch -glob $S(${var}s,lcase) "$value*"] - set bad 1 - if {$var ne "size" || ! [string is double -strict $value]} { - set nstate disabled + set S($var2) [lindex $S(${var2}s) $n] + $S(W).e$var2 icursor end + $S(W).e$var2 selection clear + if {[set i [lsearch $S(bad) $var2]] >= 0} { + set S(bad) [lreplace $S(bad) $i $i] + } + } else { + # No match, try prefix + set n [lsearch -glob $S(${var2}s,lcase) "$value*"] + if {$var2 ne "size" || !([regexp -- {^(-[0-9]+|[0-9]+)$} $value] && $value >= -4096 && $value <= 4096)} { + if {[lsearch $S(bad) $var2] < 0} { + lappend S(bad) $var2 + } + } else { + if {[set i [lsearch $S(bad) $var2]] >= 0} { + set S(bad) [lreplace $S(bad) $i $i] + } } } - $S(W).l${var}s see $n + $S(W).l${var2}s see $n + } + if {[llength $S(bad)] == 0} { + set S(nstate) normal + Update + } else { + set S(nstate) disabled } - if {!$bad} {Update} - $S(W).ok configure -state $nstate + $S(W).ok configure -state $S(nstate) + $S(W).apply configure -state $S(nstate) } # ::tk::fontchooser::Update -- @@ -412,13 +460,24 @@ proc ::tk::fontchooser::Update {} { variable S set S(result) [list $S(font) $S(size)] - if {$S(style) eq [::msgcat::mc "Bold"]} {lappend S(result) bold} - if {$S(style) eq [::msgcat::mc "Italic"]} {lappend S(result) italic} - if {$S(style) eq [::msgcat::mc "Bold Italic"]} {lappend S(result) bold italic} - if {$S(strike)} {lappend S(result) overstrike} - if {$S(under)} {lappend S(result) underline} + if {$S(style) eq [::msgcat::mc "Bold"]} { + lappend S(result) bold + } + if {$S(style) eq [::msgcat::mc "Italic"]} { + lappend S(result) italic + } + if {$S(style) eq [::msgcat::mc "Bold Italic"]} { + lappend S(result) bold italic + } + if {$S(strike)} { + lappend S(result) overstrike + } + if {$S(under)} { + lappend S(result) underline + } $S(sample) configure -font $S(result) + set S(-font) $S(result) } # ::tk::fontchooser::Visibility -- @@ -432,7 +491,7 @@ proc ::tk::fontchooser::Visibility {w visible} { } } -# ::tk::fontchooser::ttk_listbox -- +# ::tk::fontchooser::ttk_slistbox -- # # Create a properly themed scrolled listbox. # This is exactly right on XP but may need adjusting on other platforms. diff --git a/library/msgs/fi.msg b/library/msgs/fi.msg new file mode 100644 index 0000000..e014cce --- /dev/null +++ b/library/msgs/fi.msg @@ -0,0 +1,89 @@ +namespace eval ::tk { + ::msgcat::mcset fi "&Abort" "&Keskeyt\u00e4" + ::msgcat::mcset fi "&About..." "&Tietoja..." + ::msgcat::mcset fi "All Files" "Kaikki tiedostot" + ::msgcat::mcset fi "Application Error" "Ohjelmavirhe" + ::msgcat::mcset fi "&Apply" "K\u00e4&yt\u00e4" + ::msgcat::mcset fi "Bold" "Lihavoitu" + ::msgcat::mcset fi "Bold Italic" "Lihavoitu, kursivoitu" + ::msgcat::mcset fi "&Blue" "&Sininen" + ::msgcat::mcset fi "Cancel" "Peruuta" + ::msgcat::mcset fi "&Cancel" "&Peruuta" + ::msgcat::mcset fi "Cannot change to the directory \"%1\$s\".\nPermission denied." "Ei voitu vaihtaa hakemistoon \"%1\$s\".\nLupa ev\u00e4tty." + ::msgcat::mcset fi "Choose Directory" "Valitse hakemisto" + ::msgcat::mcset fi "Cl&ear" "&Tyhjenn\u00e4" + ::msgcat::mcset fi "&Clear Console" "&Tyhjenn\u00e4 konsoli" + ::msgcat::mcset fi "Color" "V\u00e4ri" + ::msgcat::mcset fi "Console" "Konsoli" + ::msgcat::mcset fi "&Copy" "K&opioi" + ::msgcat::mcset fi "Cu&t" "&Leikkaa" + ::msgcat::mcset fi "&Delete" "&Poista" + ::msgcat::mcset fi "Details >>" "Lis\u00e4tiedot >>" + ::msgcat::mcset fi "Directory \"%1\$s\" does not exist." "Hakemistoa \"%1\$s\" ei ole olemassa." + ::msgcat::mcset fi "&Directory:" "&Hakemisto:" + ::msgcat::mcset fi "&Edit" "&Muokkaa" + ::msgcat::mcset fi "Effects" "Tehosteet" + ::msgcat::mcset fi "Error: %1\$s" "Virhe: %1\$s" + ::msgcat::mcset fi "E&xit" "&Lopeta" + ::msgcat::mcset fi "&File" "&Tiedosto" + ::msgcat::mcset fi "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "Tiedosto \"%1\$s\" on jo olemassa.\nHaluatko korvata sen?" + ::msgcat::mcset fi "File \"%1\$s\" already exists.\n\n" "Tiedosto \"%1\$s\" on jo olemassa.\n\n" + ::msgcat::mcset fi "File \"%1\$s\" does not exist." "Tiedostoa \"%1\$s\" ei ole olemassa." + ::msgcat::mcset fi "File &name:" "Tiedosto&nimi:" + ::msgcat::mcset fi "File &names:" "Tiedosto&nimet:" + ::msgcat::mcset fi "Files of &type:" "T&yyppi:" + ::msgcat::mcset fi "Fi&les:" "Ti&edostot:" + ::msgcat::mcset fi "&Filter" "&Suodata" + ::msgcat::mcset fi "Fil&ter:" "Suo&data:" + ::msgcat::mcset fi "Font" "Kirjasin" + ::msgcat::mcset fi "&Font:" "&Kirjasin:" + ::msgcat::mcset fi "Font st&yle:" "Kirjasint&yyli:" + ::msgcat::mcset fi "&Green" "&Vihre\u00e4" + ::msgcat::mcset fi "&Help" "&Ohje" + ::msgcat::mcset fi "Hi" "Hei" + ::msgcat::mcset fi "&Hide Console" "P&iilota konsoli" + ::msgcat::mcset fi "&Ignore" "&Ohita" + ::msgcat::mcset fi "Invalid file name \"%1\$s\"." "Virheellinen tiedostonimi \"%1\$s\"." + ::msgcat::mcset fi "Italic" "Kursivoitu" + ::msgcat::mcset fi "Log Files" "Lokitiedostot" + ::msgcat::mcset fi "&No" "&Ei" + ::msgcat::mcset fi "&OK" + ::msgcat::mcset fi "OK" + ::msgcat::mcset fi "Ok" "OK" + ::msgcat::mcset fi "Open" "Avaa" + ::msgcat::mcset fi "&Open" "&Avaa" + ::msgcat::mcset fi "Open Multiple Files" "Avaa monta tiedostoa" + ::msgcat::mcset fi "P&aste" "L&iit\u00e4" + ::msgcat::mcset fi "&Quit" "&Lopeta" + ::msgcat::mcset fi "&Red" "&Punainen" + ::msgcat::mcset fi "Regular" "Tavallinen" + ::msgcat::mcset fi "Replace existing file?" "Korvataanko olemassaoleva tiedosto?" + ::msgcat::mcset fi "&Retry" "&Yrit\u00e4 uudelleen" + ::msgcat::mcset fi "Sample" "Malli" + ::msgcat::mcset fi "&Save" "&Tallenna" + ::msgcat::mcset fi "Save As" "Tallenna nimell\u00e4" + ::msgcat::mcset fi "Save To Log" "Tallenna lokiin" + ::msgcat::mcset fi "Select Log File" "Valitse lokitiedosto" + ::msgcat::mcset fi "Select a file to source" "Valitse l\u00e4hdetiedosto" + ::msgcat::mcset fi "&Selection:" "&Valinta:" + ::msgcat::mcset fi "&Size:" "K&oko:" + ::msgcat::mcset fi "Skip Messages" "J\u00e4t\u00e4 viestit huomiotta" + ::msgcat::mcset fi "&Source..." "L&\u00e4hde..." + ::msgcat::mcset fi "Stri&keout" "&Yliviivaa" + ::msgcat::mcset fi "Tcl Scripts" "Tcl-skriptit" + ::msgcat::mcset fi "Tcl for Windows" "Tcl Windowsille" + ::msgcat::mcset fi "Text Files" "Tekstitiedostot" + ::msgcat::mcset fi "&Underline" "&Alleviivaa" + ::msgcat::mcset fi "&Yes" "&Kyll\u00e4" + ::msgcat::mcset fi "abort" "keskeyt\u00e4" + ::msgcat::mcset fi "blue" "sininen" + ::msgcat::mcset fi "cancel" "peruuta" + ::msgcat::mcset fi "extension" "lis\u00e4osa" + ::msgcat::mcset fi "extensions" "lis\u00e4osat" + ::msgcat::mcset fi "green" "vihre\u00e4" + ::msgcat::mcset fi "ignore" "ohita" + ::msgcat::mcset fi "ok" + ::msgcat::mcset fi "red" "punainen" + ::msgcat::mcset fi "retry" "yrit\u00e4 uudelleen" + ::msgcat::mcset fi "yes" "kyll\u00e4" +} diff --git a/library/msgs/zh_cn.msg b/library/msgs/zh_cn.msg new file mode 100644 index 0000000..9a728b7 --- /dev/null +++ b/library/msgs/zh_cn.msg @@ -0,0 +1,92 @@ +namespace eval ::tk { + ::msgcat::mcset zh_cn "&Abort" "&中止" + ::msgcat::mcset zh_cn "&About..." "&关于……" + ::msgcat::mcset zh_cn "All Files" "所有文件" + ::msgcat::mcset zh_cn "Application Error" "应用程序错误" + ::msgcat::mcset zh_cn "&Apply" "&添加" + ::msgcat::mcset zh_cn "Bold" "粗体" + ::msgcat::mcset zh_cn "Bold Italic" "加粗斜体" + ::msgcat::mcset zh_cn "&Blue" "&蓝色" + ::msgcat::mcset zh_cn "Cancel" "取消" + ::msgcat::mcset zh_cn "&Cancel" "&取消" + ::msgcat::mcset zh_cn "Cannot change to the directory \"%1\$s\".\nPermission denied." "无法更改目录 \"%1\$s\"。\n访问被拒绝。" + ::msgcat::mcset zh_cn "Choose Directory" "选择文件夹" + ::msgcat::mcset zh_cn "Cl&ear" "清&除" + ::msgcat::mcset zh_cn "&Clear Console" "&清除终端" + ::msgcat::mcset zh_cn "Color" "颜色" + ::msgcat::mcset zh_cn "Console" "终端" + ::msgcat::mcset zh_cn "&Copy" "&复制" + ::msgcat::mcset zh_cn "Cu&t" "剪&切" + ::msgcat::mcset zh_cn "&Delete" "&删除" + ::msgcat::mcset zh_cn "Details >>" "详细信息 >>" + ::msgcat::mcset zh_cn "Directory \"%1\$s\" does not exist." "目录 \"%1\$s\" 不存在。" + ::msgcat::mcset zh_cn "&Directory:" "&目录:" + ::msgcat::mcset zh_cn "&Edit" "&编辑" + ::msgcat::mcset zh_cn "Effects" "效果" + ::msgcat::mcset zh_cn "Error: %1\$s" "错误: %1\$s" + ::msgcat::mcset zh_cn "E&xit" "退&出" + ::msgcat::mcset zh_cn "&File" "&文件" + ::msgcat::mcset zh_cn "File \"%1\$s\" already exists.\nDo you want to overwrite it?" "文件 \"%1\$s\" 已经存在。\n您想要覆盖它吗?" + ::msgcat::mcset zh_cn "File \"%1\$s\" already exists.\n\n" "文件 \"%1\$s\" 已经存在。\n\n" + ::msgcat::mcset zh_cn "File \"%1\$s\" does not exist." "文件 \"%1\$s\" 不存在。" + ::msgcat::mcset zh_cn "File &name:" "文件&名:" + ::msgcat::mcset zh_cn "File &names:" "文件&名:" + ::msgcat::mcset zh_cn "Files of &type:" "文件&类型:" + ::msgcat::mcset zh_cn "Fi&les:" "文&件:" + ::msgcat::mcset zh_cn "&Filter" "&过滤" + ::msgcat::mcset zh_cn "Fil&ter:" "过&滤:" + ::msgcat::mcset zh_cn "Font" "字体" + ::msgcat::mcset zh_cn "&Font:" "&字体:" + ::msgcat::mcset zh_cn "Font st&yle:" "字体&样式:" + ::msgcat::mcset zh_cn "&Green" "&绿色" + ::msgcat::mcset zh_cn "&Help" "&帮助" + ::msgcat::mcset zh_cn "Hi" "你好" + ::msgcat::mcset zh_cn "&Hide Console" "&隐藏终端" + ::msgcat::mcset zh_cn "&Ignore" "&忽略" + ::msgcat::mcset zh_cn "Invalid file name \"%1\$s\"." "无效的文件名 \"%1\$s\"。" + ::msgcat::mcset zh_cn "Italic" "斜体" + ::msgcat::mcset zh_cn "Log Files" "日志文件" + ::msgcat::mcset zh_cn "&No" "&取消" + ::msgcat::mcset zh_cn "&OK" "&确定" + ::msgcat::mcset zh_cn "OK" "确定" + ::msgcat::mcset zh_cn "Ok" "确定" + ::msgcat::mcset zh_cn "Open" "打开" + ::msgcat::mcset zh_cn "&Open" "&打开" + ::msgcat::mcset zh_cn "Open Multiple Files" "打开多个文件" + ::msgcat::mcset zh_cn "P&aste" "粘&贴" + ::msgcat::mcset zh_cn "&Quit" "&退出" + ::msgcat::mcset zh_cn "&Red" "红色" + ::msgcat::mcset zh_cn "Regular" "规则" + ::msgcat::mcset zh_cn "Replace existing file?" "替换已有文件?" + ::msgcat::mcset zh_cn "&Retry" "&重试" + ::msgcat::mcset zh_cn "Sample" "样式" + ::msgcat::mcset zh_cn "&Save" "&保存" + ::msgcat::mcset zh_cn "Save As" "另存为" + ::msgcat::mcset zh_cn "Save To Log" "保存到日志" + ::msgcat::mcset zh_cn "Select Log File" "选择日志文件" + ::msgcat::mcset zh_cn "Select a file to source" "选择一个源文件" + ::msgcat::mcset zh_cn "&Selection:" "&选择:" + ::msgcat::mcset zh_cn "&Size:" "&大小:" + ::msgcat::mcset zh_cn "Show &Hidden Directories" "显示&隐藏目录" + ::msgcat::mcset zh_cn "Show &Hidden Files and Directories" "显示&隐藏文件和目录" + ::msgcat::mcset zh_cn "Skip Messages" "跳过信息" + ::msgcat::mcset zh_cn "&Source..." "&来源……" + ::msgcat::mcset zh_cn "Stri&keout" "删&除线" + ::msgcat::mcset zh_cn "Tcl Scripts" "Tcl脚本" + ::msgcat::mcset zh_cn "Tcl for Windows" "适用于Windows的Tcl" + ::msgcat::mcset zh_cn "Text Files" "文本文档" + ::msgcat::mcset zh_cn "&Underline" "&下划线" + ::msgcat::mcset zh_cn "&Yes" "&确定" + ::msgcat::mcset zh_cn "abort" "中止" + ::msgcat::mcset zh_cn "blue" "蓝色" + ::msgcat::mcset zh_cn "cancel" "取消" + ::msgcat::mcset zh_cn "extension" "拓展" + ::msgcat::mcset zh_cn "extensions" "拓展" + ::msgcat::mcset zh_cn "green" "绿色" + ::msgcat::mcset zh_cn "ignore" "忽略" + ::msgcat::mcset zh_cn "ok" "确定" + ::msgcat::mcset zh_cn "red" "红色" + ::msgcat::mcset zh_cn "retry" "重试" + ::msgcat::mcset zh_cn "yes" "确认" +} + diff --git a/library/ttk/utils.tcl b/library/ttk/utils.tcl index 2571914..3d90880 100644 --- a/library/ttk/utils.tcl +++ b/library/ttk/utils.tcl @@ -236,8 +236,8 @@ proc ttk::Repeatedly {args} { after cancel $Repeat(timer) set script [uplevel 1 [list namespace code $args]] set Repeat(script) $script - uplevel #0 $script set Repeat(timer) [after $Repeat(delay) ttk::Repeat] + uplevel #0 $script } ## Repeat -- @@ -245,8 +245,8 @@ proc ttk::Repeatedly {args} { # proc ttk::Repeat {} { variable Repeat - uplevel #0 $Repeat(script) set Repeat(timer) [after $Repeat(interval) ttk::Repeat] + uplevel #0 $Repeat(script) } ## ttk::CancelRepeat -- |