Changeset 838


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

# on 2005/03/24 21:45:48, toby did:
fix up resize for OS X
add LS band width as option (thanx RBVD)
note Pawley phase (thanks RBVD)
attempt to fix missing expmap(atomlistboxcontents) bug
(not sure why this happens, so at least trap errors)
Reset phase selection in GetPhaseFlags? in case this causes the missing expmap(atomlistboxcontents)
prevent use of TRNS & SHFT when ZERO is refined
add new print option (#10) (thanx RBVD)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 2004/10/04 16:20:26 to 2005/03/24 21:45:48
    • Property rcs:lines changed from +71 -177 to +54 -9
    • Property rcs:rev changed from 1.75 to 1.76
    r823 r838  
    179179SetTkDefaultOptions $expgui(font)
    180180#---------------------------------------------------------------------------
     181set expgui(resize) 0
    181182# platform-specific code
    182183if {$tcl_platform(platform) == "windows" \
     
    233234            -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \
    234235            -helplink "expguierr.html NoPGPLOT"
     236    set expgui(resize) 1
    235237}
    236238#---------------------------------------------------------------------------
     
    244246#               -helplink "expguierr.html OpenErr"
    245247        set expgui(expfile) {}
     248        set expgui(resize) 1
    246249    } elseif {[string first " " [file dirname $expgui(expfile)]] != -1} {
    247250        update
     
    250253                -icon warning -type Continue -default continue
    251254#               -helplink "expguierr.html OpenErr"
     255        set expgui(resize) 1
    252256    } elseif ![file exists $expgui(expfile)] {
    253257        update
     
    259263        ]
    260264        if {[string tolower $ans] != "create"} {set expgui(expfile) {}}
    261     }
    262 }
    263 set expgui(resize) 0
     265        set expgui(resize) 1
     266    }
     267}
    264268if {$expgui(expfile) == ""} {
    265269    # center the parent window because the getExpFileName window
     
    422426    set entryvar(cycles) [expinfo cycles]
    423427    set entrycmd(cycles) "expinfo cycles"
     428    set entryvar(mbw) [expinfo mbw]
     429    set entrycmd(mbw) "expinfo mbw"
    424430    # set expgui(globalmode) 0
    425431    set expgui(printopt) "Print Options ([expinfo print])"
     
    611617    tk_dialog .about {About...} \
    612618"EXPGUI\n\
    613 Jonathan Wasserman and Brian Toby\n\
     619Brian Toby\n\
    614620NIST Center for Neutron Research\n\n\
    615 2000, Not subject to copyright\n\n\
     621Not subject to copyright\n\n\
    616622Revision [lindex $expgui(Revision) 1] (readexp.tcl [lindex $expmap(Revision) 1])\n\n\
    617623Cite: B. H. Toby, EXPGUI, a graphical\n\
     
    635641\"General Structure Analysis System (GSAS)\",\n\
    636642Los Alamos National Laboratory Report\n\
    637 LAUR 86-748 (2000)." \
     643LAUR 86-748 (2004)." \
    638644        info 0 OK
    639645}
     
    968974            } elseif {$type == 4} {
    969975                set expgui(phasetype) "Macromolecular"
     976            } elseif {$type == 10} {
     977                set expgui(phasetype) "Pawley"
    970978            } else {
    971979                set expgui(phasetype) ""
     
    10361044proc DisplayAllAtoms {curPhase "mode reset"} {
    10371045    global entryvar entrycmd expmap expgui
     1046    # make sure that atomlistboxcontents element exists
     1047    if {[catch {set expmap(atomlistboxcontents)}]} {
     1048        set expmap(atomlistboxcontents) {}
     1049    }
    10381050    # if it does not show, we don't have a phase or we are already displaying
    10391051    # don't bother
     
    13241336proc editOneRecord { AtomIndex } {
    13251337    global expmap expgui
     1338    # make sure that atomlistboxcontents element exists
     1339    if {[catch {set expmap(atomlistboxcontents)}]} return
     1340
    13261341    # get atom number & phase
    13271342    set tuple [lindex $expmap(atomlistboxcontents) $AtomIndex]
     
    13381353proc editMultipleRecords { AtomIndexList } {
    13391354    global expmap expgui
     1355    # make sure that atomlistboxcontents element exists
     1356    if {[catch {set expmap(atomlistboxcontents)}]} return
     1357
    13401358    set numberList {}
    13411359    # current phase
     
    21512169    }
    21522170    mapexp
     2171    # reset the phase selection
     2172    set expgui(curPhase) {}
    21532173}
    21542174
     
    23242344        set ind -1
    23252345        set htype [string range $expmap(htype_$hist) 2 2]
     2346        set zflag 0
     2347        if {$htype == "C"} {
     2348            set zflag [histinfo $hist zref]
     2349        }
    23262350        foreach i $expmap(phaselist_$hist) {
    23272351            incr ind
     
    23812405                set entrycmd(pterm${num}_$i) "hapinfo $hist $i pterm$num"
    23822406                set entryvar(pterm${num}_$i) [hapinfo $hist $i pterm$num]
     2407                # disable trns & shft when zero is refined
     2408                if {$zflag && ($term == "trns" || $term == "shft")} {
     2409                    if {$entryvar(pref${num}_$i)} {
     2410                        incr expgui(changed)
     2411                        set entryvar(pref${num}_$i) 0
     2412                    }
     2413                    $ProfileFrame.l${num}_${i} config -fg gray
     2414                    $ProfileFrame.ref${num}_${i} config -state disabled
     2415                    $ProfileFrame.ent${num}_${i} config -fg gray
     2416                }
    23832417                if {$col > 6} {set col -1; incr row}
    23842418            }
     
    38413875    8 "Print summary shift/esd data after last cycle"
    38423876    9 "Print zero/unit pole figure constraint terms"
     3877    10 "Output parameter name, value & esd to file"
    38433878}
    38443879pack [frame $expgui(lsFrame).hs -class HistList] \
     
    38943929        ] -row $row -column 0 -columnspan 2
    38953930menu $expgui(lsFrame).f1.lprint.menu
    3896 foreach num [lsort [array names printopts]] {
     3931foreach num [lsort -integer [array names printopts]] {
    38973932    $expgui(lsFrame).f1.lprint.menu add checkbutton \
    3898             -label "$printopts($num) ([expr int(pow(2,$num))])"\
     3933        -label "$printopts($num) ([expr int(pow(2,$num))])"\
    38993934        -variable entryvar(printopt$num)
    39003935}
     
    39093944        -from 1.0 -to 9.99 -showvalue 0 -command SetMarq -resolution 0.01 \
    39103945        -variable expgui(marq)] -row 1 -column 1
     3946
     3947incr row
     3948grid [frame $expgui(lsFrame).f1.d -bd 4 -relief groove] \
     3949        -row $row -column 2 -sticky ew
     3950grid [label $expgui(lsFrame).f1.d.lmbw -text "LS matrix bandwidth"] -row 0 -column 0
     3951grid [entry $expgui(lsFrame).f1.d.embw -width 4 \
     3952        -textvariable entryvar(mbw)] -row 0 -column 1
     3953set entrybox(mbw) $expgui(lsFrame).f1.d.embw
    39113954
    39123955incr row
     
    39734016    set expgui(convlbl) [format %5.2f [expr pow(10,$expgui(convg)/100.)]]
    39744017    set expgui(marq) [set expgui(marqinit) [expinfo marq]]
     4018    set expgui(mbw) [set expgui(mbwinit) [expinfo mbw]]
    39754019}
    39764020proc SetConv {x} {
     
    42624306    # this appears to be needed by OSX
    42634307    update
    4264     wm geom . [winfo reqwidth .]x[winfo reqheight .]
     4308    #wm geom . [winfo reqwidth .]x[winfo reqheight .]
     4309    wm geom . {}
    42654310    # center the EXPGUI window
    42664311    wm withdraw .
Note: See TracChangeset for help on using the changeset viewer.