Changeset 325
- Timestamp:
- Dec 4, 2009 5:04:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsascmds.tcl
- Property rcs:date changed from 2000/10/12 22:12:21 to 2000/10/17 15:20:45
- Property rcs:lines changed from +3 -3 to +82 -49
- Property rcs:rev changed from 1.25 to 1.26
r324 r325 3 3 if {$tcl_platform(platform) == "windows"} { 4 4 if [catch {package require winexec}] { 5 tk_dialog .err "WINEXEC Error" \ 6 "Error -- Unable to load the WINEXEC package. This is needed in Win95 machines" \ 7 error 0 Quit 5 MyMessageBox -parent . -title "WINEXEC Error" \ 6 -message "Error -- Unable to load the WINEXEC package. This is needed in Win95 machines" \ 7 -icon error -type Quit -default quit \ 8 -helplink "expgui_Win_readme.html Winexec" 8 9 destroy . 9 10 } 10 11 if ![file exists [file join $expgui(gsasdir) fonts grfont.dat]] { 11 tk_dialog .err "PGPLOT Error" \ 12 "Warning -- Unable to find file GRFONT.DAT. GSAS graphics will not work. Is GSAS correctly installed?" \ 13 warning 0 "Limp Ahead" 12 MyMessageBox -parent . -title "PGPLOT Error" \ 13 -message "Warning -- Unable to find file GRFONT.DAT. GSAS graphics will not work. Is GSAS correctly installed?" \ 14 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \ 15 -helplink "expguierr.html NoPGPLOT" 14 16 } 15 17 … … 29 31 # check the path -- can DOS use it? 30 32 if {[string first // [pwd]] != -1} { 31 tk_dialog .braindead "Invalid Path" \ 32 {Error -- Use "Map network drive" to access this directory with a letter (e.g. F:) \ 33 Win-95 can't directly access a network drive in DOS} error 0 OK 33 MyMessageBox -parent . -title "Invalid Path" \ 34 -message {Error -- Use "Map network drive" to access this directory with a letter (e.g. F:) GSAS can't directly access a network drive} \ 35 -icon error -type ok -default ok \ 36 -helplink "expgui_Win_readme.html NetPath" 34 37 return 35 38 } … … 78 81 } 79 82 } else { 83 if ![file exists [file join $expgui(gsasdir) pgl grfont.dat]] { 84 MyMessageBox -parent . -title "PGPLOT Error" \ 85 -message "Warning -- Unable to find file grfont.dat. GSAS graphics will not work. Is GSAS correctly installed?" \ 86 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \ 87 -helplink "expguierr.html NoPGPLOT" 88 } 80 89 if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1} 81 90 … … 305 314 catch {destroy .comp} 306 315 toplevel .comp 307 bind .comp <Key-F1> "MakeWWWHelp expgui err.html Composition"316 bind .comp <Key-F1> "MakeWWWHelp expgui.html Composition" 308 317 wm title .comp Composition 309 318 pack [label .comp.results -text $text \ … … 316 325 -command "writelst [list $text] ; destroy .comp"] -side left 317 326 pack [button .comp.box.help -text Help -bg yellow \ 318 -command "MakeWWWHelp expgui err.html Composition"] \327 -command "MakeWWWHelp expgui.html Composition"] \ 319 328 -side right 320 329 } … … 337 346 toplevel .export 338 347 wm title .export "Export coordinates" 339 bind .export <Key-F1> "MakeWWWHelp expgui err.html ExportMSI"348 bind .export <Key-F1> "MakeWWWHelp expgui.html ExportMSI" 340 349 pack [label .export.lbl -text "Export coordinates in MSI .xtl format"\ 341 350 ] -side top -anchor center … … 360 369 pack [button .export.but.2 -text Quit -command "destroy .export"] -side left 361 370 pack [button .export.but.help -text Help -bg yellow \ 362 -command "MakeWWWHelp expgui err.html ExportMSI"] \371 -command "MakeWWWHelp expgui.html ExportMSI"] \ 363 372 -side right 364 373 # force the window to stay on top … … 452 461 } else { 453 462 catch {close $fp} 454 tk_dialog .ok "Done" \ 455 "File [file tail $filnam] written in directory [file dirname $filnam]" \ 456 warning 0 "OK" 463 MyMessageBox -parent . -title "Done" \ 464 -message "File [file tail $filnam] was written in directory [file dirname $filnam]" 457 465 } 458 466 if {[llength $expmap(phaselist)] == 1} {destroy .export} … … 477 485 toplevel $frm 478 486 wm title $frm "Convert File" 479 bind $frm <Key-F1> "MakeWWWHelp expgui err.html ConvertUnix"487 bind $frm <Key-F1> "MakeWWWHelp expgui.html ConvertUnix" 480 488 481 489 pack [frame [set frm0 $frm.0] -bd 2 -relief groove] \ … … 503 511 pack [button $frmC.q -text Quit -command "set infile(done) 1"] -side left 504 512 pack [button $frmC.help -text Help -bg yellow \ 505 -command "MakeWWWHelp expgui err.html ConvertUnix"] \513 -command "MakeWWWHelp expgui.html ConvertUnix"] \ 506 514 -side right 507 515 … … 540 548 541 549 if {$infile(name) == $outfile(name)} { 550 MyMessageBox -parent . -title Notify \ 551 -message "Sorry, filenames must differ" \ 552 -icon warning -helplink "expguierr.html ConvSameName" 542 553 tk_dialog .warn Notify "Sorry, filenames must differ" warning 0 OK 543 554 return 544 555 } 545 556 if ![file exists [file join $infile(dir) $infile(name)]] { 546 tk_dialog .warn Notify \ 547 "Sorry, file $infile(name) not found in $infile(dir)" warning 0 OK 557 MyMessageBox -parent . -title Notify \ 558 -message "Sorry, file $infile(name) not found in $infile(dir)" \ 559 -icon warning -helplink "expguierr.html ConvNotFound" 548 560 return 549 561 } 550 562 if [file exists [file join $outfile(dir) $outfile(name)]] { 551 if [tk_dialog .warn Notify \ 552 "Warning: file $outfile(name) exists in $outfile(dir). OK to overwrite?" \ 553 warning 0 OK No] return 563 set ans [MyMessageBox -parent . -title "Overwrite?" \ 564 -message "Warning: file $outfile(name) exists in $outfile(dir). OK to overwrite?" \ 565 -icon warning -type {Overwrite Cancel} -default Overwrite \ 566 -helplink "expguierr.html OverwriteCnv"] 567 if {[string tolower $ans] == "cancel"} return 554 568 } 555 569 if [catch { … … 579 593 580 594 pack [frame $bx.a -width 200 -height 75] -side top -expand yes -fill both 581 listbox $bx.a.files -relief raised -bd 2 -yscrollcommand "$bx.a.scroll set" \ 582 -height 15 -width 0 595 listbox $bx.a.files -relief raised -bd 2 \ 596 -yscrollcommand "$bx.a.scroll set" \ 597 -height 15 -width 0 -exportselection 0 583 598 scrollbar $bx.a.scroll -command "$bx.a.files yview" 584 599 unixFilChoose $bx $bx.a.files $filvar $diropt … … 667 682 toplevel $frm 668 683 wm title $frm "Convert File" 669 bind $frm <Key-F1> "MakeWWWHelp expgui err.html ConvertWin"684 bind $frm <Key-F1> "MakeWWWHelp expgui.html ConvertWin" 670 685 pack [frame [set frmA $frm.1] -bd 2 -relief groove] -padx 3 -pady 3 -side left 671 686 pack [frame [set frmC $frm.3] ] -padx 3 -pady 3 \ 672 687 -side left -fill y -expand yes 673 688 pack [button $frmC.help -text Help -bg yellow \ 674 -command "MakeWWWHelp expgui err.html ConvertWin"] -side top689 -command "MakeWWWHelp expgui.html ConvertWin"] -side top 675 690 pack [button $frmC.q -text Quit -command "destroy $frm"] -side bottom 676 691 pack [button $frmC.b -text Convert -command "ValidWinCnv $frm"] \ … … 721 736 set oldname "[file rootname $file].org" 722 737 if [file exists $oldname] { 723 set ans [tk_dialog .warn "OK to overwrite?" \ 724 "File [file tail $oldname] exists in [file dirname $oldname]. OK to overwrite?" question 0 \ 725 "Yes" "No"] 726 if $ans return 738 set ans [MyMessageBox -parent . -title "Overwrite?" \ 739 -message "File [file tail $oldname] exists in [file dirname $oldname]. OK to overwrite?" \ 740 -icon warning -type {Overwrite Cancel} -default Overwrite \ 741 -helplink "expguierr.html OverwriteCnv"] 742 if {[string tolower $ans] == "cancel"} return 727 743 catch {file delete $oldname} 728 744 } … … 787 803 -command "updir; ChooseWinCnv $frm" ] 788 804 pack [frame $bx.a -width 200 -height 75] -side top -expand yes -fill both 789 listbox $bx.a.files -relief raised -bd 2 \805 listbox $bx.a.files -relief raised -bd 2 -exportselection 0 \ 790 806 -yscrollcommand "sync2boxes $bx.a.files $bx.a.dates $bx.a.scroll" \ 791 807 -height 15 -width 0 792 listbox $bx.a.dates -relief raised -bd 2 \808 listbox $bx.a.dates -relief raised -bd 2 -exportselection 0 \ 793 809 -yscrollcommand "sync2boxes $bx.a.dates $bx.a.files $bx.a.scroll" \ 794 810 -height 15 -width 0 -takefocus 0 … … 887 903 $expgui(FileDirButtonMenu) delete 0 end 888 904 set list "" 905 catch {set list [file volume]} 889 906 set dir "" 890 907 foreach subdir [file split [set expgui(FileMenuDir)]] { … … 935 952 toplevel $frm 936 953 wm title $frm "Experiment file" 954 bind $frm <Key-F1> "MakeWWWHelp expguierr.html open" 937 955 pack [frame [set frmA $frm.1] -bd 2 -relief groove] -padx 3 -pady 3 -side left 938 pack [frame [set frmC $frm.3] ] -padx 3 -pady 3 -side left 956 pack [frame [set frmC $frm.3] ] -padx 3 -pady 3 -side left \ 957 -fill y -expand yes 958 pack [button $frmC.help -text Help -bg yellow \ 959 -command "MakeWWWHelp expguierr.html open"] \ 960 -side top -anchor e 939 961 pack [label $frmC.2 -text "Sort .EXP files by" ] -side top 940 962 pack [radiobutton $frmC.1 -text "File Name" -value 1 \ … … 943 965 -variable expgui(filesort) -command "ChooseExpFil $frmA"] -side top 944 966 pack [button $frmC.b -text Read \ 945 -command "valid_exp_file $frmA $mode"] -side top967 -command "valid_exp_file $frmA $mode"] -side bottom 946 968 if {$mode == "new"} { 947 969 $frmC.b config -text Save 948 970 } 949 971 pack [button $frmC.q -text Quit \ 950 -command "set expgui(FileMenuEXPNAM) {}; destroy $frm"] -side top972 -command "set expgui(FileMenuEXPNAM) {}; destroy $frm"] -side bottom 951 973 bind $frm <Return> "$frmC.b invoke" 952 974 … … 1008 1030 set file [file join $expgui(FileMenuDir) $expgui(FileMenuEXPNAM)] 1009 1031 if {$mode == "new" && [file exists $file]} { 1010 set ans [tk_dialog .expFileErrorMsg "File Open Error" \ 1011 "File [file tail $file] already exists in [file dirname $file]. OK to overwrite?" question 0 \ 1012 "Select other name" "Overwrite"] 1032 set ans [ 1033 MyMessageBox -parent . -title "File Open Error" \ 1034 -message "File [file tail $file] already exists in [file dirname $file]. OK to overwrite?" \ 1035 -icon question -type {"Select other" "Overwrite"} -default "select other" \ 1036 -helplink "expguierr.html OverwriteErr" 1037 ] 1038 if {[string tolower $ans] == "overwrite"} {destroy .file} 1013 1039 if $ans {destroy .file} 1014 1040 return … … 1022 1048 } 1023 1049 if {$mode == "old" && ![file exists $file]} { 1024 set ans [tk_dialog .expFileErrorMsg "File Open Error" \ 1025 "File [file tail $file] does not exist in [file dirname $file]. OK to create?" question 0 \ 1026 "Select other name" "Create"] 1027 if $ans {destroy .file} 1050 set ans [ 1051 MyMessageBox -parent . -title "File Open Error" \ 1052 -message "File [file tail $file] does not exist in [file dirname $file]. OK to create?" \ 1053 -icon question -type {"Select other" "Create"} -default "select other" \ 1054 -helplink "expguierr.html OpenErr" 1055 ] 1056 if {[string tolower $ans] == "create"} {destroy .file} 1028 1057 return 1029 1058 } … … 1143 1172 # also called when box is created to fill it 1144 1173 proc ChooseExpFil {frm} { 1145 global expgui 1174 global expgui tcl_platform 1146 1175 set files $frm.a.files 1147 1176 set dates $frm.a.dates … … 1184 1213 $expgui(FileDirButtonMenu) delete 0 end 1185 1214 set list "" 1215 if {$tcl_platform(platform) == "windows"} { 1216 catch {set list [file volume]} 1217 } 1218 1186 1219 set dir "" 1187 1220 foreach subdir [file split [set expgui(FileMenuDir)]] { … … 1503 1536 eval button [list $w.$name] $opts [list -command [list set tkPriv(button) $name]] 1504 1537 1505 if {![string compare $name $data(-default)]} {1538 if {![string compare $name [string tolower $data(-default)]]} { 1506 1539 $w.$name configure -default active 1507 1540 } … … 1523 1556 1524 1557 if {[string compare $data(-default) ""]} { 1525 bind $w <Return> [list tkButtonInvoke $w. $data(-default)]1558 bind $w <Return> [list tkButtonInvoke $w.[string tolower $data(-default)]] 1526 1559 } 1527 1560 … … 1561 1594 grab $w 1562 1595 if {[string compare $data(-default) ""]} { 1563 focus $w. $data(-default)1596 focus $w.[string tolower $data(-default)] 1564 1597 } else { 1565 1598 focus $w … … 1587 1620 catch {destroy $frm} 1588 1621 toplevel $frm 1589 bind $frm <Key-F1> "MakeWWWHelp expgui err.html DeleteHistoryRecords"1622 bind $frm <Key-F1> "MakeWWWHelp expgui.html DeleteHistoryRecords" 1590 1623 if {[string trim $msg] == ""} { 1591 1624 set msg "There are [CountHistory] history records" … … 1602 1635 pack [frame $frm.2] -padx 3 -pady 3 -side left -fill both -expand yes 1603 1636 pack [button $frm.2.help -text Help -bg yellow \ 1604 -command "MakeWWWHelp expgui err.html DeleteHistoryRecords"] -side top1637 -command "MakeWWWHelp expgui.html DeleteHistoryRecords"] -side top 1605 1638 pack [button $frm.2.4 -text Quit \ 1606 1639 -command {destroy .history}] -side bottom
Note: See TracChangeset
for help on using the changeset viewer.