Changeset 325


Ignore:
Timestamp:
Dec 4, 2009 5:04:10 PM (11 years ago)
Author:
toby
Message:

# on 2000/10/17 15:20:45, toby did:
snapshot with revisions for WWW help

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  
    33if {$tcl_platform(platform) == "windows"} {
    44    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"
    89        destroy .
    910    }
    1011    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"
    1416    }
    1517
     
    2931            # check the path -- can DOS use it?
    3032            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"
    3437                return
    3538            }
     
    7881    }
    7982} 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    }
    8089    if [catch {set env(GSASBACKSPACE)}] {set env(GSASBACKSPACE) 1}
    8190
     
    305314    catch {destroy .comp}
    306315    toplevel .comp
    307     bind .comp <Key-F1> "MakeWWWHelp expguierr.html Composition"
     316    bind .comp <Key-F1> "MakeWWWHelp expgui.html Composition"
    308317    wm title .comp Composition
    309318    pack [label .comp.results -text $text \
     
    316325            -command "writelst [list $text] ; destroy .comp"] -side left
    317326    pack [button .comp.box.help -text Help -bg yellow \
    318             -command "MakeWWWHelp expguierr.html Composition"] \
     327            -command "MakeWWWHelp expgui.html Composition"] \
    319328            -side right
    320329}
     
    337346    toplevel .export
    338347    wm title .export "Export coordinates"
    339     bind .export <Key-F1> "MakeWWWHelp expguierr.html ExportMSI"
     348    bind .export <Key-F1> "MakeWWWHelp expgui.html ExportMSI"
    340349    pack [label .export.lbl -text "Export coordinates in MSI .xtl format"\
    341350            ] -side top -anchor center
     
    360369    pack [button .export.but.2 -text Quit -command "destroy .export"] -side left
    361370    pack [button .export.but.help -text Help -bg yellow \
    362             -command "MakeWWWHelp expguierr.html ExportMSI"] \
     371            -command "MakeWWWHelp expgui.html ExportMSI"] \
    363372            -side right
    364373    # force the window to stay on top
     
    452461    } else {
    453462        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]"
    457465    }
    458466    if {[llength $expmap(phaselist)] == 1} {destroy .export}
     
    477485    toplevel $frm
    478486    wm title $frm "Convert File"
    479     bind $frm <Key-F1> "MakeWWWHelp expguierr.html ConvertUnix"
     487    bind $frm <Key-F1> "MakeWWWHelp expgui.html ConvertUnix"
    480488
    481489    pack [frame [set frm0 $frm.0] -bd 2 -relief groove] \
     
    503511    pack [button $frmC.q -text Quit -command "set infile(done) 1"] -side left
    504512    pack [button $frmC.help -text Help -bg yellow \
    505             -command "MakeWWWHelp expguierr.html ConvertUnix"] \
     513            -command "MakeWWWHelp expgui.html ConvertUnix"] \
    506514            -side right
    507515   
     
    540548
    541549    if {$infile(name) == $outfile(name)} {
     550        MyMessageBox -parent . -title Notify \
     551                -message "Sorry, filenames must differ" \
     552                -icon warning -helplink "expguierr.html ConvSameName"
    542553        tk_dialog .warn Notify "Sorry, filenames must differ" warning 0 OK
    543554        return
    544555    }
    545556    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"
    548560        return
    549561    }
    550562    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
    554568    }
    555569    if [catch {
     
    579593
    580594    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
    583598    scrollbar $bx.a.scroll -command "$bx.a.files yview"
    584599    unixFilChoose $bx $bx.a.files $filvar $diropt
     
    667682    toplevel $frm
    668683    wm title $frm "Convert File"
    669     bind $frm <Key-F1> "MakeWWWHelp expguierr.html ConvertWin"
     684    bind $frm <Key-F1> "MakeWWWHelp expgui.html ConvertWin"
    670685    pack [frame [set frmA $frm.1] -bd 2 -relief groove] -padx 3 -pady 3 -side left
    671686    pack [frame [set frmC $frm.3] ] -padx 3 -pady 3 \
    672687            -side left -fill y -expand yes
    673688    pack [button $frmC.help -text Help -bg yellow \
    674             -command "MakeWWWHelp expguierr.html ConvertWin"] -side top
     689            -command "MakeWWWHelp expgui.html ConvertWin"] -side top
    675690    pack [button $frmC.q -text Quit -command "destroy $frm"] -side bottom
    676691    pack [button $frmC.b -text Convert -command "ValidWinCnv $frm"] \
     
    721736    set oldname "[file rootname $file].org"
    722737    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
    727743        catch {file delete $oldname}
    728744    }
     
    787803            -command "updir; ChooseWinCnv $frm" ]
    788804    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 \
    790806            -yscrollcommand "sync2boxes $bx.a.files $bx.a.dates $bx.a.scroll" \
    791807            -height 15 -width 0
    792     listbox $bx.a.dates -relief raised -bd 2 \
     808    listbox $bx.a.dates -relief raised -bd 2  -exportselection 0 \
    793809            -yscrollcommand "sync2boxes $bx.a.dates $bx.a.files $bx.a.scroll" \
    794810            -height 15 -width 0 -takefocus 0
     
    887903    $expgui(FileDirButtonMenu)  delete 0 end
    888904    set list ""
     905    catch {set list [file volume]}
    889906    set dir ""
    890907    foreach subdir [file split [set expgui(FileMenuDir)]] {
     
    935952    toplevel $frm
    936953    wm title $frm "Experiment file"
     954    bind $frm <Key-F1> "MakeWWWHelp expguierr.html open"
    937955    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
    939961    pack [label $frmC.2 -text "Sort .EXP files by" ] -side top
    940962    pack [radiobutton $frmC.1 -text "File Name" -value 1 \
     
    943965            -variable expgui(filesort) -command "ChooseExpFil $frmA"] -side top
    944966    pack [button $frmC.b -text Read \
    945             -command "valid_exp_file $frmA $mode"] -side top
     967            -command "valid_exp_file $frmA $mode"] -side bottom
    946968    if {$mode == "new"} {
    947969        $frmC.b config -text Save
    948970    }
    949971    pack [button $frmC.q -text Quit \
    950             -command "set expgui(FileMenuEXPNAM) {}; destroy $frm"] -side top
     972            -command "set expgui(FileMenuEXPNAM) {}; destroy $frm"] -side bottom
    951973    bind $frm <Return> "$frmC.b invoke"
    952974
     
    10081030    set file [file join $expgui(FileMenuDir) $expgui(FileMenuEXPNAM)]
    10091031    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}
    10131039        if $ans {destroy .file}
    10141040        return
     
    10221048    }
    10231049    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}
    10281057        return
    10291058    }
     
    11431172# also called when box is created to fill it
    11441173proc ChooseExpFil {frm} {
    1145     global expgui
     1174    global expgui tcl_platform
    11461175    set files $frm.a.files
    11471176    set dates $frm.a.dates
     
    11841213    $expgui(FileDirButtonMenu)  delete 0 end
    11851214    set list ""
     1215    if {$tcl_platform(platform) == "windows"} {
     1216        catch {set list [file volume]}
     1217    }
     1218   
    11861219    set dir ""
    11871220    foreach subdir [file split [set expgui(FileMenuDir)]] {
     
    15031536      eval button [list $w.$name] $opts [list -command [list set tkPriv(button) $name]]
    15041537
    1505         if {![string compare $name $data(-default)]} {
     1538        if {![string compare $name [string tolower $data(-default)]]} {
    15061539            $w.$name configure -default active
    15071540        }
     
    15231556
    15241557    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)]]
    15261559    }
    15271560
     
    15611594        grab $w
    15621595        if {[string compare $data(-default) ""]} {
    1563             focus $w.$data(-default)
     1596            focus $w.[string tolower $data(-default)]
    15641597        } else {
    15651598            focus $w
     
    15871620    catch {destroy $frm}
    15881621    toplevel $frm
    1589     bind $frm <Key-F1> "MakeWWWHelp expguierr.html DeleteHistoryRecords"
     1622    bind $frm <Key-F1> "MakeWWWHelp expgui.html DeleteHistoryRecords"
    15901623    if {[string trim $msg] == ""} {
    15911624        set msg "There are [CountHistory] history records"
     
    16021635    pack [frame $frm.2] -padx 3 -pady 3 -side left -fill both -expand yes
    16031636    pack [button $frm.2.help -text Help -bg yellow \
    1604             -command "MakeWWWHelp expguierr.html DeleteHistoryRecords"] -side top
     1637            -command "MakeWWWHelp expgui.html DeleteHistoryRecords"] -side top
    16051638    pack [button $frm.2.4 -text Quit \
    16061639            -command {destroy .history}] -side bottom
Note: See TracChangeset for help on using the changeset viewer.