Changeset 93 for trunk/expgui


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

# on 1999/07/21 16:32:11, toby did:
add autoload mode
add support for adding phases, histograms and atoms
reset expmap when loading a new .EXP file
use putontop and afterputontop
change alpha, beta & gamma to greek letters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 1999/07/21 15:12:53 to 1999/07/21 16:32:11
    • Property rcs:lines changed from +4 -4 to +57 -92
    • Property rcs:rev changed from 1.15 to 1.16
    r89 r93  
    1717# appropriate menu.
    1818#
     19# idea:
     20#   change cell parameters to labels and have a edit cell button
     21#   that enforces metric symmetry
     22#
    1923# to allow "global" access on phase page
    2024#   change buttons from radio to multiple
     
    5862    if [catch {package require Tix}] {set expgui(havetix) 0}
    5963}
    60 # default is archive = on
     64# default for archive mode = on
    6165set expgui(archive) 1
     66# default for autoexec load = off
     67set expgui(autoexpload) 0
    6268# save the name of the wish executable
    6369set wishshell [info nameofexecutable]
     
    6874set liveplot(legend) 1
    6975set expgui(filesort) 1
    70 
    7176#=============================================================================
    7277# Store names of profile terms.
     
    118123# contents of GSAS menus
    119124source [file join $expgui(scriptdir) gsasmenu.tcl]
     125# commands for adding phases, histograms & atoms
     126source [file join $expgui(scriptdir) addcmds.tcl]
    120127#---------------------------------------------------------------------------
    121128# override options with locally defined values
     
    125132if [file exists [file join ~ .gsas_config]] {
    126133    source [file join ~ .gsas_config]
     134}
     135if {$tcl_platform(platform) == "windows"} {
     136    set expgui(exptool) [file join $expgui(gsasexe) exptool.exe]
     137} else {
     138    set expgui(exptool) [file join $expgui(gsasexe) exptool]
    127139}
    128140#---------------------------------------------------------------------------
     
    170182        unset exparray
    171183    }
     184    # added 7/21/99 to prevent errors when switching EXP files -- needs testing
     185    catch {
     186        unset expmap
     187    }
    172188    expload $expfile
    173189    set expgui(changed) 0
     
    236252}
    237253
    238 # called to reread the .EXP file -- use after another program
    239 # has changed the experiment file
     254# called to reread the .EXP file
    240255proc rereadexp {expfile} {
    241256    global expgui
     
    385400        puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)"
    386401    }
     402    puts $fp "set expgui(autoexpload) $expgui(autoexpload)"
    387403    close $fp
    388404}
     
    419435        }
    420436    }
    421     if {[file mtime $expgui(expfile)] != $expgui(expModifiedLast)} {
     437    if {[file mtime $expgui(expfile)] != $expgui(expModifiedLast) && \
     438        $expgui(expModifiedLast) != 0} {
    422439        if {$expgui(changed) == 0} {
    423440            set ans [tk_dialog .expFileErrorMsg "Reload?" \
     
    19391956    pack [button $w.b.3 -text Quit \
    19401957            -command "QuitEditBackground $w"] -side left
     1958    bind $w <Return> "destroy $w"
     1959
    19411960    # force the window to stay on top
    1942     wm transient $w [winfo toplevel [winfo parent $w]]
    1943 
    1944     bind $w <Return> "destroy $w"
    1945     wm withdraw $w
    1946     update idletasks
    1947     # center the new window in the middle of the parent
    1948     set x [expr [winfo x [winfo parent $w]] + [winfo width .]/2 - \
    1949             [winfo reqwidth $w]/2 - [winfo vrootx [winfo parent $w]]]
    1950     set y [expr [winfo y [winfo parent $w]] + [winfo height .]/2 - \
    1951             [winfo reqheight $w]/2 - [winfo vrooty [winfo parent $w]]]
    1952     wm geom $w +$x+$y
    1953     wm deiconify $w
    1954 
    1955     set oldFocus [focus]
    1956     set oldGrab [grab current $w]
    1957     if {$oldGrab != ""} {
    1958         set grabStatus [grab status $oldGrab]
    1959     }
    1960     grab $w
     1961    putoptop $w
     1962
    19611963    focus $w.b.2
    19621964    tkwait window $w
    1963 
    1964     catch {focus $oldFocus}
    1965     if {$oldGrab != ""} {
    1966         if {$grabStatus == "global"} {
    1967             grab -global $oldGrab
    1968         } else {
    1969             grab $oldGrab
    1970         }
    1971     }
     1965    afterputontop
     1966
    19721967    if {$expgui(temp) != ""} return
    19731968
     
    20992094    pack [button $w.b.2 -text Set -command "destroy $w"] -side left
    21002095    pack [button $w.b.3 -text Quit -command "set expgui(temp) {}; destroy $w"] -side left
     2096    bind $w <Return> "destroy $w"
     2097
    21012098    # force the window to stay on top
    2102     wm transient $w [winfo toplevel [winfo parent $w]]
    2103 
    2104     bind $w <Return> "destroy $w"
    2105     wm withdraw $w
    2106     update idletasks
    2107     # center the new window in the middle of the parent
    2108     set x [expr [winfo x [winfo parent $w]] + [winfo width .]/2 - \
    2109             [winfo reqwidth $w]/2 - [winfo vrootx [winfo parent $w]]]
    2110     set y [expr [winfo y [winfo parent $w]] + [winfo height .]/2 - \
    2111             [winfo reqheight $w]/2 - [winfo vrooty [winfo parent $w]]]
    2112     wm geom $w +$x+$y
    2113     wm deiconify $w
    2114 
    2115     set oldFocus [focus]
    2116     set oldGrab [grab current $w]
    2117     if {$oldGrab != ""} {
    2118         set grabStatus [grab status $oldGrab]
    2119     }
    2120     grab $w
     2099    putontop $w
    21212100    focus $w.b.2
    21222101    tkwait window $w
     2102    afterputontop
     2103
    21232104    if {$expgui(temp) != ""} {
    21242105        foreach h $hist {
     
    21392120            }
    21402121        }
    2141     }
    2142     catch {focus $oldFocus}
    2143     if {$oldGrab != ""} {
    2144         if {$grabStatus == "global"} {
    2145             grab -global $oldGrab
    2146         } else {
    2147             grab $oldGrab
    2148         }
    21492122    }
    21502123}
     
    22072180    pack [button $w.b.3 -text Quit \
    22082181            -command "QuitEditProfile $w [list $entrylist]"] -side left
     2182    bind $w <Return> "destroy $w"
     2183
    22092184    # force the window to stay on top
    2210     wm transient $w [winfo toplevel [winfo parent $w]]
    2211 
    2212     bind $w <Return> "destroy $w"
    2213     wm withdraw $w
    2214     update idletasks
    2215     # center the new window in the middle of the parent
    2216     set x [expr [winfo x [winfo parent $w]] + [winfo width .]/2 - \
    2217             [winfo reqwidth $w]/2 - [winfo vrootx [winfo parent $w]]]
    2218     set y [expr [winfo y [winfo parent $w]] + [winfo height .]/2 - \
    2219             [winfo reqheight $w]/2 - [winfo vrooty [winfo parent $w]]]
    2220     wm geom $w +$x+$y
    2221     wm deiconify $w
    2222 
    2223     set oldFocus [focus]
    2224     set oldGrab [grab current $w]
    2225     if {$oldGrab != ""} {
    2226         set grabStatus [grab status $oldGrab]
    2227     }
    2228     grab $w
     2185    putontop $w
    22292186    focus $w.b.2
    22302187    tkwait window $w
    2231 
    2232     catch {focus $oldFocus}
    2233     if {$oldGrab != ""} {
    2234         if {$grabStatus == "global"} {
    2235             grab -global $oldGrab
    2236         } else {
    2237             grab $oldGrab
    2238         }
    2239     }
     2188    afterputontop
    22402189}
    22412190
     
    23992348set l2 [label $frameLatt.l2 -text "b"]
    24002349set l3 [label $frameLatt.l3 -text "c"]
    2401 set l4 [label $frameLatt.l4 -text "alpha"]
    2402 set l5 [label $frameLatt.l5 -text "beta"]
    2403 set l6 [label $frameLatt.l6 -text "gamma"]
     2350set l4 [label $frameLatt.l4 -text a -font symbol]
     2351set l5 [label $frameLatt.l5 -text b -font symbol]
     2352set l6 [label $frameLatt.l6 -text g -font symbol]
    24042353grid $e1 -column 1 -row 0 -padx 5
    24052354grid $e2 -column 3 -row 0 -padx 5
     
    24212370tk_optionMenu $frameLatt.om entryvar(celldamp) 0 1 2 3 4 5 6 7 8 9
    24222371grid $frameLatt.om -column 7 -row 1 -padx 5 -sticky e
    2423 
     2372if [file executable $expgui(exptool)] {
     2373    button $frameLatt.newp -text Add\nPhase -command MakeAddPhaseBox
     2374    grid $frameLatt.newp -column 0 -row 0 -rowspan 2 -sticky w
     2375    grid columnconfig $frameLatt  0 -weight 1
     2376}
    24242377#-------------- Begin Atom Coordinates Box  ---------------------------------
    24252378grid [listbox   $fbig.title -height 1 -relief flat] \
     
    24342387$expgui(atomlistbox) configure -font $expgui(coordfont) -selectmode extended
    24352388grid [scrollbar $fbig.bscr -orient horizontal \
    2436         -command "move2boxes \" $fbig.title $fbig.lbox \" "
     2389        -command "move2boxes \" $fbig.title $fbig.lbox \" " \
    24372390        ] -row 2 -column 0 -sticky ew
    24382391grid [scrollbar $fbig.rscr  -command "$fbig.lbox yview" \
     
    24552408# --------------------------- Begin Edit Box -------------------------------
    24562409grid [set expgui(EditingAtoms) [label $frame3.top -bg beige -fg blue]] \
    2457         -column 0 -row 0 -padx 2 -pady 3 -columnspan 12 -sticky w
     2410        -column 0 -row 0 -padx 2 -pady 3 -columnspan 10 -sticky w
     2411if [file executable $expgui(exptool)] {
     2412    button $frame3.newa -text "Add New Atom" \
     2413            -command {MakeAddAtomsBox $expgui(curPhase)}
     2414    grid $frame3.newa -column 11 -row 0
     2415}
    24582416
    24592417set f3l1 [label $frame3.l1 -text "Refinement Flags " -bg beige]
     
    25922550    }
    25932551}
     2552if [file executable $expgui(exptool)] {
     2553    button $expgui(histFrame).newh -text "Add New Histogram" -command MakeAddHistBox
     2554    grid $expgui(histFrame).newh -column 1 -row 6
     2555}
    25942556
    25952557# BACKGROUND information.
     
    29462908            -variable env(GSASBACKSPACE)
    29472909}
     2910$expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
     2911            -variable expgui(autoexpload)
     2912
    29482913$expgui(fm).option.menu add command -label "Save Options" -underline 1 \
    29492914        -command "SaveOptions"
Note: See TracChangeset for help on using the changeset viewer.