Tk Source Code

Check-in [027bebf1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:TIP 382 test suite update and Motif dialog implementation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 027bebf1ed82c66a746d3737275b851061ebd5c2
User & Date: dgp 2011-10-31 14:08:04
Context
2011-11-01
22:48
* generic/tkObj.c (GetPixelsFromObjEx): [Bug 3431491]: Use a bit of type hackery to allow numbers to be interpreted as coordinates (most notably on a canvas) without reinterpreting via a string.
check-in: 87ccf454 user: dkf tags: trunk
2011-10-31
14:08
TIP 382 test suite update and Motif dialog implementation. check-in: 027bebf1 user: dgp tags: trunk
14:07
TIP 382 test suite update and Motif dialog implementation. check-in: 3ddf3698 user: dgp tags: core-8-5-branch
2011-10-26
14:28
Update changes toward 8.6b3 release. check-in: 7d6d9a74 user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/xmfbox.tcl.

242
243
244
245
246
247
248


249

250

251
252
253
254
255
256
257
	{-parent "" "" "."}
	{-title "" "" ""}
	{-typevariable "" "" ""}
    }
    if {$type eq "open"} {
	lappend specs {-multiple "" "" "0"}
    }




    set data(-multiple) 0

    # 2: default values depending on the type of the dialog
    #
    if {![info exists data(selectPath)]} {
	# first time the dialog has been popped up
	set data(selectPath) [pwd]
	set data(selectFile) ""
    }







>
>
|
>

>







242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
	{-parent "" "" "."}
	{-title "" "" ""}
	{-typevariable "" "" ""}
    }
    if {$type eq "open"} {
	lappend specs {-multiple "" "" "0"}
    }
    if {$type eq "save"} {
	lappend specs {-confirmoverwrite "" "" "1"}
    }

    set data(-multiple) 0
    set data(-confirmoverwrite) 1
    # 2: default values depending on the type of the dialog
    #
    if {![info exists data(selectPath)]} {
	# first time the dialog has been popped up
	set data(selectPath) [pwd]
	set data(selectFile) ""
    }
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857

	if {![file exists $item]} {
	    if {$data(type) eq "open"} {
		tk_messageBox -icon warning -type ok \
			-message [mc {File "%1$s" does not exist.} $item]
		return
	    }
	} elseif {$data(type) eq "save"} {
	    set message [format %s%s \
		    [mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \
		    [mc {Replace existing file?}]]
	    set answer [tk_messageBox -icon warning -type yesno \
		    -message $message]
	    if {$answer eq "no"} {
		return







|







847
848
849
850
851
852
853
854
855
856
857
858
859
860
861

	if {![file exists $item]} {
	    if {$data(type) eq "open"} {
		tk_messageBox -icon warning -type ok \
			-message [mc {File "%1$s" does not exist.} $item]
		return
	    }
	} elseif {$data(type) eq "save" && $data(-confirmoverwrite)} {
	    set message [format %s%s \
		    [mc "File \"%1\$s\" already exists.\n\n" $selectFilePath] \
		    [mc {Replace existing file?}]]
	    set answer [tk_messageBox -icon warning -type yesno \
		    -message $message]
	    if {$answer eq "no"} {
		return

Changes to tests/filebox.test.

107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
if {$tcl_platform(platform) == "unix"} {
    set modes "0 1"
} else {
    set modes 1
}

set unknownOptionsMsg(tk_getOpenFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable}
set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable}

set tmpFile "filebox.tmp"
makeFile {
    # this file can be empty!
} $tmpFile

array set filters {







|







107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
if {$tcl_platform(platform) == "unix"} {
    set modes "0 1"
} else {
    set modes 1
}

set unknownOptionsMsg(tk_getOpenFile) {bad option "-foo": must be -defaultextension, -filetypes, -initialdir, -initialfile, -multiple, -parent, -title, or -typevariable}
set unknownOptionsMsg(tk_getSaveFile) {bad option "-foo": must be -confirmoverwrite, -defaultextension, -filetypes, -initialdir, -initialfile, -parent, -title, or -typevariable}

set tmpFile "filebox.tmp"
makeFile {
    # this file can be empty!
} $tmpFile

array set filters {