Changeset 250 for trunk/expgui
- Timestamp:
- Dec 4, 2009 5:02:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2000/07/20 22:13:40 to 2000/07/28 20:29:34
- Property rcs:lines changed from +80 -57 to +117 -49
- Property rcs:rev changed from 1.29 to 1.30
r238 r250 424 424 Jonathan Wasserman and Brian Toby\n\ 425 425 NIST Center for Neutron Research\n\n\ 426 1998, Not subject to copyright\n\n\426 2000, Not subject to copyright\n\n\ 427 427 Revision [lindex $expgui(Revision) 1] (readexp.tcl [lindex $expmap(Revision) 1])\n\n\ 428 428 Generalized Structure Analysis System (GSAS)\n\ … … 1303 1303 } 1304 1304 # Top box 1305 if $expgui(haveBW) { 1306 catch {destroy $expgui(histFrame).pflag} 1307 } 1305 1308 if {$expgui(globalmode) != 0} { 1306 1309 $expgui(histFrame).top.txt config \ … … 1311 1314 grid forget $expgui(histFrame).top 1312 1315 set expgui(bkglbl) "Edit Background" 1316 if {$expgui(haveBW) && [llength $expmap(phaselist)] > 1} { 1317 TitleFrame $expgui(histFrame).pflag \ 1318 -borderwidth 4 -side left -relief groove \ 1319 -text "Phase Flags" 1320 set expgui(pflag) [$expgui(histFrame).pflag getframe] 1321 grid $expgui(histFrame).pflag -column 1 -row 1 -sticky nsew 1322 grid rowconfigure $expgui(histFrame) 2 -minsize 35 1323 foreach p $expmap(phaselist) { 1324 pack [checkbutton $expgui(pflag).$p \ 1325 -command "GetPhaseFlags $hist" \ 1326 -variable expgui(pflag$p) -text $p] -side left 1327 if {[lsearch $expmap(phaselist_$hist) $p] == -1} { 1328 set expgui(pflag$p) 0 1329 } else { 1330 set expgui(pflag$p) 1 1331 } 1332 } 1333 } 1313 1334 } 1314 1335 … … 1617 1638 } 1618 1639 1640 proc GetPhaseFlags {hist} { 1641 global expmap expgui 1642 set plist {} 1643 foreach p $expmap(phaselist) { 1644 if {$expgui(pflag$p)} {lappend plist $p} 1645 } 1646 SetPhaseFlag $hist $plist 1647 incr expgui(changed) 1648 mapexp 1649 } 1650 1651 proc SetPhaseFlag {hist plist} { 1652 # make a 2 digit key -- hh 1653 if {$hist < 10} { 1654 set hh " $hist" 1655 } else { 1656 set hh $hist 1657 } 1658 set key "HST $hh NPHAS" 1659 set str {} 1660 foreach iph {1 2 3 4 5 6 7 8 9} { 1661 if {[lsearch $plist $iph] != -1} { 1662 append str { 1} 1663 } else { 1664 append str { 0} 1665 } 1666 } 1667 setexp $key $str 1 68 1668 } 1669 1619 1670 #----------------------------------------------------------------------- 1620 1671 # populate the Scaling page … … 2096 2147 toplevel $w -bg beige 2097 2148 if {$expgui(globalmode) != 0} { 2149 wm title $w "Global Edit Background" 2150 } else { 2098 2151 wm title $w "Edit Background" 2099 } else {2100 wm title $w "Global Edit Background"2101 2152 } 2102 2153 … … 2122 2173 set expgui(orig_backtype) $expgui(backtype) 2123 2174 set expgui(prev_backtype) $expgui(backtype) 2124 eval tk_optionMenu $w.0.type expgui(backtype) {1 2 3 4 5 6} 2175 set typemenu [tk_optionMenu $w.0.type expgui(backtype) null] 2176 $typemenu delete 0 end 2177 foreach item { 2178 "1 - Shifted Chebyshev" 2179 "2 - Cosine Fourier series" 2180 "3 - Radial distribution peaks" 2181 "4 - Power series in Q**2n/n!" 2182 "5 - Power series in n!/Q**2n" 2183 "6 - Power series in Q**2n/n! and n!/Q**2n" 2184 "7 - Linear interpolation function" 2185 "8 - Reciprocal interpolation function" 2186 } { 2187 set val [lindex $item 0] 2188 $typemenu insert end radiobutton -variable expgui(backtype) \ 2189 -label $item -value $val 2190 } 2191 2125 2192 grid $w.0.type -row 1 -column 1 2126 2193 grid [label $w.0.c -text " Number of terms" -bg beige] -row 1 -column 2 … … 2343 2410 -bg beige] -row 0 -column 0 -columnspan 10 2344 2411 grid [label $w.0.b -text "Function type $ptype" -bg beige] -row 1 -column 0 2345 2346 # number of terms2347 # set expgui(backtype) [histinfo $hist backtype]2348 # set expgui(orig_backtype) $expgui(backtype)2349 # set expgui(prev_backtype) $expgui(backtype)2350 # eval tk_optionMenu $w.0.type expgui(backtype) {1 2 3 4 5 6}2351 # grid $w.0.type -row 1 -column 12352 2353 2412 grid [label $w.0.c -text " Peak cutoff" -bg beige] -row 1 -column 3 2354 2413 grid [entry $w.0.d -width 10 ] -row 1 -column 4 … … 3075 3134 $expgui(fm).file.menu add command -label "Reset" -command "reset" 3076 3135 } 3077 $expgui(fm).file.menu add command -label "expnam" -command readnewexp 3136 if {$tcl_platform(platform) != "macintosh"} { 3137 $expgui(fm).file.menu add command -label "expnam" -command readnewexp 3138 } 3078 3139 $expgui(fm).file.menu add command -label "Save" -underline 0 \ 3079 3140 -command savearchiveexp … … 3097 3158 menu $expgui(fm).option.menu 3098 3159 3099 $expgui(fm).option.menu add checkbutton -label "Archive EXP" \ 3100 -variable expgui(archive) 3101 $expgui(fm).option.menu add checkbutton -label "Use DISAGL window" \ 3102 -variable expgui(disaglSeparateBox) 3103 3160 if {$tcl_platform(platform) != "macintosh"} { 3161 $expgui(fm).option.menu add checkbutton -label "Archive EXP" \ 3162 -variable expgui(archive) 3163 $expgui(fm).option.menu add checkbutton -label "Use DISAGL window" \ 3164 -variable expgui(disaglSeparateBox) 3165 } 3104 3166 $expgui(fm).option.menu add cascade -menu $expgui(fm).option.menu.asort \ 3105 3167 -label "Sort atoms by" … … 3160 3222 set expgui(globalphasemode) 1 3161 3223 3162 if {$tcl_platform(platform) != "windows"} {3224 if {$tcl_platform(platform) == "unix"} { 3163 3225 $expgui(fm).option.menu add checkbutton -label "Override backspace" \ 3164 3226 -variable env(GSASBACKSPACE) … … 3172 3234 pack $expgui(fm).file $expgui(fm).option -side left -in $expgui(fm) 3173 3235 3174 foreach menu $expgui(menunames) { 3175 set m [string tolower $menu] 3176 pack [menubutton $expgui(fm).$m -text $menu \ 3177 -menu $expgui(fm).$m.menu] -side left 3178 menu $expgui(fm).$m.menu 3236 if {$tcl_platform(platform) != "macintosh"} { 3237 foreach menu $expgui(menunames) { 3238 set m [string tolower $menu] 3239 pack [menubutton $expgui(fm).$m -text $menu \ 3240 -menu $expgui(fm).$m.menu] -side left 3241 menu $expgui(fm).$m.menu 3242 } 3179 3243 } 3180 3244 pack $expgui(fm).help -side right -in $expgui(fm) 3181 3245 3182 # add the commands in expgui_menulist 3183 foreach menu [array names expgui_menulist ] { 3184 foreach cmd $expgui_menulist($menu) { 3185 set action {} 3186 set opt {} 3187 catch {set action [lindex $expgui_cmdlist($cmd) 0]} 3188 catch {set opt [lindex $expgui_cmdlist($cmd) 2]} 3189 if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"} 3190 if {$action != "" && $action != "-"} { 3191 eval $expgui(fm).$menu.menu add command \ 3192 -label $cmd $opt -command [list [subst $action]] 3193 if {[lindex $opt 0] == "-underline"} { 3194 catch { 3195 set num [lindex $opt 1] 3196 set key [string range $cmd $num $num] 3197 bind . <Alt-[string tolower $key]> [subst $action] 3198 bind . <Alt-[string toupper $key]> [subst $action] 3246 if {$tcl_platform(platform) != "macintosh"} { 3247 # add the commands in expgui_menulist 3248 foreach menu [array names expgui_menulist ] { 3249 foreach cmd $expgui_menulist($menu) { 3250 set action {} 3251 set opt {} 3252 catch {set action [lindex $expgui_cmdlist($cmd) 0]} 3253 catch {set opt [lindex $expgui_cmdlist($cmd) 2]} 3254 if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"} 3255 if {$action != "" && $action != "-"} { 3256 eval $expgui(fm).$menu.menu add command \ 3257 -label $cmd $opt -command [list [subst $action]] 3258 if {[lindex $opt 0] == "-underline"} { 3259 catch { 3260 set num [lindex $opt 1] 3261 set key [string range $cmd $num $num] 3262 bind . <Alt-[string tolower $key]> [subst $action] 3263 bind . <Alt-[string toupper $key]> [subst $action] 3264 } 3199 3265 } 3200 3266 } … … 3219 3285 } 3220 3286 } 3221 # set up button bar 3222 foreach cmd $expgui(buttonlist) { 3223 set action {} 3224 catch {set action [lindex $expgui_cmdlist($cmd) 0]} 3225 if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"} 3226 if {$action != ""} { 3227 pack [eval button .bar.$cmd -bg beige -activebackground yellow \ 3228 -text $cmd -command [list [subst $action]]] -side left 3287 if {$tcl_platform(platform) != "macintosh"} { 3288 # set up button bar 3289 foreach cmd $expgui(buttonlist) { 3290 set action {} 3291 catch {set action [lindex $expgui_cmdlist($cmd) 0]} 3292 if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"} 3293 if {$action != ""} { 3294 pack [eval button .bar.$cmd -bg beige -activebackground yellow \ 3295 -text $cmd -command [list [subst $action]]] -side left 3296 } 3229 3297 } 3230 3298 }
Note: See TracChangeset
for help on using the changeset viewer.