Changeset 359 for trunk/expgui


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

# on 2000/12/22 19:44:07, toby did:
add autoiconify option
require winexec for Win-9x only (not -NT)
Check for use of network directories
Defer whenidle loop (.EXP modification checking) if expgui.lck exists
Remove various unneeded window restacking commands
Allow Autoload in Windows
Allow "Show EXPTOOL output" for all platforms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2000/11/21 21:26:37 to 2000/12/22 19:44:07
    • Property rcs:lines changed from +3 -2 to +42 -21
    • Property rcs:rev changed from 1.39 to 1.40
    r352 r359  
    6868# default for autoexec load = off
    6969set expgui(autoexpload) 0
     70# by default expgui is iconified while GENLES, etc runs
     71set expgui(autoiconify) 1
    7072# default for show EXPTOOL output = off
    7173set expgui(showexptool) 0
     
    145147#---------------------------------------------------------------------------
    146148# platform-specific code
    147 if {$tcl_platform(platform) == "windows"} {
    148     set expgui(exptool) [file join $expgui(gsasexe) exptool.exe]
     149if {$tcl_platform(platform) == "windows" \
     150        && $tcl_platform(os) == "Windows 95"} {
    149151    if [catch {package require winexec}] {
    150152        MyMessageBox -parent . -title "WINEXEC Error" \
     
    154156        destroy .
    155157    }
     158}
     159if {$tcl_platform(platform) == "windows"} {
     160    # check the path -- can DOS use it?
     161    if {[string first {\\} $expgui(script) ] != -1} {
     162        MyMessageBox -parent . -title "Invalid Path" \
     163                -message {Error -- You cannot run EXPGUI/GSAS from a network drive unless it is mapped to a "drive" (like F:). Use "Map network drive" to access this directory} \
     164                -icon error -type {"Limp Ahead"} -default "limp ahead" \
     165                -helplink "expgui_Win_readme.html NetPath"
     166    }
     167    #
     168    set expgui(exptool) [file join $expgui(gsasexe) exptool.exe]
    156169    if ![file exists [file join $expgui(gsasdir) fonts grfont.dat]] {
    157170        MyMessageBox -parent . -title "PGPLOT Error" \
     
    432445    if {$tcl_platform(platform) != "windows"} {
    433446        puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)"
    434         puts $fp "set expgui(autoexpload) $expgui(autoexpload)"
    435     }
    436     puts $fp "set expgui(showexptool) $expgui(showexptool)"
     447    }
     448    puts $fp "set expgui(archive) $expgui(archive)"
     449    puts $fp "set expgui(autoexpload) $expgui(autoexpload)"
     450    puts $fp "set expgui(autoiconify) $expgui(autoiconify)"
    437451    close $fp
    438452}
     
    463477# This is called every 2 seconds to check for changes to the .EXP file
    464478proc whenidle {} {
    465     global expgui
     479    global expgui tcl_platform
    466480    if $expgui(titleunchanged) {
    467481        if {$expgui(changed) != 0} {
     
    475489    }
    476490    if {[file mtime $expgui(expfile)] != $expgui(expModifiedLast)} {
     491        # we are "locked". Note that whenidle loop will be restarted later
     492        if {$tcl_platform(platform) == "windows" && [file exists expgui.lck]} {
     493            return
     494        }
    477495        set ans [ReloadExpMsg [file tail $expgui(expfile)] $expgui(changed)]
     496
    478497        if {$ans == 0} {
    479498            loadexp $expgui(expfile)
     
    563582    grab $w
    564583    focus $w.bot.1
    565     # for windows rearrange window stacking
    566     if {$tcl_platform(platform) == "windows"} {
    567         lower .
    568         raise $w .
    569     }
     584    # for windows rearrange window stacking
     585    # -- Removed since this will normally happen after the GSAS program
     586    # has finished
     587    #if {$tcl_platform(platform) == "windows"} {
     588        #lower .
     589        #raise $w .
     590    #}
    570591    update idletasks
    571592
     
    581602    }
    582603    # for windows rearrange window stacking
    583     if {$tcl_platform(platform) == "windows"} {
    584         raise .
    585     }
     604    #if {$tcl_platform(platform) == "windows"} {
     605        #raise .
     606    #}
    586607    return $expgui(dialogbutton)
    587608}
     
    32633284    $expgui(fm).option.menu add checkbutton  -label "Use DISAGL window" \
    32643285            -variable expgui(disaglSeparateBox)
     3286    $expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
     3287            -variable expgui(autoexpload)
     3288    $expgui(fm).option.menu  add checkbutton -label "Iconify during GSAS" \
     3289            -variable expgui(autoiconify)
    32653290}
    32663291$expgui(fm).option.menu add cascade -menu  $expgui(fm).option.menu.asort \
     
    33253350    $expgui(fm).option.menu  add checkbutton -label "Override backspace" \
    33263351            -variable env(GSASBACKSPACE)
    3327     if {$expgui(shell)} {
    3328         $expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
    3329                 -variable expgui(autoexpload)
    3330     }
    3331     $expgui(fm).option.menu  add checkbutton -label "Show EXPTOOL output" \
    3332                 -variable expgui(showexptool)
    3333 }
    3334 
     3352}
     3353
     3354$expgui(fm).option.menu  add checkbutton -label "Show EXPTOOL output" \
     3355        -variable expgui(showexptool)
    33353356$expgui(fm).option.menu add command -label "Save Options" \
    33363357        -command "SaveOptions"
Note: See TracChangeset for help on using the changeset viewer.