Changeset 139
- Timestamp:
- Dec 4, 2009 5:01:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2000/05/17 16:17:21 to 2000/05/17 18:45:27
- Property rcs:lines changed from +730 -518 to +48 -32
- Property rcs:rev changed from 1.23 to 1.24
r133 r139 6 6 # 7 7 # need to change heading and button label depending on where getExpFileName 8 # is called from 8 # is called from? 9 9 # 10 10 # global background editing & profile work differently: should both … … 26 26 # add phase to atom number in listing 27 27 # DisplayAllAtoms needs to loop over phases: expgui(curPhase) 28 28 # 29 # idea: load more than one bank from a multi-bank .RAW file 30 # 29 31 if {$tcl_version < 8.0} { 30 32 tk_dialog .expFileErrorMsg "Version Error" \ … … 59 61 set expgui(filesort) 1 60 62 set expgui(initstring) {} 63 # use a separate window for DISAGL (default) 64 set expgui(disaglSeparateBox) 1 61 65 #============================================================================= 62 66 # Store names of profile terms. … … 414 418 global expgui env tcl_platform 415 419 set fp [open [file join ~ .gsas_config] a] 416 puts $fp "set expgui(archive) $expgui(archive)" 417 puts $fp "set expgui(asorttype) $expgui(asorttype)" 418 puts $fp "set expgui(hsorttype) $expgui(hsorttype)" 419 puts $fp "set expgui(filesort) $expgui(filesort)" 420 foreach item {archive asorttype hsorttype filesort disaglSeparateBox} { 421 puts $fp "set expgui($item) $expgui($item)" 422 } 420 423 if {$tcl_platform(platform) != "windows"} { 421 424 puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)" … … 3043 3046 3044 3047 #---- file menu button 3045 menubutton $expgui(fm).file -text File - underline 0 -menu $expgui(fm).file.menu3048 menubutton $expgui(fm).file -text File -menu $expgui(fm).file.menu 3046 3049 menu $expgui(fm).file.menu 3047 3050 if $expgui(debug) { 3048 $expgui(fm).file.menu add command -label "Reset" -underline 0 \ 3049 -command "reset" 3050 } 3051 $expgui(fm).file.menu add command -label "expnam" -underline 0 \ 3052 -command readnewexp 3051 $expgui(fm).file.menu add command -label "Reset" -command "reset" 3052 } 3053 $expgui(fm).file.menu add command -label "expnam" -command readnewexp 3053 3054 $expgui(fm).file.menu add command -label "Save" -underline 0 \ 3054 3055 -command savearchiveexp 3055 $expgui(fm).file.menu add command -label "Save As" -underline 1 \ 3056 foreach c {s S} {bind . <Alt-$c> [list savearchiveexp]} 3057 $expgui(fm).file.menu add command -label "Save As" \ 3056 3058 -command "SaveAsFile" 3057 $expgui(fm).file.menu add command -label "Reread .EXP file" -underline 0\3059 $expgui(fm).file.menu add command -label "Reread .EXP file" \ 3058 3060 -command {rereadexp $expgui(expfile)} 3059 #$expgui(fm).file.menu add command -label "Close" -underline 03060 3061 3061 3062 #---- help menu button 3062 menubutton $expgui(fm).help -text Help - underline 0 -menu $expgui(fm).help.menu3063 menubutton $expgui(fm).help -text Help -menu $expgui(fm).help.menu 3063 3064 menu $expgui(fm).help.menu 3064 $expgui(fm).help.menu add command -command showhelp -label "Help on Command" 3065 $expgui(fm).help.menu add command -label "About..." -underline 0 -command About 3065 $expgui(fm).help.menu add command -command showhelp -underline 0 \ 3066 -label "Help on Command" 3067 foreach c {h H} {bind . <Alt-$c> [list showhelp]} 3068 $expgui(fm).help.menu add command -label "About..." -command About 3066 3069 3067 3070 #---- options menu button 3068 menubutton $expgui(fm).option -text Options -underline 0\3071 menubutton $expgui(fm).option -text Options \ 3069 3072 -menu $expgui(fm).option.menu 3070 3073 menu $expgui(fm).option.menu 3071 3074 3072 3075 $expgui(fm).option.menu add checkbutton -label "Archive EXP" \ 3073 -variable expgui(archive) -underline 0 3076 -variable expgui(archive) 3077 $expgui(fm).option.menu add checkbutton -label "Use DISAGL window" \ 3078 -variable expgui(disaglSeparateBox) 3074 3079 3075 3080 $expgui(fm).option.menu add cascade -menu $expgui(fm).option.menu.asort \ … … 3109 3114 menu $expgui(fm).option.menu.editmode 3110 3115 $expgui(fm).option.menu.editmode add radiobutton -label "Off" \ 3111 -variable expgui(globalmode) - underline 0 -value 0\3116 -variable expgui(globalmode) -value 0 \ 3112 3117 -command sethistlist 3113 3118 $expgui(fm).option.menu.editmode add radiobutton -label "All" \ 3114 -variable expgui(globalmode) - underline 0 -value 6 \3119 -variable expgui(globalmode) -value 6 \ 3115 3120 -command sethistlist 3116 3121 $expgui(fm).option.menu.editmode add radiobutton -label "TOF" \ 3117 -variable expgui(globalmode) - underline 0 -value 1 \3122 -variable expgui(globalmode) -value 1 \ 3118 3123 -command sethistlist 3119 3124 $expgui(fm).option.menu.editmode add radiobutton -label "CW Neutron" \ 3120 -variable expgui(globalmode) - underline 0 -value 2 \3125 -variable expgui(globalmode) -value 2 \ 3121 3126 -command sethistlist 3122 3127 $expgui(fm).option.menu.editmode add radiobutton -label "Alpha12 Xray" \ 3123 -variable expgui(globalmode) - underline 0 -value 3 \3128 -variable expgui(globalmode) -value 3 \ 3124 3129 -command sethistlist 3125 3130 $expgui(fm).option.menu.editmode add radiobutton -label "Monochromatic Xray" \ 3126 -variable expgui(globalmode) - underline 0 -value 4 \3131 -variable expgui(globalmode) -value 4 \ 3127 3132 -command sethistlist 3128 3133 $expgui(fm).option.menu.editmode add radiobutton -label "Energy Disp Xray" \ 3129 -variable expgui(globalmode) - underline 0 -value 5 \3134 -variable expgui(globalmode) -value 5 \ 3130 3135 -command sethistlist 3131 3136 $expgui(fm).option.menu.editmode add separator … … 3145 3150 } 3146 3151 3147 $expgui(fm).option.menu add command -label "Save Options" -underline 1\3152 $expgui(fm).option.menu add command -label "Save Options" \ 3148 3153 -command "SaveOptions" 3149 3154 … … 3152 3157 foreach menu $expgui(menunames) { 3153 3158 set m [string tolower $menu] 3154 pack [menubutton $expgui(fm).$m -text $menu -underline 0\3159 pack [menubutton $expgui(fm).$m -text $menu \ 3155 3160 -menu $expgui(fm).$m.menu] -side left 3156 3161 menu $expgui(fm).$m.menu … … 3162 3167 foreach cmd $expgui_menulist($menu) { 3163 3168 set action {} 3169 set opt {} 3164 3170 catch {set action [lindex $expgui_cmdlist($cmd) 0]} 3171 catch {set opt [lindex $expgui_cmdlist($cmd) 2]} 3165 3172 if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"} 3166 3173 if {$action != "" && $action != "-"} { 3167 3174 eval $expgui(fm).$menu.menu add command \ 3168 -label $cmd -command [list [subst $action]] 3175 -label $cmd $opt -command [list [subst $action]] 3176 if {[lindex $opt 0] == "-underline"} { 3177 catch { 3178 set num [lindex $opt 1] 3179 set key [string range $cmd $num $num] 3180 bind . <Alt-[string tolower $key]> [subst $action] 3181 bind . <Alt-[string toupper $key]> [subst $action] 3182 } 3183 } 3169 3184 } 3170 3185 } … … 3193 3208 if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"} 3194 3209 if {$action != ""} { 3195 pack [eval button .bar.$cmd -bg beige \3210 pack [eval button .bar.$cmd -bg beige -activebackground yellow \ 3196 3211 -text $cmd -command [list [subst $action]]] -side left 3197 3212 } … … 3199 3214 3200 3215 $expgui(fm).file.menu add command -label "Exit" -underline 1 -command catchQuit 3216 foreach c {X x} {bind . <Alt-$c> [list catchQuit]} 3201 3217 #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF MENU DEFINITION ^^^^^^^^^^^^^^^^^^^ 3202 3218
Note: See TracChangeset
for help on using the changeset viewer.