Changeset 139 for trunk/expgui


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

# on 2000/05/17 18:45:27, toby did:
new option: allow a separate window for DISAGL
remove most underlines from menu options
provide keyboard accelerators for selected menu options
N.B. note new mechanism in gsasmenu.tcl for keyboard accelerators
use yellow highlight for active button on button bar

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  
    66#
    77# need to change heading and button label depending on where getExpFileName
    8 # is called from
     8# is called from?
    99#
    1010# global background editing & profile work differently: should both
     
    2626#   add phase to atom number in listing
    2727#   DisplayAllAtoms needs to loop over phases: expgui(curPhase)
    28 
     28#
     29# idea: load more than one bank from a multi-bank .RAW file
     30#
    2931if {$tcl_version < 8.0} {
    3032    tk_dialog .expFileErrorMsg "Version Error" \
     
    5961set expgui(filesort) 1
    6062set expgui(initstring) {}
     63# use a separate window for DISAGL (default)
     64set expgui(disaglSeparateBox) 1
    6165#=============================================================================
    6266# Store names of profile terms.
     
    414418    global expgui env tcl_platform
    415419    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    }
    420423    if {$tcl_platform(platform) != "windows"} {
    421424        puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)"
     
    30433046
    30443047#---- file menu button
    3045 menubutton $expgui(fm).file -text File -underline 0 -menu $expgui(fm).file.menu
     3048menubutton $expgui(fm).file -text File -menu $expgui(fm).file.menu
    30463049menu $expgui(fm).file.menu
    30473050if $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
    30533054$expgui(fm).file.menu add command -label "Save" -underline 0 \
    30543055        -command savearchiveexp
    3055 $expgui(fm).file.menu add command -label "Save As" -underline 1 \
     3056foreach c {s S} {bind . <Alt-$c> [list savearchiveexp]}
     3057$expgui(fm).file.menu add command -label "Save As" \
    30563058        -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" \
    30583060        -command {rereadexp $expgui(expfile)}
    3059 #$expgui(fm).file.menu add command -label "Close" -underline 0
    30603061
    30613062#---- help menu button
    3062 menubutton $expgui(fm).help -text Help -underline 0 -menu $expgui(fm).help.menu
     3063menubutton $expgui(fm).help -text Help -menu $expgui(fm).help.menu
    30633064menu $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"
     3067foreach c {h H} {bind . <Alt-$c> [list showhelp]}
     3068$expgui(fm).help.menu add command -label "About..." -command About
    30663069
    30673070#---- options menu button
    3068 menubutton $expgui(fm).option -text Options -underline 0 \
     3071menubutton $expgui(fm).option -text Options \
    30693072        -menu $expgui(fm).option.menu
    30703073menu $expgui(fm).option.menu
    30713074
    30723075$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)
    30743079
    30753080$expgui(fm).option.menu add cascade -menu  $expgui(fm).option.menu.asort \
     
    31093114menu $expgui(fm).option.menu.editmode
    31103115$expgui(fm).option.menu.editmode add radiobutton  -label "Off" \
    3111         -variable expgui(globalmode) -underline 0 -value 0\
     3116        -variable expgui(globalmode) -value 0 \
    31123117        -command sethistlist
    31133118$expgui(fm).option.menu.editmode add radiobutton  -label "All" \
    3114         -variable expgui(globalmode) -underline 0 -value 6 \
     3119        -variable expgui(globalmode) -value 6 \
    31153120        -command sethistlist
    31163121$expgui(fm).option.menu.editmode add radiobutton  -label "TOF" \
    3117         -variable expgui(globalmode) -underline 0 -value 1 \
     3122        -variable expgui(globalmode) -value 1 \
    31183123        -command sethistlist
    31193124$expgui(fm).option.menu.editmode add radiobutton  -label "CW Neutron" \
    3120         -variable expgui(globalmode) -underline 0 -value 2  \
     3125        -variable expgui(globalmode) -value 2  \
    31213126        -command sethistlist
    31223127$expgui(fm).option.menu.editmode add radiobutton  -label "Alpha12 Xray" \
    3123         -variable expgui(globalmode) -underline 0 -value 3 \
     3128        -variable expgui(globalmode) -value 3 \
    31243129        -command sethistlist
    31253130$expgui(fm).option.menu.editmode add radiobutton  -label "Monochromatic Xray" \
    3126         -variable expgui(globalmode) -underline 0 -value 4 \
     3131        -variable expgui(globalmode) -value 4 \
    31273132        -command sethistlist
    31283133$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 \
    31303135        -command sethistlist
    31313136$expgui(fm).option.menu.editmode add separator
     
    31453150}
    31463151
    3147 $expgui(fm).option.menu add command -label "Save Options" -underline 1 \
     3152$expgui(fm).option.menu add command -label "Save Options" \
    31483153        -command "SaveOptions"
    31493154
     
    31523157foreach menu $expgui(menunames) {
    31533158    set m [string tolower $menu]
    3154     pack [menubutton $expgui(fm).$m -text $menu -underline 0 \
     3159    pack [menubutton $expgui(fm).$m -text $menu \
    31553160            -menu $expgui(fm).$m.menu] -side left
    31563161    menu $expgui(fm).$m.menu
     
    31623167    foreach cmd $expgui_menulist($menu) {
    31633168        set action {}
     3169        set opt {}
    31643170        catch {set action [lindex $expgui_cmdlist($cmd) 0]}
     3171        catch {set opt [lindex $expgui_cmdlist($cmd) 2]}
    31653172        if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"}
    31663173        if {$action != "" && $action != "-"} {
    31673174            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            }
    31693184        }
    31703185    }
     
    31933208    if {$expgui(debug) && $action == ""} {puts "blank command for $cmd"}
    31943209    if {$action != ""} {
    3195         pack [eval button .bar.$cmd -bg beige \
     3210        pack [eval button .bar.$cmd -bg beige -activebackground yellow \
    31963211                -text $cmd -command [list [subst $action]]] -side left
    31973212    }
     
    31993214
    32003215$expgui(fm).file.menu add command -label "Exit"  -underline 1 -command catchQuit
     3216foreach c {X x} {bind . <Alt-$c> [list catchQuit]}
    32013217#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF MENU DEFINITION ^^^^^^^^^^^^^^^^^^^
    32023218
Note: See TracChangeset for help on using the changeset viewer.