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

# on 2005/09/07 21:26:38, toby did:
fix use of delete window decoration (== quit)
fix display arrows options; warn on old GEOMETRY program
use .drawxtlrc to find DRAWXTL5.x program

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export_drawxtl.tcl

    • Property rcs:date changed from 2005/03/24 21:40:23 to 2005/09/07 21:26:38
    • Property rcs:lines changed from +120 -3 to +32 -21
    • Property rcs:rev changed from 1.2 to 1.3
    r836 r846  
    2222    # force the window to stay on top
    2323    putontop .export
     24    # trigger a quit on window delete
     25    wm protocol .export WM_DELETE_WINDOW {set expgui(export_phase) 0; destroy .export }
    2426    set bx .export.special
    2527    global DXTL
     
    4143    incr row
    4244    set DXTL(arrowbox) $bx.4
    43     grid [checkbutton $bx.4 -text "Generate arrows for magnetic atoms" \
     45    grid [checkbutton $bx.4 -text "Display arrows for magnetic atoms" \
    4446              -variable DXTL(genarrows) -state disabled] \
    4547        -row $row -column 1 -columnspan 5 -sticky w
     
    4749    set colorlist "White Red Green Blue Yellow Cyan Magenta Black Orange Brown Grey Silver White"
    4850    set DXTL(arrowcolorbox) $bx.4a
    49     grid [frame $bx.4a] -sticky ew -row $row -column 1 -columnspan 5
    50     grid [label $bx.4a.h -text "Representation: "] -column 0 -row 1
    51     grid [label $bx.4a.bll -text "gen from Block operator "] -column 1 -row 1
     51    set DXTL(arrowcolorbox_row) $row
     52    grid [frame $bx.4a] -sticky ew -row $DXTL(arrowcolorbox_row) \
     53        -column 1 -columnspan 5
     54    grid [label $bx.4a.h -text "Arrow colors: "] -column 0 -row 1 -sticky w
     55    grid [label $bx.4a.bll -text "   generated by Black operator "] -column 0 -row 2
    5256    eval tk_optionMenu $bx.4a.bl DXTL(blackarrow) $colorlist
    53     grid $bx.4a.bl -column 2 -row 1
    54     grid [label $bx.4a.redl -text "gen from Red operator "] -column 1 -row 2
     57    grid $bx.4a.bl -column 2 -row 2
     58    grid [label $bx.4a.redl -text "  generated by Red operator "] -column 0 -row 3
    5559    eval tk_optionMenu $bx.4a.red DXTL(redarrow) $colorlist
    56     grid $bx.4a.red -column 2 -row 2
    57     incr row
    58     foreach appname {DRAWxtl41 DRAWxtl41_aqua DRAWxtl50 DRAWxtl51} {
     60    grid $bx.4a.red -column 2 -row 3
     61    incr row
     62    # is DRAWxtl installed?
     63    set app {}
     64    if {![catch {set fp [open [file join $::env(HOME) .drawxtlrc] r]}]} {
     65        # line 12 is name of executable
     66        set i 0
     67        while {$i < 12} {
     68            incr i
     69            gets $fp appname
     70        }
     71        close $fp
    5972        set app [auto_execok $appname]
    60         if {$app != ""} {break}
    61         foreach loc [list $expgui(scriptdir) \
    62                          ~/Applications/DRAWxtlxx1/DRAWxtl501/] {
    63             if {[file exists [file join $loc $appname]]} {
    64                 set app [file join $loc $appname]
    65                 break
    66             }
    67         }
    68         if {$app != ""} {break}
    6973    }
    7074    if {$app != ""} {
    7175        set show normal
    72         set DXTL(app) $app
     76        set DXTL(app) $appname
    7377        set DXTL(launch) 1
    7478    } else {
     
    97101    }
    98102    # atom type box
    99     grid [frame $bx.s -relief groove -bd 4] -row $row -column 0 -columnspan 5 -sticky ew
     103    grid [frame $bx.s -relief groove -bd 4] -row $row -column 0 -columnspan 5 -sticky nsew
    100104    grid [label $bx.s.0 -text "Atom representation" \
    101105              -anchor w] -row 0 -column 0 -sticky w
     
    261265        set DXTL(genarrows) 1
    262266        $DXTL(arrowbox) configure -state normal
    263         grid $DXTL(arrowcolorbox)
     267        grid $DXTL(arrowcolorbox) -sticky ew -row $DXTL(arrowcolorbox_row) \
     268            -column 1 -columnspan 5
    264269    }
    265270    catch {unset typelist}
     
    299304    [winfo parent $DXTL(Blst)] config -scrollregion $sizes \
    300305        -width [lindex $sizes 2]
     306    wm geom [winfo toplevel $DXTL(Blst)] {}
    301307}
    302308
     
    367373        set fp [open geom.out r]
    368374        while {[gets $fp line] >= 0} {
     375            if {[string match "*Geometry*,L,N,*" $line]} {
     376                MyMessageBox -parent . -title "Old GSAS" \
     377                    -message "Old GEOMETRY program: You are using an old version of GSAS that cannot export magnetic vectors. Upgrade GSAS to generate arrows." -icon warning
     378                break
     379            }
    369380            if {[string match "*name*elem*x *y *z*x *y *z*" $line]} {break}
    370381        }
Note: See TracChangeset for help on using the changeset viewer.