Changeset 93
- Timestamp:
- Dec 4, 2009 5:00:17 PM (13 years ago)
- 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 17 17 # appropriate menu. 18 18 # 19 # idea: 20 # change cell parameters to labels and have a edit cell button 21 # that enforces metric symmetry 22 # 19 23 # to allow "global" access on phase page 20 24 # change buttons from radio to multiple … … 58 62 if [catch {package require Tix}] {set expgui(havetix) 0} 59 63 } 60 # default is archive = on64 # default for archive mode = on 61 65 set expgui(archive) 1 66 # default for autoexec load = off 67 set expgui(autoexpload) 0 62 68 # save the name of the wish executable 63 69 set wishshell [info nameofexecutable] … … 68 74 set liveplot(legend) 1 69 75 set expgui(filesort) 1 70 71 76 #============================================================================= 72 77 # Store names of profile terms. … … 118 123 # contents of GSAS menus 119 124 source [file join $expgui(scriptdir) gsasmenu.tcl] 125 # commands for adding phases, histograms & atoms 126 source [file join $expgui(scriptdir) addcmds.tcl] 120 127 #--------------------------------------------------------------------------- 121 128 # override options with locally defined values … … 125 132 if [file exists [file join ~ .gsas_config]] { 126 133 source [file join ~ .gsas_config] 134 } 135 if {$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] 127 139 } 128 140 #--------------------------------------------------------------------------- … … 170 182 unset exparray 171 183 } 184 # added 7/21/99 to prevent errors when switching EXP files -- needs testing 185 catch { 186 unset expmap 187 } 172 188 expload $expfile 173 189 set expgui(changed) 0 … … 236 252 } 237 253 238 # called to reread the .EXP file -- use after another program 239 # has changed the experiment file 254 # called to reread the .EXP file 240 255 proc rereadexp {expfile} { 241 256 global expgui … … 385 400 puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)" 386 401 } 402 puts $fp "set expgui(autoexpload) $expgui(autoexpload)" 387 403 close $fp 388 404 } … … 419 435 } 420 436 } 421 if {[file mtime $expgui(expfile)] != $expgui(expModifiedLast)} { 437 if {[file mtime $expgui(expfile)] != $expgui(expModifiedLast) && \ 438 $expgui(expModifiedLast) != 0} { 422 439 if {$expgui(changed) == 0} { 423 440 set ans [tk_dialog .expFileErrorMsg "Reload?" \ … … 1939 1956 pack [button $w.b.3 -text Quit \ 1940 1957 -command "QuitEditBackground $w"] -side left 1958 bind $w <Return> "destroy $w" 1959 1941 1960 # 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 1961 1963 focus $w.b.2 1962 1964 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 1972 1967 if {$expgui(temp) != ""} return 1973 1968 … … 2099 2094 pack [button $w.b.2 -text Set -command "destroy $w"] -side left 2100 2095 pack [button $w.b.3 -text Quit -command "set expgui(temp) {}; destroy $w"] -side left 2096 bind $w <Return> "destroy $w" 2097 2101 2098 # 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 2121 2100 focus $w.b.2 2122 2101 tkwait window $w 2102 afterputontop 2103 2123 2104 if {$expgui(temp) != ""} { 2124 2105 foreach h $hist { … … 2139 2120 } 2140 2121 } 2141 }2142 catch {focus $oldFocus}2143 if {$oldGrab != ""} {2144 if {$grabStatus == "global"} {2145 grab -global $oldGrab2146 } else {2147 grab $oldGrab2148 }2149 2122 } 2150 2123 } … … 2207 2180 pack [button $w.b.3 -text Quit \ 2208 2181 -command "QuitEditProfile $w [list $entrylist]"] -side left 2182 bind $w <Return> "destroy $w" 2183 2209 2184 # 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 2229 2186 focus $w.b.2 2230 2187 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 2240 2189 } 2241 2190 … … 2399 2348 set l2 [label $frameLatt.l2 -text "b"] 2400 2349 set 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"]2350 set l4 [label $frameLatt.l4 -text a -font symbol] 2351 set l5 [label $frameLatt.l5 -text b -font symbol] 2352 set l6 [label $frameLatt.l6 -text g -font symbol] 2404 2353 grid $e1 -column 1 -row 0 -padx 5 2405 2354 grid $e2 -column 3 -row 0 -padx 5 … … 2421 2370 tk_optionMenu $frameLatt.om entryvar(celldamp) 0 1 2 3 4 5 6 7 8 9 2422 2371 grid $frameLatt.om -column 7 -row 1 -padx 5 -sticky e 2423 2372 if [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 } 2424 2377 #-------------- Begin Atom Coordinates Box --------------------------------- 2425 2378 grid [listbox $fbig.title -height 1 -relief flat] \ … … 2434 2387 $expgui(atomlistbox) configure -font $expgui(coordfont) -selectmode extended 2435 2388 grid [scrollbar $fbig.bscr -orient horizontal \ 2436 -command "move2boxes \" $fbig.title $fbig.lbox \" " 2389 -command "move2boxes \" $fbig.title $fbig.lbox \" " \ 2437 2390 ] -row 2 -column 0 -sticky ew 2438 2391 grid [scrollbar $fbig.rscr -command "$fbig.lbox yview" \ … … 2455 2408 # --------------------------- Begin Edit Box ------------------------------- 2456 2409 grid [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 2411 if [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 } 2458 2416 2459 2417 set f3l1 [label $frame3.l1 -text "Refinement Flags " -bg beige] … … 2592 2550 } 2593 2551 } 2552 if [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 } 2594 2556 2595 2557 # BACKGROUND information. … … 2946 2908 -variable env(GSASBACKSPACE) 2947 2909 } 2910 $expgui(fm).option.menu add checkbutton -label "Autoload EXP" \ 2911 -variable expgui(autoexpload) 2912 2948 2913 $expgui(fm).option.menu add command -label "Save Options" -underline 1 \ 2949 2914 -command "SaveOptions"
Note: See TracChangeset
for help on using the changeset viewer.