Changeset 306


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

# on 2000/10/04 20:35:17, toby did:
variable expgui(bkgcolor1) provides the background color for editing
coordinates on the phase panel

A no-shell mode is now defined using env(EXPGUI_NOSHELL) or /noshell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2000/10/03 23:29:29 to 2000/10/04 20:35:17
    • Property rcs:lines changed from +69 -58 to +72 -53
    • Property rcs:rev changed from 1.35 to 1.36
    r303 r306  
    3535}
    3636
     37# the shell variable tells expgui to act as a shell for GSAS
     38# as well as edit the EXP file. In no-shell mode, it can
     39# only be used to edit the .EXP file as a callable program
     40set expgui(shell) 1
     41catch {if $env(EXPGUI_NOSHELL) {set expgui(shell) 0}}
     42
    3743if {$argv != ""} {
    38     set expgui(expfile) $argv
     44    if {[string match *noshell* [string tolower $argv]]} {
     45        puts noshell
     46        set expgui(shell) 0
     47        set expgui(expfile) [lindex $argv 1]
     48    } else {
     49        set expgui(expfile) [lindex $argv 0]
     50    }
    3951    if {[string toupper [file extension $expgui(expfile)]] != ".EXP"} {
    4052        append expgui(expfile) ".EXP"
     
    4658set expgui(curhist) {}
    4759set expmap(powderlist) {}
     60set expgui(bkgcolor1) #fdf
    4861
    4962set expgui(debug) 0
     
    10091022    } elseif { $iOrA == "I" || $iOrA == "disable"} {
    10101023        foreach item $expgui(anisolabels) {
    1011 #           $item config -fg grey
    1012             $item config -fg beige
     1024            $item config -fg $expgui(bkgcolor1)
    10131025        }
    10141026        foreach item [lrange $expgui(anisoentry) 1 end] \
     
    10161028            set entrycmd($var) ""
    10171029            set entryvar($var) ""
    1018             $item config -fg beige -bg beige  -state disabled
     1030            $item config -fg $expgui(bkgcolor1) -bg $expgui(bkgcolor1) \
     1031                    -state disabled
    10191032        }
    10201033        if { $iOrA == "disable"} {
    10211034            set entrycmd($var) ""
    10221035            set entryvar($var) ""
    1023 #           [lindex $expgui(anisoentry) 0] config -fg white -state disabled
    1024             [lindex $expgui(anisoentry) 0] config -fg beige -bg beige -state disabled
     1036            [lindex $expgui(anisoentry) 0] config \
     1037                    -fg $expgui(bkgcolor1) -bg $expgui(bkgcolor1) \
     1038                    -state disabled
    10251039        } else {
    10261040            set entrycmd(U11) "atominfo $p $atomnum Uiso"
     
    10391053    if {$atomnum == 0} {
    10401054        foreach label $expgui(atomreflbl) {
    1041             $label config -fg beige
     1055            $label config -fg $expgui(bkgcolor1)
    10421056        }
    10431057        foreach entry $expgui(atomref) {
    1044             $entry config -state disabled -fg beige -bg beige
     1058            $entry config -state disabled \
     1059                    -fg $expgui(bkgcolor1) -bg $expgui(bkgcolor1)
     1060            # turn off checkbuttons
     1061            catch {$entry deselect}
     1062
    10451063        }
    10461064        return
     
    10501068    }
    10511069    foreach entry $expgui(atomref) {
    1052         $entry config -state normal -fg black -bg beige
     1070        $entry config -state normal -fg black -bg $expgui(bkgcolor1)
    10531071    }
    10541072    foreach var {xref uref fref xdamp udamp fdamp}  {
     
    10631081    if {$atomnum == 0} {
    10641082        foreach label $expgui(atomlabels) {
    1065             $label config -fg beige
     1083            $label config -fg $expgui(bkgcolor1)
    10661084        }
    10671085        foreach entry $expgui(atomentry) {
    1068             $entry config -state disabled -fg beige -bg beige
     1086            $entry config -state disabled \
     1087                    -fg $expgui(bkgcolor1) -bg $expgui(bkgcolor1)
    10691088        }
    10701089        return
     
    26352654    #  This is a big frame in the Phase notebook pane to hold atomic data.
    26362655    set fbig [frame $expgui(phaseFrame).fbig -width 180 \
    2637             -relief raised -borderwidth 4 -bg beige]
     2656            -relief raised -borderwidth 4]
    26382657    #  This is a frame just below the big frame: for edits
    26392658    set frame3 [frame $expgui(phaseFrame).frame3 -width 100 \
    2640             -relief raised -borderwidth 4 -bg beige]
     2659            -relief raised -borderwidth 4 -bg $expgui(bkgcolor1)]
    26412660
    26422661    grid $expgui(phaseFrame).top -sticky news -row 0 -column 0
     
    27312750
    27322751    # --------------------------- Begin Edit Box ------------------------
    2733     grid [set expgui(EditingAtoms) [label $frame3.top -bg beige -fg blue]] \
     2752    grid [set expgui(EditingAtoms) [label $frame3.top -bg $expgui(bkgcolor1) -fg blue]] \
    27342753            -column 0 -row 0 -padx 2 -pady 3 -columnspan 10 -sticky w
    27352754    if [file executable $expgui(exptool)] {
    27362755        button $frame3.newa -text "Add New Atoms" \
     2756                -bg $expgui(bkgcolor1) -highlightthickness 0 \
    27372757                -command {MakeAddAtomsBox $expgui(curPhase)}
    27382758        grid $frame3.newa -column 11 -row 0
    27392759    }
    27402760    button [set expgui(atomxform) $frame3.xa] \
     2761            -bg $expgui(bkgcolor1) -highlightthickness 0 \
    27412762            -command {MakeXformAtomsBox $expgui(curPhase)}
    27422763    grid $expgui(atomxform) -column 11 -row 1 -sticky ew
    27432764
    2744     set f3l1 [label $frame3.l1 -text "Refinement Flags " -bg beige]
     2765    set f3l1 [label $frame3.l1 -text "Refinement Flags:" -bg $expgui(bkgcolor1)]
    27452766    grid $f3l1 -column 0 -row 1 -padx 2 -sticky nsw -pady 3
    2746    
    2747     set f3cFlag1 [checkbutton $frame3.cf1 -text "X" -variable entryvar(xref) -bg beige]
    2748     set f3cFlag2 [checkbutton $frame3.cf2 -text "U" -variable entryvar(uref) -bg beige]
    2749     set f3cFlag3 [checkbutton $frame3.cf3 -text "F" -variable entryvar(fref) -bg beige]
    2750     grid $f3cFlag1 -column 1 -row 1 -padx 2 -pady 3 -sticky w
    2751     grid $f3cFlag2 -column 2 -row 1 -padx 2 -pady 3 -sticky w
    2752     grid $f3cFlag3 -column 3 -row 1 -padx 2 -pady 3 -sticky w
    2753    
    2754     set f3l4 [label $frame3.l4 -text "Damping Factors " -bg beige]
     2767    foreach lbl {X U F} var {xref uref fref} col {1 2 3} {
     2768        grid [checkbutton $frame3.cf$col \
     2769                -text $lbl -variable entryvar($var) \
     2770                -bg $expgui(bkgcolor1) -highlightthickness 0 \
     2771                -activebackground $expgui(bkgcolor1)] \
     2772                -column $col -row 1 -padx 4 -pady 3 -sticky w
     2773    }
     2774    set f3l4 [label $frame3.l4 -text "  Damping:" -bg $expgui(bkgcolor1)]
    27552775    grid $f3l4 -column 4 -row 1 -padx 2 -sticky nsw -pady 3
    27562776   
    2757     tk_optionMenu $frame3.om2 entryvar(xdamp) 0 1 2 3 4 5 6 7 8 9
    2758     tk_optionMenu $frame3.om3 entryvar(udamp) 0 1 2 3 4 5 6 7 8 9
    2759     tk_optionMenu $frame3.om4 entryvar(fdamp) 0 1 2 3 4 5 6 7 8 9
    2760     grid [label $frame3.lom2 -text X -bg beige] -column 5 -row 1 -padx 2 -pady 3 -sticky w
    2761     grid $frame3.om2 -column 6 -row 1 -padx 2 -pady 3 -sticky w
    2762     grid [label $frame3.lom3 -text U -bg beige] -column 7 -row 1 -padx 2 -pady 3 -sticky w
    2763     grid $frame3.om3 -column 8 -row 1 -padx 2 -pady 3 -sticky w
    2764     grid [label $frame3.lom4 -text F -bg beige] -column 9 -row 1 -padx 2 -pady 3 -sticky w
    2765     grid $frame3.om4 -column 10 -row 1 -padx 2 -pady 3 -sticky w
    2766 
     2777    set col 4
     2778    foreach var {xdamp udamp fdamp} num {2 3 4} lbl {X U F} {
     2779        grid [label $frame3.lom$num -text $lbl \
     2780                -bg $expgui(bkgcolor1)] \
     2781                -column [incr col] -row 1 -padx 2 -pady 3 -sticky w
     2782        tk_optionMenu $frame3.om$num entryvar($var) 0 1 2 3 4 5 6 7 8 9
     2783        $frame3.om$num config -highlightthickness 0
     2784        grid $frame3.om$num -column [incr col] -row 1 -padx 2 -pady 3 -sticky w
     2785    }
    27672786    set expgui(atomreflbl) "$frame3.l1 $frame3.l4 $frame3.lom2 $frame3.lom3 $frame3.lom4 "
    27682787    set expgui(atomref) "$frame3.cf1 $frame3.cf2 $frame3.cf3 $frame3.om2 $frame3.om3 $frame3.om4"
    27692788   
    2770     set coords [frame $frame3.coords  -width 100 -borderwidth 0  -bg beige]
     2789    set coords [frame $frame3.coords  -width 100 -borderwidth 0  -bg $expgui(bkgcolor1)]
    27712790    grid $coords -column 0 -row 6 -columnspan 12 -sticky nsew
    27722791   
    2773     set f3l1 [label $frame3.coords.l1 -text "Label" -bg beige]
     2792    set f3l1 [label $frame3.coords.l1 -text "Label" -bg $expgui(bkgcolor1)]
    27742793    grid $f3l1 -column 0 -row 4 -padx 2 -sticky nsw -pady 3
    27752794    set expgui(atomlabels) $f3l1
     
    27792798    set expgui(atomentry) $f3e1
    27802799
    2781     set f3l8 [label $frame3.coords.l8 -text "Coordinates" -bg beige]
     2800    set f3l8 [label $frame3.coords.l8 -text "Coordinates" -bg $expgui(bkgcolor1)]
    27822801    grid $f3l8 -column 2 -row 4 -padx 2 -sticky nsw -pady 3
    27832802    lappend expgui(atomlabels) $f3l8
    2784     set f3l11 [label $frame3.coords.l11 -text "Occupancy" -bg beige]
     2803    set f3l11 [label $frame3.coords.l11 -text "Occupancy" -bg $expgui(bkgcolor1)]
    27852804    grid $f3l11 -column 6 -row 4 -padx 2 -sticky nsw -pady 3
    27862805    lappend expgui(atomlabels) $f3l11
     
    27942813
    27952814
    2796     set f3f31 [frame $frame3.f3f31  -width 100 -borderwidth 0 -bg beige]
     2815    set f3f31 [frame $frame3.f3f31  -width 100 -borderwidth 0 -bg $expgui(bkgcolor1)]
    27972816    grid $f3f31 -column 0 -row 7 -columnspan 12
    27982817    set expgui(anisolabels) {}
    2799     lappend expgui(anisolabels)  [label $f3f31.l13 -text "Uiso" -bg beige]
    2800     lappend expgui(anisolabels)  [label $f3f31.l14 -text "U22" -bg beige]
    2801     lappend expgui(anisolabels)  [label $f3f31.l15 -text "U33" -bg beige]
    2802     lappend expgui(anisolabels)  [label $f3f31.l16 -text "U12" -bg beige]
    2803     lappend expgui(anisolabels)  [label $f3f31.l17 -text "U13" -bg beige]
    2804     lappend expgui(anisolabels)  [label $f3f31.l18 -text "U23" -bg beige]
    2805 
     2818    foreach lbl {13 14 15 16 17 18} txt {Uiso U22 U33 U12 U13 U23} {
     2819        lappend expgui(anisolabels)  [\
     2820                label $f3f31.l$lbl -text $txt -bg $expgui(bkgcolor1)
     2821        ]
     2822    }
    28062823    set expgui(anisoentry) {}
    28072824    foreach i {e13 e14 e15 e16 e17 e18} var {U11 U22 U33 U12 U13 U23} {
     
    31553172    $expgui(fm).file.menu add command -label "Reset" -command "reset"
    31563173}
    3157 if {$tcl_platform(platform) != "macintosh"} {
     3174if {$expgui(shell)} {
    31583175    $expgui(fm).file.menu add command -label "expnam" -command readnewexp
    31593176}
     
    31793196menu $expgui(fm).option.menu
    31803197
    3181 if {$tcl_platform(platform) != "macintosh"} {
     3198if {$expgui(shell)} {
    31823199    $expgui(fm).option.menu add checkbutton  -label "Archive EXP" \
    31833200            -variable expgui(archive)
     
    32463263    $expgui(fm).option.menu  add checkbutton -label "Override backspace" \
    32473264            -variable env(GSASBACKSPACE)
    3248     $expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
    3249             -variable expgui(autoexpload)
     3265    if {$expgui(shell)} {
     3266        $expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
     3267                -variable expgui(autoexpload)
     3268    }
    32503269}
    32513270
     
    32553274pack $expgui(fm).file $expgui(fm).option -side left  -in $expgui(fm)
    32563275
    3257 if {$tcl_platform(platform) != "macintosh"} {
     3276if {$expgui(shell)} {
    32583277    foreach menu $expgui(menunames) {
    32593278        set m [string tolower $menu]
     
    32653284pack $expgui(fm).help  -side right -in $expgui(fm)
    32663285
    3267 if {$tcl_platform(platform) != "macintosh"} {
     3286if {$expgui(shell)} {
    32683287    # add the commands in expgui_menulist
    32693288    foreach menu [array names expgui_menulist ] {
     
    33063325    }
    33073326}
    3308 if {$tcl_platform(platform) != "macintosh"} {
     3327if {$expgui(shell)} {
    33093328    # set up button bar
    33103329    foreach cmd $expgui(buttonlist) {
Note: See TracChangeset for help on using the changeset viewer.