diff options
author | bagnonm <bagnonm> | 2002-04-29 13:17:44 (GMT) |
---|---|---|
committer | bagnonm <bagnonm> | 2002-04-29 13:17:44 (GMT) |
commit | 93cf942168281704178bff93e0c868f3de6fbef1 (patch) | |
tree | 1c2d3bc843f7cc439cf97149c84acff495e00eb1 | |
parent | 09bf9bc63f9ba75fa56811474a18049ed8296e87 (diff) | |
download | tk-93cf942168281704178bff93e0c868f3de6fbef1.zip tk-93cf942168281704178bff93e0c868f3de6fbef1.tar.gz tk-93cf942168281704178bff93e0c868f3de6fbef1.tar.bz2 |
new feature, make dependence on msgcat soft, [539309]
-rw-r--r-- | library/bgerror.tcl | 26 | ||||
-rw-r--r-- | library/choosedir.tcl | 7 | ||||
-rw-r--r-- | library/clrpick.tcl | 24 | ||||
-rw-r--r-- | library/console.tcl | 35 | ||||
-rw-r--r-- | library/msgbox.tcl | 40 | ||||
-rw-r--r-- | library/tk.tcl | 60 | ||||
-rw-r--r-- | library/tkfbox.tcl | 64 | ||||
-rw-r--r-- | library/xmfbox.tcl | 32 |
8 files changed, 143 insertions, 145 deletions
diff --git a/library/bgerror.tcl b/library/bgerror.tcl index 5cb96c6..f18ef7b 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -9,10 +9,10 @@ # Copyright (c) 1998-2000 by Ajuba Solutions. # All rights reserved. # -# RCS: @(#) $Id: bgerror.tcl,v 1.17 2001/08/06 18:29:41 dgp Exp $ -# $Id: bgerror.tcl,v 1.17 2001/08/06 18:29:41 dgp Exp $ +# RCS: @(#) $Id: bgerror.tcl,v 1.18 2002/04/29 13:17:44 bagnonm Exp $ +# $Id: bgerror.tcl,v 1.18 2002/04/29 13:17:44 bagnonm Exp $ -option add *ErrorDialog.function.text [::msgcat::mc "Save To Log"] \ +option add *ErrorDialog.function.text [::tk::msgcat::mc "Save To Log"] \ widgetDefault option add *ErrorDialog.function.command "::tk::dialog::error::saveToLog" @@ -52,11 +52,11 @@ proc ::tk::dialog::error::saveToLog {text} { set allFiles "*" } set types [list \ - [list [::msgcat::mc "Log Files"] .log] \ - [list [::msgcat::mc "Text Files"] .txt] \ - [list [::msgcat::mc "All Files"] $allFiles] \ + [list [::tk::msgcat::mc "Log Files"] .log] \ + [list [::tk::msgcat::mc "Text Files"] .txt] \ + [list [::tk::msgcat::mc "All Files"] $allFiles] \ ] - set filename [tk_getSaveFile -title [::msgcat::mc "Select Log File"] \ + set filename [tk_getSaveFile -title [::tk::msgcat::mc "Select Log File"] \ -filetypes $types -defaultextension .log -parent .bgerrorDialog] if {![string length $filename]} { return @@ -93,12 +93,12 @@ proc ::bgerror err { # Ok the application's tkerror either failed or was not found # we use the default dialog then : if {$tcl_platform(platform) == "macintosh"} { - set ok [::msgcat::mc "Ok"] + set ok [::tk::msgcat::mc "Ok"] set messageFont system set textRelief "flat" set textHilight 0 } else { - set ok [::msgcat::mc "OK"] + set ok [::tk::msgcat::mc "OK"] set messageFont {Times -18} set textRelief "sunken" set textHilight 1 @@ -125,10 +125,10 @@ proc ::bgerror err { } set w .bgerrorDialog - set title [::msgcat::mc "Application Error"] - set text [::msgcat::mc "Error: %1\$s" $err] - set buttons [list ok $ok dismiss [::msgcat::mc "Skip Messages"] \ - function [::msgcat::mc "Details >>"]] + set title [::tk::msgcat::mc "Application Error"] + set text [::tk::msgcat::mc "Error: %1\$s" $err] + set buttons [list ok $ok dismiss [::tk::msgcat::mc "Skip Messages"] \ + function [::tk::msgcat::mc "Details >>"]] # 1. Create the top-level window and divide it into top # and bottom parts. diff --git a/library/choosedir.tcl b/library/choosedir.tcl index 8f1df99..f17dc7b 100644 --- a/library/choosedir.tcl +++ b/library/choosedir.tcl @@ -5,7 +5,7 @@ # Copyright (c) 1998-2000 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: choosedir.tcl,v 1.11 2001/09/17 14:12:18 dkf Exp $ +# RCS: @(#) $Id: choosedir.tcl,v 1.12 2002/04/29 13:17:44 bagnonm Exp $ # Make sure the tk::dialog namespace, in which all dialogs should live, exists namespace eval ::tk::dialog {} @@ -13,6 +13,7 @@ namespace eval ::tk::dialog::file {} # Make the chooseDir namespace inside the dialog namespace namespace eval ::tk::dialog::file::chooseDir { + namespace import ::tk::msgcat::* } # ::tk::dialog::file::chooseDir:: -- @@ -135,9 +136,9 @@ proc ::tk::dialog::file::chooseDir::Config {dataName argList} { tclParseConfigSpec ::tk::dialog::file::$dataName $specs "" $argList if {$data(-title) == ""} { - set data(-title) "[::msgcat::mc "Choose Directory"]" + set data(-title) "[mc "Choose Directory"]" } - + # Stub out the -multiple value for the dialog; it doesn't make sense for # choose directory dialogs, but we have to have something there because we # share so much code with the file dialogs. diff --git a/library/clrpick.tcl b/library/clrpick.tcl index 22aa355..1875ccd 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -3,7 +3,7 @@ # Color selection dialog for platforms that do not support a # standard color selection dialog. # -# RCS: @(#) $Id: clrpick.tcl,v 1.14 2001/11/12 18:30:53 hobbs Exp $ +# RCS: @(#) $Id: clrpick.tcl,v 1.15 2002/04/29 13:17:44 bagnonm Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # @@ -20,7 +20,9 @@ # Make sure namespaces exist namespace eval ::tk {} namespace eval ::tk::dialog {} -namespace eval ::tk::dialog::color {} +namespace eval ::tk::dialog::color { + namespace import ::tk::msgcat::* +} # ::tk::dialog::color:: -- # @@ -170,7 +172,7 @@ proc ::tk::dialog::color::Config {dataName argList} { set specs [list \ [list -initialcolor "" "" $defaultColor] \ [list -parent "" "" "."] \ - [list -title "" "" [::msgcat::mc "Color"]] \ + [list -title "" "" [mc "Color"]] \ ] # 2: parse the arguments @@ -203,12 +205,12 @@ proc ::tk::dialog::color::BuildDialog {w} { # StripsFrame contains the colorstrips and the individual RGB entries set stripsFrame [frame $topFrame.colorStrip] - set maxWidth [::msgcat::mcmax Red Green Blue] + set maxWidth [mcmax Red Green Blue] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set colorList [list \ - red [::msgcat::mc "Red"] \ - green [::msgcat::mc "Green"] \ - blue [::msgcat::mc "Blue"] \ + red [mc "Red"] \ + green [mc "Green"] \ + blue [mc "Blue"] \ ] foreach {color l} $colorList { # each f frame contains an [R|G|B] entry and the equiv. color strip. @@ -263,7 +265,7 @@ proc ::tk::dialog::color::BuildDialog {w} { # selected color # set selFrame [frame $topFrame.sel] - set lab [label $selFrame.lab -text [::msgcat::mc "Selection:"] \ + set lab [label $selFrame.lab -text [mc "Selection:"] \ -under 0 -anchor sw] set ent [entry $selFrame.ent \ -textvariable ::tk::dialog::color::[winfo name $w](selection) \ @@ -283,12 +285,12 @@ proc ::tk::dialog::color::BuildDialog {w} { # the botFrame frame contains the buttons # set botFrame [frame $w.bot -relief raised -bd 1] - set maxWidth [::msgcat::mcmax OK Cancel] + set maxWidth [mcmax OK Cancel] set maxWidth [expr {$maxWidth<8?8:$maxWidth}] - button $botFrame.ok -text [::msgcat::mc "OK"] \ + button $botFrame.ok -text [mc "OK"] \ -width $maxWidth -under 0 \ -command [list tk::dialog::color::OkCmd $w] - button $botFrame.cancel -text [::msgcat::mc "Cancel"] \ + button $botFrame.cancel -text [mc "Cancel"] \ -width $maxWidth -under 0 \ -command [list tk::dialog::color::CancelCmd $w] diff --git a/library/console.tcl b/library/console.tcl index 70c5f51..74ad76c 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -4,7 +4,7 @@ # can be used by non-unix systems that do not have built-in support # for shells. # -# RCS: @(#) $Id: console.tcl,v 1.17 2002/03/01 00:04:27 dgp Exp $ +# RCS: @(#) $Id: console.tcl,v 1.18 2002/04/29 13:17:44 bagnonm Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. @@ -14,7 +14,6 @@ # # TODO: history - remember partially written command -package require msgcat namespace eval ::tk::console { variable blinkTime 500 ; # msecs to blink braced range for @@ -60,38 +59,38 @@ proc ::tk::ConsoleInit {} { .menubar add cascade -label Edit -menu .menubar.edit -underline 0 menu .menubar.file -tearoff 0 - .menubar.file add command -label [::msgcat::mc "Source..."] \ + .menubar.file add command -label [mc "Source..."] \ -underline 0 -command tk::ConsoleSource - .menubar.file add command -label [::msgcat::mc "Hide Console"] \ + .menubar.file add command -label [mc "Hide Console"] \ -underline 0 -command {wm withdraw .} - .menubar.file add command -label [::msgcat::mc "Clear Console"] \ + .menubar.file add command -label [mc "Clear Console"] \ -underline 0 -command {.console delete 1.0 "promptEnd linestart"} if {[string compare $tcl_platform(platform) "macintosh"]} { - .menubar.file add command -label [::msgcat::mc "Exit"] \ + .menubar.file add command -label [mc "Exit"] \ -underline 1 -command exit } else { - .menubar.file add command -label [::msgcat::mc "Quit"] \ + .menubar.file add command -label [mc "Quit"] \ -command exit -accel Cmd-Q } menu .menubar.edit -tearoff 0 - .menubar.edit add command -label [::msgcat::mc "Cut"] -underline 2 \ + .menubar.edit add command -label [mc "Cut"] -underline 2 \ -command { event generate .console <<Cut>> } -accel "$mod+X" - .menubar.edit add command -label [::msgcat::mc "Copy"] -underline 0 \ + .menubar.edit add command -label [mc "Copy"] -underline 0 \ -command { event generate .console <<Copy>> } -accel "$mod+C" - .menubar.edit add command -label [::msgcat::mc "Paste"] -underline 1 \ + .menubar.edit add command -label [mc "Paste"] -underline 1 \ -command { event generate .console <<Paste>> } -accel "$mod+V" if {[string compare $tcl_platform(platform) "windows"]} { - .menubar.edit add command -label [::msgcat::mc "Clear"] -underline 2 \ + .menubar.edit add command -label [mc "Clear"] -underline 2 \ -command { event generate .console <<Clear>> } } else { - .menubar.edit add command -label [::msgcat::mc "Delete"] -underline 0 \ + .menubar.edit add command -label [mc "Delete"] -underline 0 \ -command { event generate .console <<Clear>> } -accel "Del" .menubar add cascade -label Help -menu .menubar.help -underline 0 menu .menubar.help -tearoff 0 - .menubar.help add command -label [::msgcat::mc "About..."] \ + .menubar.help add command -label [mc "About..."] \ -underline 0 -command tk::ConsoleAbout } @@ -124,7 +123,7 @@ proc ::tk::ConsoleInit {} { focus $con wm protocol . WM_DELETE_WINDOW { wm withdraw . } - wm title . [::msgcat::mc "Console"] + wm title . [mc "Console"] flush stdout $con mark set output [$con index "end - 1 char"] tk::TextSetCursor $con end @@ -141,10 +140,10 @@ proc ::tk::ConsoleInit {} { proc ::tk::ConsoleSource {} { set filename [tk_getOpenFile -defaultextension .tcl -parent . \ - -title [::msgcat::mc "Select a file to source"] \ + -title [mc "Select a file to source"] \ -filetypes [list \ - [list [::msgcat::mc "Tcl Scripts"] .tcl] \ - [list [::msgcat::mc "All Files"] *]]] + [list [mc "Tcl Scripts"] .tcl] \ + [list [mc "All Files"] *]]] if {[string compare $filename ""]} { set cmd [list source $filename] if {[catch {consoleinterp eval $cmd} result]} { @@ -577,7 +576,7 @@ proc ::tk::ConsoleExit {} { # None. proc ::tk::ConsoleAbout {} { - tk_messageBox -type ok -message "[::msgcat::mc {Tcl for Windows}] + tk_messageBox -type ok -message "[mc {Tcl for Windows}] Tcl $::tcl_patchLevel Tk $::tk_patchLevel" diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 6fdef49..c40f753 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.15 2001/08/06 18:29:41 dgp Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.16 2002/04/29 13:17:44 bagnonm Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -171,66 +171,66 @@ proc ::tk::MessageBox {args} { switch -- $data(-type) { abortretryignore { - set maxWidth [::msgcat::mcmax Abort Retry Ignore] + set maxWidth [mcmax Abort Retry Ignore] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ - [list abort -width $maxWidth -text [::msgcat::mc "Abort"] \ + [list abort -width $maxWidth -text [mc "Abort"] \ -under 0]\ - [list retry -width $maxWidth -text [::msgcat::mc "Retry"] \ + [list retry -width $maxWidth -text [mc "Retry"] \ -under 0]\ - [list ignore -width $maxWidth -text [::msgcat::mc "Ignore"] \ + [list ignore -width $maxWidth -text [mc "Ignore"] \ -under 0]\ ] } ok { set buttons [list \ - [list ok -width [::msgcat::mcmax OK] \ - -text [::msgcat::mc {OK}] -under 0] \ + [list ok -width [mcmax OK] \ + -text [mc {OK}] -under 0] \ ] if {[string equal $data(-default) ""]} { set data(-default) "ok" } } okcancel { - set maxWidth [::msgcat::mcmax OK Cancel] + set maxWidth [mcmax OK Cancel] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list ok -width $maxWidth \ - -text [::msgcat::mc "OK"] -under 0] \ + -text [mc "OK"] -under 0] \ [list cancel -width $maxWidth \ - -text [::msgcat::mc "Cancel"] -under 0] \ + -text [mc "Cancel"] -under 0] \ ] } retrycancel { - set maxWidth [::msgcat::mcmax Retry Cancel] + set maxWidth [mcmax Retry Cancel] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list retry -width $maxWidth \ - -text [::msgcat::mc "Retry"] -under 0] \ + -text [mc "Retry"] -under 0] \ [list cancel -width $maxWidth \ - -text [::msgcat::mc "Cancel"] -under 0] \ + -text [mc "Cancel"] -under 0] \ ] } yesno { - set maxWidth [::msgcat::mcmax Yes No] + set maxWidth [mcmax Yes No] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list yes -width $maxWidth \ - -text [::msgcat::mc "Yes"] -under 0]\ + -text [mc "Yes"] -under 0]\ [list no -width $maxWidth \ - -text [::msgcat::mc "No"] -under 0]\ + -text [mc "No"] -under 0]\ ] } yesnocancel { - set maxWidth [::msgcat::mcmax Yes No Cancel] + set maxWidth [mcmax Yes No Cancel] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] set buttons [list \ [list yes -width $maxWidth \ - -text [::msgcat::mc "Yes"] -under 0]\ + -text [mc "Yes"] -under 0]\ [list no -width $maxWidth \ - -text [::msgcat::mc "No"] -under 0]\ + -text [mc "No"] -under 0]\ [list cancel -width $maxWidth \ - -text [::msgcat::mc "Cancel"] -under 0]\ + -text [mc "Cancel"] -under 0]\ ] } default { diff --git a/library/tk.tcl b/library/tk.tcl index 0eb7641..4e1cb87 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.37 2002/04/26 16:39:07 bagnonm Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.38 2002/04/29 13:17:44 bagnonm Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -17,40 +17,34 @@ package require -exact Tk 8.4 package require -exact Tcl 8.4 # Create a ::tk namespace - namespace eval ::tk { -} - -if { ![interp issafe] } { - if {[catch {package require msgcat}]} { - # msgcat not found. A minimal msgcat is defined - # here, with fail-safe versions of the msgcat::mc and - # msgcat::mcmax procedures, which happen to be the msgcat - # services used by tk widgets. - # See the msgcat package for details about the simulated - # procedures. - namespace eval msgcat { - namespace export mc mcmax - - proc mc {src args} { - return [eval [list format $src $args]] - } - - proc mcmax {args} { - set max 0 - foreach string $args { - set len [string length [msgcat::mc $string]] - if {$len>$max} { - set max $len - } - } - return $max - } - - } - } else { - ::msgcat::mcload [file join $::tk_library msgs] + # Set up the msgcat commands + namespace eval msgcat { + namespace export mc mcmax + if {[interp issafe] || [catch {package require msgcat}]} { + # The msgcat package is not available. Supply our own + # minimal replacement. + proc mc {src args} { + return [eval [list format $src] $args] + } + proc mcmax {args} { + set max 0 + foreach string $args { + set len [string length $string] + if {$len>$max} { + set max $len + } + } + return $max + } + } else { + # Get the commands from the msgcat package that Tk uses. + namespace import ::msgcat::mc + namespace import ::msgcat::mcmax + ::msgcat::mcload [file join $::tk_library msgs] + } } + namespace import ::tk::msgcat::* } # Add Tk's directory to the end of the auto-load search path, if it diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 62b5b6b..0522210 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -11,7 +11,7 @@ # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.32 2001/12/14 14:56:46 dkf Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.33 2002/04/29 13:17:44 bagnonm Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -766,7 +766,9 @@ proc ::tk::IconList_Reset {w} { #---------------------------------------------------------------------- namespace eval ::tk::dialog {} -namespace eval ::tk::dialog::file {} +namespace eval ::tk::dialog::file { + namespace import ::tk::msgcat::* +} # ::tk::dialog::file:: -- # @@ -925,9 +927,9 @@ proc ::tk::dialog::file::Config {dataName type argList} { if {$data(-title) == ""} { if {[string equal $type "open"]} { - set data(-title) "[::msgcat::mc "Open"]" + set data(-title) "[mc "Open"]" } else { - set data(-title) "[::msgcat::mc "Save As"]" + set data(-title) "[mc "Save As"]" } } @@ -977,7 +979,7 @@ proc ::tk::dialog::file::Create {w class} { # f1: the frame with the directory option menu # set f1 [frame $w.f1] - label $f1.lab -text "[::msgcat::mc "Directory:"]" -under 0 + label $f1.lab -text "[mc "Directory:"]" -under 0 set data(dirMenuBtn) $f1.menu set data(dirMenu) [tk_optionMenu $f1.menu [format %s(selectPath) ::tk::dialog::file::$dataName] ""] set data(upBtn) [button $f1.up] @@ -1005,17 +1007,17 @@ static char updir_bits[] = { # if { [string equal $class TkFDialog] } { if { $data(-multiple) } { - set fNameCaption "[::msgcat::mc {File names:}]" + set fNameCaption "[mc {File names:}]" } else { - set fNameCaption "[::msgcat::mc {File name:}]" + set fNameCaption "[mc {File name:}]" } - set fTypeCaption [::msgcat::mc "Files of type:"] - set fCaptionWidth [::msgcat::mcmax $fNameCaption $fTypeCaption] + set fTypeCaption [mc "Files of type:"] + set fCaptionWidth [mcmax $fNameCaption $fTypeCaption] set fCaptionWidth [expr {$fCaptionWidth<14?14:$fCaptionWidth}] set fNameUnder 5 set iconListCommand [list ::tk::dialog::file::OkCmd $w] } else { - set fNameCaption [::msgcat::mc "Selection:"] + set fNameCaption [mc "Selection:"] set fNameUnder 0 set fCaptionWidth [string length $fNameCaption] set iconListCommand [list ::tk::dialog::file::chooseDir::DblClick $w] @@ -1068,11 +1070,11 @@ static char updir_bits[] = { # the okBtn is created after the typeMenu so that the keyboard traversal # is in the right order - set maxWidth [::msgcat::mcmax OK Cancel] + set maxWidth [mcmax OK Cancel] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] - set data(okBtn) [button $f2.ok -text "[::msgcat::mc "OK"]" \ + set data(okBtn) [button $f2.ok -text "[mc "OK"]" \ -under 0 -width $maxWidth -default active -pady 3] - set data(cancelBtn) [button $f3.cancel -text "[::msgcat::mc "Cancel"]" \ + set data(cancelBtn) [button $f3.cancel -text "[mc "Cancel"]" \ -under 0 -width $maxWidth -default normal -pady 3] # pack the widgets in f2 and f3 @@ -1148,9 +1150,9 @@ proc ::tk::dialog::file::SetSelectMode {w multi} { set dataName __tk_filedialog upvar ::tk::dialog::file::$dataName data if { $multi } { - set fNameCaption "[::msgcat::mc {File names:}]" + set fNameCaption "[mc {File names:}]" } else { - set fNameCaption "[::msgcat::mc {File name:}]" + set fNameCaption "[mc {File name:}]" } set fNameUnder 5 set iconListCommand [list ::tk::dialog::file::OkCmd $w] @@ -1222,7 +1224,7 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}] # we normally won't come to here. Anyways, give an error and abort # action. tk_messageBox -type ok -parent $w -message \ - "[::msgcat::mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $data(selectPath)]"\ + "[mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $data(selectPath)]"\ -icon warning cd $appPWD return @@ -1305,15 +1307,15 @@ rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}] # Restore the Open/Save Button if this is a File Dialog # if {[string equal $data(type) open]} { - $data(okBtn) config -text "[::msgcat::mc "Open"]" - set maxWidth [string length [::msgcat::mc "Open"]] + $data(okBtn) config -text "[mc "Open"]" + set maxWidth [string length [mc "Open"]] if {$maxWidth>[$data(okBtn) cget -width]} { $data(okBtn) config -width $maxWidth $data(cancelBtn) config -width $maxWidth } } else { - $data(okBtn) config -text "[::msgcat::mc "Save"]" - set maxWidth [string length [::msgcat::mc "Save"]] + $data(okBtn) config -text "[mc "Save"]" + set maxWidth [string length [mc "Save"]] if {$maxWidth>[$data(okBtn) cget -width]} { $data(okBtn) config -width $maxWidth $data(cancelBtn) config -width $maxWidth @@ -1506,9 +1508,9 @@ proc ::tk::dialog::file::EntFocusIn {w} { if { [string equal [winfo class $w] TkFDialog] } { # If this is a File Dialog, make sure the buttons are labeled right. if {[string equal $data(type) open]} { - $data(okBtn) config -text "[::msgcat::mc "Open"]" + $data(okBtn) config -text "[mc "Open"]" } else { - $data(okBtn) config -text "[::msgcat::mc "Save"]" + $data(okBtn) config -text "[mc "Save"]" } } } @@ -1575,7 +1577,7 @@ proc ::tk::dialog::file::VerifyFileName {w filename} { FILE { if {[string equal $data(type) open]} { tk_messageBox -icon warning -type ok -parent $w \ - -message "[::msgcat::mc "File \"%1\$s\" does not exist." [file join $path $file]]" + -message "[mc "File \"%1\$s\" does not exist." [file join $path $file]]" $data(ent) selection range 0 end $data(ent) icursor end } else { @@ -1590,20 +1592,20 @@ proc ::tk::dialog::file::VerifyFileName {w filename} { } PATH { tk_messageBox -icon warning -type ok -parent $w \ - -message "[::msgcat::mc "Directory \"%1\$s\" does not exist." $path]" + -message "[mc "Directory \"%1\$s\" does not exist." $path]" $data(ent) selection range 0 end $data(ent) icursor end } CHDIR { tk_messageBox -type ok -parent $w -message \ - "[::msgcat::mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $path]"\ + "[mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $path]"\ -icon warning $data(ent) selection range 0 end $data(ent) icursor end } ERROR { tk_messageBox -type ok -parent $w -message \ - "[::msgcat::mc "Invalid file name \"%1\$s\"." $path]"\ + "[mc "Invalid file name \"%1\$s\"." $path]"\ -icon warning $data(ent) selection range 0 end $data(ent) icursor end @@ -1708,14 +1710,14 @@ proc ::tk::dialog::file::ListBrowse {w} { if { [string equal [winfo class $w] TkFDialog] } { if {[string equal $data(type) open]} { - $data(okBtn) config -text "[::msgcat::mc "Open"]" + $data(okBtn) config -text "[mc "Open"]" } else { - $data(okBtn) config -text "[::msgcat::mc "Save"]" + $data(okBtn) config -text "[mc "Save"]" } } } else { if { [string equal [winfo class $w] TkFDialog] } { - $data(okBtn) config -text "[::msgcat::mc "Open"]" + $data(okBtn) config -text "[mc "Open"]" } } } @@ -1738,7 +1740,7 @@ proc ::tk::dialog::file::ListInvoke {w filenames} { set appPWD [pwd] if {[catch {cd $file}]} { tk_messageBox -type ok -parent $w -message \ - "[::msgcat::mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $file]"\ + "[mc "Cannot change to the directory \"%1\$s\".\nPermission denied." $file]"\ -icon warning } else { cd $appPWD @@ -1785,7 +1787,7 @@ proc ::tk::dialog::file::Done {w {selectFilePath ""}} { if {[file exists $selectFilePath]} { set reply [tk_messageBox -icon warning -type yesno\ -parent $w -message \ - "[::msgcat::mc "File \"%1\$s\" already exists.\nDo you want to overwrite it?" $selectFilePath]"] + "[mc "File \"%1\$s\" already exists.\nDo you want to overwrite it?" $selectFilePath]"] if {[string equal $reply "no"]} { return } diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl index 58f5496..e2c9194 100644 --- a/library/xmfbox.tcl +++ b/library/xmfbox.tcl @@ -4,7 +4,7 @@ # Unix platform. This implementation is used only if the # "::tk_strictMotif" flag is set. # -# RCS: @(#) $Id: xmfbox.tcl,v 1.18 2001/10/16 23:39:32 hobbs Exp $ +# RCS: @(#) $Id: xmfbox.tcl,v 1.19 2002/04/29 13:17:44 bagnonm Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Scriptics Corporation @@ -237,12 +237,12 @@ proc ::tk::MotifFDialog_Config {dataName type argList} { if {[string equal $data(-title) ""]} { if {[string equal $type "open"]} { if {$data(-multiple) != 0} { - set data(-title) "[::msgcat::mc {Open Multiple Files}]" + set data(-title) "[mc {Open Multiple Files}]" } else { - set data(-title) [::msgcat::mc "Open"] + set data(-title) [mc "Open"] } } else { - set data(-title) [::msgcat::mc "Save As"] + set data(-title) [mc "Save As"] } } @@ -323,7 +323,7 @@ proc ::tk::MotifFDialog_BuildUI {w} { # The Filter box # - label $f1.lab -text [::msgcat::mc "Filter:"] -under 3 -anchor w + label $f1.lab -text [mc "Filter:"] -under 3 -anchor w entry $f1.ent pack $f1.lab -side top -fill x -padx 6 -pady 4 pack $f1.ent -side top -fill x -padx 4 -pady 0 @@ -332,13 +332,13 @@ proc ::tk::MotifFDialog_BuildUI {w} { # The file and directory lists # set data(dList) [MotifFDialog_MakeSList $w $f2a \ - [::msgcat::mc "Directory:"] 0 DList] + [mc "Directory:"] 0 DList] set data(fList) [MotifFDialog_MakeSList $w $f2b \ - [::msgcat::mc "Files:"] 2 FList] + [mc "Files:"] 2 FList] # The Selection box # - label $f3.lab -text [::msgcat::mc "Selection:"] -under 0 -anchor w + label $f3.lab -text [mc "Selection:"] -under 0 -anchor w entry $f3.ent pack $f3.lab -side top -fill x -padx 6 -pady 0 pack $f3.ent -side top -fill x -padx 4 -pady 4 @@ -346,15 +346,15 @@ proc ::tk::MotifFDialog_BuildUI {w} { # The buttons # - set maxWidth [::msgcat::mcmax OK Filter Cancel] + set maxWidth [mcmax OK Filter Cancel] set maxWidth [expr {$maxWidth<6?6:$maxWidth}] - set data(okBtn) [button $bot.ok -text [::msgcat::mc "OK"] \ + set data(okBtn) [button $bot.ok -text [mc "OK"] \ -width $maxWidth -under 0 \ -command [list tk::MotifFDialog_OkCmd $w]] - set data(filterBtn) [button $bot.filter -text [::msgcat::mc "Filter"] \ + set data(filterBtn) [button $bot.filter -text [mc "Filter"] \ -width $maxWidth -under 0 \ -command [list tk::MotifFDialog_FilterCmd $w]] - set data(cancelBtn) [button $bot.cancel -text [::msgcat::mc "Cancel"] \ + set data(cancelBtn) [button $bot.cancel -text [mc "Cancel"] \ -width $maxWidth -under 0 \ -command [list tk::MotifFDialog_CancelCmd $w]] @@ -812,7 +812,7 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} { set item [file join $data(selectPath) $item] } elseif {![file exists [file dirname $item]]} { tk_messageBox -icon warning -type ok \ - -message [::msgcat::mc {Directory "%1$s" does not exist.} \ + -message [mc {Directory "%1$s" does not exist.} \ [file dirname $item]] return } @@ -820,16 +820,16 @@ proc ::tk::MotifFDialog_ActivateSEnt {w} { if {![file exists $item]} { if {[string equal $data(type) open]} { tk_messageBox -icon warning -type ok \ - -message [::msgcat::mc {File "$item" does not exist.} \ + -message [mc {File "$item" does not exist.} \ $item] return } } else { if {[string equal $data(type) save]} { set message [format %s%s \ - [::msgcat::mc {File "%1$s" already exists.\n\n} \ + [mc {File "%1$s" already exists.\n\n} \ $selectFilePath ] \ - [::msgcat::mc {Replace existing file?}]] + [mc {Replace existing file?}]] set answer [tk_messageBox -icon warning -type yesno \ -message $message] if {[string equal $answer "no"]} { |