Changeset 539
- Timestamp:
- Dec 4, 2009 5:07:52 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expgui
- Property rcs:date changed from 2001/12/16 20:13:10 to 2002/01/22 22:29:18
- Property rcs:lines changed from +3 -2 to +340 -106
- Property rcs:rev changed from 1.53 to 1.54
r500 r539 25 25 # blank cell entries 26 26 # add phase to atom number in listing 27 # DisplayAllAtoms needs to loop over phases : expgui(curPhase)27 # DisplayAllAtoms needs to loop over phases 28 28 # 29 29 # idea: load more than one bank from a multi-bank .RAW file … … 43 43 if {$argv != ""} { 44 44 if {[string match *noshell* [string tolower $argv]]} { 45 puts noshell45 #puts noshell 46 46 set expgui(shell) 0 47 47 set expgui(expfile) [lindex $argv 1] … … 332 332 wm iconname . [file tail $expfile] 333 333 334 # reset the phase buttons 335 set expgui(curPhase) "" 334 336 # set the number of phases on the phase page 335 337 setphases … … 456 458 loadexp $expgui(expfile) 457 459 458 # select the 1st phase 459 SelectOnePhase [lindex $expmap(phaselist) 0] 460 # reset the phase selection 461 set expgui(curPhase) {} 462 460 463 # select the first histogram in the list by default (if there are any) 461 464 if {[llength $expmap(histlistboxcontents)] > 0} { … … 488 491 catch {$entrybox($elem) config -fg black} 489 492 } 490 if {[lindex $entrycmd($elem) 0] == "atominfo"} { 491 after idle {DisplayAllAtoms noreset} 493 if {[string match "*atominfo" [lindex $entrycmd($elem) 0]]} { 494 after idle "UpdateAtomLine \ 495 [list [lindex $entrycmd($elem) 2]] \ 496 [lindex $entrycmd($elem) 1]" 492 497 } 493 498 } errmsg] {error $errmsg} … … 559 564 LAUR 86-748 (2000)." \ 560 565 info 0 OK 566 } 567 568 # this proc gets called when the export coordinate button is pressed 569 # it loads export 570 proc BuildCoordExpMenu {menu} { 571 global expgui_cmdlist expgui 572 # do this only once 573 $menu config -postcommand {} 574 $menu delete 1 end 575 # add the cif export routine 576 set cmd gsas2cif 577 set action {} 578 catch {set action [lindex $expgui_cmdlist($cmd) 0]} 579 if {$action != "" && $action != "-"} { 580 $menu add command -label $cmd -command [subst $action] 581 } 582 # get a list of files to read 583 set filelist [glob -nocomplain [file join $expgui(scriptdir) export_*.tcl]] 584 foreach file $filelist { 585 source $file 586 $menu add command -label $label -command $action 587 } 588 } 589 590 # utility export routines for the export_*.tcl files: 591 # make a box for export 592 proc MakeExportBox {win title webref} { 593 global expmap expgui 594 catch {destroy $win} 595 toplevel $win 596 wm title $win "Export coordinates" 597 if {$webref != ""} { 598 bind $win <Key-F1> $webref 599 } 600 pack [label $win.lbl -text $title] -side top -anchor center 601 pack [frame $win.ps] -side top -anchor w 602 pack [label $win.ps.lbl -text "Select phase: "] -side left 603 foreach num $expmap(phaselist) { 604 pack [button $win.ps.$num -text $num \ 605 -command "SetExportPhase $num $win"] -side left 606 } 607 # leave a place for format-specific items 608 pack [frame $win.special] -side top 609 pack [frame $win.but] -side top -fill x -expand yes 610 pack [button $win.but.1 -text Write -command "destroy $win"] -side left 611 SetExportPhase [lindex $expmap(phaselist) 0] $win 612 pack [button $win.but.2 -text Quit \ 613 -command "set expgui(export_phase) 0;destroy $win"] -side left 614 pack [button $win.but.help -text Help -bg yellow \ 615 -command "MakeWWWHelp expgui.html ExportMSI"] \ 616 -side right 617 } 618 619 # set the phase in response to the button 620 proc SetExportPhase {num win} { 621 global expmap expgui 622 foreach n $expmap(phaselist) { 623 if {$n == $num} { 624 $win.ps.$n config -relief sunken; 625 set expgui(export_phase) $num 626 } else { 627 $win.ps.$n config -relief raised 628 } 629 } 561 630 } 562 631 … … 734 803 eval destroy [winfo children $expgui(phaseFrame).top.ps] 735 804 pack [label $expgui(phaseFrame).top.ps.0 -text Phase:] -side left 736 foreach num $expmap(phaselist) type $expmap(phasetype){805 foreach num $expmap(phaselist) { 737 806 pack [button $expgui(phaseFrame).top.ps.$num -text $num \ 738 807 -command "SelectOnePhase $num" -padx 1.5m] -side left 739 if {$type > 3} {740 $expgui(phaseFrame).top.ps.$num config -state disabled741 }742 808 } 743 809 if {[file executable $expgui(exptool)] && \ … … 753 819 proc SelectOnePhase {num} { 754 820 global entryvar entrycmd entrybox expmap expgui 821 # if no phase has been selected, select the first one 822 if {$num == ""} {set num [lindex $expmap(phaselist) 0]} 823 755 824 set crsPhase {} 756 825 $expgui(atomxform) config -text "Xform Atoms" -state disabled 757 826 foreach n $expmap(phaselist) type $expmap(phasetype) { 758 if {$n == $num && $type <= 3} {827 if {$n == $num} { 759 828 catch {$expgui(phaseFrame).top.ps.$num config -relief sunken} 760 829 set crsPhase $num … … 764 833 set expgui(phasetype) "Magnetic\n& Nuclear" 765 834 } elseif {$type == 4} { 766 # this is not used at present767 835 set expgui(phasetype) "Macromolecular" 768 836 } else { … … 794 862 } 795 863 796 set expgui(curPhase) $crsPhase 797 # we have a phase 798 799 # disable traces on entryvar for right now 864 # don't reload the last displayed phase 865 if {$expgui(curPhase) == $crsPhase} return 866 867 ########################################################## 868 # load and display a phase 869 ########################################################## 870 # disable traces on entryvar while loading 800 871 set entrycmd(trace) 0 801 802 ##########################################################803 ###### SECTION: ASSIGNMENT OF DATA VARIABLES ##########804 ##########################################################805 872 # phase title 806 873 set entrycmd(phasename) "phaseinfo $crsPhase name" … … 814 881 } 815 882 816 #Procedure call: DisplayU -- Display Anisotropic/Isotropic widget or disable 817 # initialize to diasbled 883 # initialize atoms display & disable 818 884 DisplayAtom 0 0 819 885 DisplayU 0 0 … … 821 887 $expgui(EditingAtoms) config -text "" 822 888 823 DisplayAllAtoms 889 DisplayAllAtoms $crsPhase 824 890 825 891 # enable traces on entryvar now … … 828 894 829 895 set expgui(noreenterDisplayAllAtoms) 0 830 # Populate expgui(atomlistbox) (ScrolledListBox) with atoms from selected phase. 831 proc DisplayAllAtoms {"mode reset"} { 896 # Populate expgui(atomlistbox) (a ScrolledListBox) with atoms 897 # from the selected phase. 898 proc DisplayAllAtoms {curPhase "mode reset"} { 832 899 global entryvar entrycmd expmap expgui 833 # if it does not show, dont bother 900 # if it does not show, we don't have a phase or we are already displaying 901 # don't bother 834 902 if {$expgui(pagenow) != "phaseFrame"} return 835 if {$ expgui(curPhase)== ""} return903 if {$curPhase == ""} return 836 904 if $expgui(noreenterDisplayAllAtoms) return 837 905 # prevent reentry 838 906 set expgui(noreenterDisplayAllAtoms) 1 907 # set the current phase 908 set expgui(curPhase) $curPhase 839 909 if {$mode != "reset"} { 840 910 # save the scrolled position 841 911 set pos [lindex [$expgui(atomlistbox) yview] 0] 842 912 } else { 843 # this is a reset -- clear the selected atoms list913 # for reset, do not keep the previously selected atoms 844 914 set expgui(selectedatomlist) {} 845 915 } 846 916 $expgui(atomlistbox) delete 0 end 847 # loop over atoms 917 # displaying a macromolecular phase? 918 if {[lindex $expmap(phasetype) [expr {$expgui(curPhase) - 1}]] == 4} { 919 set mm 1 920 $expgui(phaseFrame).top.ps.10 config -state disabled 921 $expgui(AddAtomBut) config -state disabled 922 pleasewait "loading atoms..." 923 } else { 924 set mm 0 925 if {[file executable $expgui(exptool)]} { 926 $expgui(phaseFrame).top.ps.10 config -state normal 927 $expgui(AddAtomBut) config -state normal 928 } 929 } 930 931 # prepare header info 848 932 set maxline I 849 933 set phase $expgui(curPhase) … … 853 937 set multhead "Mult" 854 938 set coordhead " " 855 set frachead "Occupancy" 939 if {$mm} { 940 set cmd mmatominfo 941 set frachead "Occ." 942 } else { 943 set cmd atominfo 944 set frachead "Occupancy" 945 } 946 set reshead "res/grp/#" 947 # sort the atoms, as requested 856 948 if {$expgui(asorttype) == "type"} { 857 949 # sort on atom type 858 950 set typehead "type* " 859 951 foreach atom $expmap(atomlist_$phase) { 860 lappend atomlist "$atom [ atominfo$phase $atom type] $phase"952 lappend atomlist "$atom [$cmd $phase $atom type] $phase" 861 953 } 862 954 set expmap(atomlistboxcontents) [lsort -ascii -index 1 $atomlist] … … 869 961 set expmap(atomlistboxcontents) [lsort -integer -index 1 $atomlist] 870 962 } elseif {$expgui(asorttype) == "mult"} { 871 # sort on atom number 872 set multhead "Mlt*" 873 foreach atom $expmap(atomlist_$phase) { 874 lappend atomlist "$atom [atominfo $phase $atom mult] $phase" 875 } 876 set expmap(atomlistboxcontents) [lsort -integer -decreasing -index 1 $atomlist] 963 if {$mm} { 964 set reshead "res*/grp/#" 965 foreach atom $expmap(atomlist_$phase) { 966 lappend atomlist "$atom [mmatominfo $phase $atom residue] $phase" 967 } 968 set expmap(atomlistboxcontents) [lsort -ascii -index 1 $atomlist] 969 } else { 970 # sort on atom number 971 set multhead "Mlt*" 972 foreach atom $expmap(atomlist_$phase) { 973 lappend atomlist "$atom [atominfo $phase $atom mult] $phase" 974 } 975 set expmap(atomlistboxcontents) [lsort -integer -decreasing -index 1 $atomlist] 976 } 877 977 } elseif {$expgui(asorttype) == "occupancy"} { 878 978 # sort on atom number 879 set frachead " Occup* " 979 if {$mm} { 980 set frachead " Occ* " 981 } else { 982 set frachead " Occup* " 983 } 880 984 foreach atom $expmap(atomlist_$phase) { 881 lappend atomlist "$atom [ atominfo$phase $atom frac] $phase"985 lappend atomlist "$atom [$cmd $phase $atom frac] $phase" 882 986 } 883 987 set expmap(atomlistboxcontents) [lsort -real -decreasing -index 1 $atomlist] … … 886 990 set coordhead "(x*)" 887 991 foreach atom $expmap(atomlist_$phase) { 888 lappend atomlist "$atom [ atominfo$phase $atom x] $phase"992 lappend atomlist "$atom [$cmd $phase $atom x] $phase" 889 993 } 890 994 set expmap(atomlistboxcontents) [lsort -real -index 1 $atomlist] … … 893 997 set coordhead "(y*)" 894 998 foreach atom $expmap(atomlist_$phase) { 895 lappend atomlist "$atom [ atominfo$phase $atom y] $phase"999 lappend atomlist "$atom [$cmd $phase $atom y] $phase" 896 1000 } 897 1001 set expmap(atomlistboxcontents) [lsort -real -index 1 $atomlist] … … 900 1004 set coordhead "(z*)" 901 1005 foreach atom $expmap(atomlist_$phase) { 902 lappend atomlist "$atom [ atominfo$phase $atom z] $phase"1006 lappend atomlist "$atom [$cmd $phase $atom z] $phase" 903 1007 } 904 1008 set expmap(atomlistboxcontents) [lsort -real -index 1 $atomlist] … … 907 1011 } 908 1012 1013 set expgui(atomlistboxline) {} 1014 # loop over atoms 909 1015 foreach tuple $expmap(atomlistboxcontents) { 910 1016 set atom [lindex $tuple 0] 911 1017 set phase [lindex $tuple 2] 912 set refflag {} 1018 lappend expgui(atomlistboxline) $atom 1019 $expgui(atomlistbox) insert end \ 1020 [FormatAtomLine $atom $phase maxline] 1021 } 1022 $expgui(atomtitle) delete 0 end 1023 1024 # create the header 1025 if {$mm} { 1026 $expgui(atomtitle) insert end [format "%12s %9s %6s %8s%29s %4s %s" \ 1027 $namehead $reshead $typehead "ref/damp " \ 1028 "fractional coordinates$coordhead" \ 1029 "$frachead" \ 1030 " Uiso"] 1031 donewait 1032 } elseif {$maxline == "A"} { 1033 $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s %s" \ 1034 $namehead $typehead "ref/damp " \ 1035 "fractional coordinates$coordhead" \ 1036 "$multhead $frachead" \ 1037 " Uiso/Uij "] 1038 } else { 1039 $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s %s" \ 1040 $namehead $typehead "ref/damp " \ 1041 "fractional coordinates$coordhead" \ 1042 "$multhead $frachead" \ 1043 " Uiso"] 1044 } 1045 if {$mode != "reset"} { 1046 # restore the selected items 1047 foreach i $expgui(selectedatomlist) { 1048 $expgui(atomlistbox) selection set $i 1049 } 1050 # restore the last scrolled position 1051 $expgui(atomlistbox) yview moveto $pos 1052 } 1053 # clear the reentry flag 1054 set expgui(noreenterDisplayAllAtoms) 0 1055 } 1056 1057 proc FormatAtomLine {atom phase maxline_var} { 1058 global expmap 1059 if {[lindex $expmap(phasetype) [expr {$phase - 1}]] == 4} { 1060 foreach type {x u f} { 1061 if {[mmatominfo $phase $atom ${type}ref]} { 1062 append refflag "[string toupper $type][mmatominfo $phase $atom ${type}damp] " 1063 } else { 1064 append refflag " [mmatominfo $phase $atom ${type}damp] " 1065 } 1066 } 1067 set line [format \ 1068 "%5d %-6s %-3s%-2s%4d %-6s %8s %9.5f%9.5f%9.5f%8.4f %7.4f" \ 1069 $atom \ 1070 [mmatominfo $phase $atom label] \ 1071 [mmatominfo $phase $atom residue] \ 1072 [mmatominfo $phase $atom group] \ 1073 [mmatominfo $phase $atom resnum] \ 1074 [mmatominfo $phase $atom type] \ 1075 $refflag \ 1076 [mmatominfo $phase $atom x] \ 1077 [mmatominfo $phase $atom y] \ 1078 [mmatominfo $phase $atom z] \ 1079 [mmatominfo $phase $atom frac] \ 1080 [mmatominfo $phase $atom Uiso] 1081 ] 1082 } elseif {[atominfo $phase $atom temptype] == "A"} { 913 1083 foreach type {x u f} { 914 1084 if {[atominfo $phase $atom ${type}ref]} { … … 916 1086 } else { 917 1087 append refflag " [atominfo $phase $atom ${type}damp] " 918 } 919 } 1088 } 1089 } 1090 # want to set maxline in parent 1091 upvar $maxline_var maxline 1092 set maxline A 1093 # aniso 920 1094 set line [format "%3d %-6s %-6s %8s %10.6f%10.6f%10.6f%4d%9.4f" \ 921 1095 $atom \ … … 929 1103 [atominfo $phase $atom frac] 930 1104 ] 931 932 # add temperature factors (iso/anoiso) 933 if {[atominfo $phase $atom temptype] == "A"} { 934 set maxline A 935 append line [format " %9.5f%9.5f%9.5f%9.5f%9.5f%9.5f" \ 936 [atominfo $phase $atom U11] \ 937 [atominfo $phase $atom U22] \ 938 [atominfo $phase $atom U33] \ 939 [atominfo $phase $atom U12] \ 940 [atominfo $phase $atom U23] \ 941 [atominfo $phase $atom U13] 942 ] 943 } else { 944 append line [format " %9.5f" \ 945 [atominfo $phase $atom Uiso] 946 ] 947 } 948 $expgui(atomlistbox) insert end $line 949 } 950 $expgui(atomtitle) delete 0 end 951 if {$maxline == "A"} { 952 $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s %s" \ 953 $namehead $typehead "ref/damp " \ 954 "fractional coordinates$coordhead" \ 955 "$multhead $frachead" \ 956 " Uiso/Uij "] 1105 append line [format " %9.5f%9.5f%9.5f%9.5f%9.5f%9.5f" \ 1106 [atominfo $phase $atom U11] \ 1107 [atominfo $phase $atom U22] \ 1108 [atominfo $phase $atom U33] \ 1109 [atominfo $phase $atom U12] \ 1110 [atominfo $phase $atom U23] \ 1111 [atominfo $phase $atom U13] 1112 ] 957 1113 } else { 958 $expgui(atomtitle) insert end [format "%10s %6s %8s%29s %9s %s" \ 959 $namehead $typehead "ref/damp " \ 960 "fractional coordinates$coordhead" \ 961 "$multhead $frachead" \ 962 " Uiso"] 963 } 964 if {$mode != "reset"} { 965 # restore the selected items 966 foreach i $expgui(selectedatomlist) { 967 $expgui(atomlistbox) selection set $i 968 } 969 # restore the last scrolled position 970 $expgui(atomlistbox) yview moveto $pos 971 } 972 set expgui(noreenterDisplayAllAtoms) 0 1114 foreach type {x u f} { 1115 if {[atominfo $phase $atom ${type}ref]} { 1116 append refflag "[string toupper $type][atominfo $phase $atom ${type}damp] " 1117 } else { 1118 append refflag " [atominfo $phase $atom ${type}damp] " 1119 } 1120 } 1121 set line [format \ 1122 "%3d %-6s %-6s %8s %10.6f%10.6f%10.6f%4d%9.4f %9.5f" \ 1123 $atom \ 1124 [atominfo $phase $atom label] \ 1125 [atominfo $phase $atom type] \ 1126 $refflag \ 1127 [atominfo $phase $atom x] \ 1128 [atominfo $phase $atom y] \ 1129 [atominfo $phase $atom z] \ 1130 [atominfo $phase $atom mult] \ 1131 [atominfo $phase $atom frac] \ 1132 [atominfo $phase $atom Uiso] 1133 ] 1134 } 1135 return $line 1136 } 1137 1138 # update the display of atom as they are changed 1139 proc UpdateAtomLine {atomlist phase} { 1140 global expgui 1141 # for lots of atoms, it is faster to repaint the listbox 1142 if {[llength $atomlist] > 25} { 1143 DisplayAllAtoms $expgui(curPhase) noreset 1144 return 1145 } 1146 foreach atom $atomlist { 1147 set linenum [lsearch -exact $expgui(atomlistboxline) $atom] 1148 $expgui(atomlistbox) delete $linenum 1149 $expgui(atomlistbox) insert $linenum \ 1150 [FormatAtomLine $atom $phase maxline] 1151 } 1152 # restore the selected items 1153 foreach i $expgui(selectedatomlist) { 1154 $expgui(atomlistbox) selection set $i 1155 } 973 1156 } 974 1157 … … 1038 1221 # format a string of numbers to save space, e.g. "1 2 3 4 6 7 19 13 14 15" 1039 1222 # becomes "1-4,6,7,13-15,19" 1040 proc CompressList {numberList } {1223 proc CompressList {numberList "max 9999"} { 1041 1224 # format the number list to save space 1042 1225 set lastnum -99 1043 1226 set flist {} 1044 1227 set count 0 1228 set length 0 1045 1229 if [catch {set sortlist [lsort -integer $numberList]}] {return $numberList} 1046 1230 foreach num $sortlist { 1047 set next [expr $lastnum+1] 1048 if {$num != $next} { 1049 if {$count == 0 && $flist != ""} { 1231 set next [expr $lastnum+1] 1232 if {$num != $next} { 1233 if {$count == 0 && $flist != ""} { 1234 if {[string length $flist] - $length > $max} { 1235 set length [string length $flist] 1236 append flist ",\n$num" 1237 } else { 1050 1238 append flist ",$num" 1051 } elseif {$count == 1 && $flist != ""} { 1239 } 1240 } elseif {$count == 1 && $flist != ""} { 1241 if {[string length $flist] - $length > $max} { 1242 set length [string length $flist] 1243 append flist ",$lastnum,\n$num" 1244 } else { 1052 1245 append flist ",$lastnum,$num" 1053 } elseif {$flist != ""} { 1246 } 1247 } elseif {$flist != ""} { 1248 if {[string length $flist] - $length > $max} { 1249 set length [string length $flist] 1250 append flist "-$lastnum,\n$num" 1251 } else { 1054 1252 append flist "-$lastnum,$num" 1253 } 1055 1254 } else { 1056 1255 append flist "$num" … … 1076 1275 # or disables the widet entirly if atom = 0 1077 1276 proc DisplayU { atomnum p} { 1078 global expgui entryvar entrycmd 1277 global expgui entryvar entrycmd expmap 1278 set mm 0 1079 1279 if {$atomnum == 0} { 1080 1280 set iOrA disable 1281 } elseif {[lindex $expmap(phasetype) 0] == 4} { 1282 set mm 1 1283 set iOrA I 1081 1284 } else { 1082 1285 set iOrA [atominfo $p $atomnum temptype] … … 1111 1314 -fg $expgui(bkgcolor1) -bg $expgui(bkgcolor1) \ 1112 1315 -state disabled 1316 } elseif {$mm} { 1317 set entrycmd(U11) "mmatominfo $p $atomnum Uiso" 1318 set entryvar(U11) [eval $entrycmd(U11)] 1319 $firstbox config -text Uiso -fg black 1320 [lindex $expgui(anisoentry) 0] config -fg black -bg white -state normal 1113 1321 } else { 1114 1322 set entrycmd(U11) "atominfo $p $atomnum Uiso" … … 1124 1332 # Procedure to display refinement flags 1125 1333 proc DisplayRefFlags { atomnum p} { 1126 global expgui entryvar entrycmd 1334 global expgui entryvar entrycmd expmap 1127 1335 if {$atomnum == 0} { 1128 1336 foreach label $expgui(atomreflbl) { … … 1144 1352 $entry config -state normal -fg black -bg $expgui(bkgcolor1) 1145 1353 } 1146 foreach var {xref uref fref xdamp udamp fdamp} { 1147 set entrycmd($var) "atominfo $p [list $atomnum] $var" 1148 set entryvar($var) [eval $entrycmd($var)] 1354 if {[lindex $expmap(phasetype) 0] == 4} { 1355 foreach var {xref uref fref xdamp udamp fdamp} { 1356 set entrycmd($var) "mmatominfo $p [list $atomnum] $var" 1357 set entryvar($var) [eval $entrycmd($var)] 1358 } 1359 } else { 1360 foreach var {xref uref fref xdamp udamp fdamp} { 1361 set entrycmd($var) "atominfo $p [list $atomnum] $var" 1362 set entryvar($var) [eval $entrycmd($var)] 1363 } 1149 1364 } 1150 1365 } … … 1152 1367 # Procedure to display an atom in the atom edit boxes 1153 1368 proc DisplayAtom { atomnum p} { 1154 global expgui entryvar entrycmd 1369 global expgui entryvar entrycmd expmap 1155 1370 if {$atomnum == 0} { 1156 1371 foreach label $expgui(atomlabels) { … … 1169 1384 $entry config -state normal -fg black -bg white 1170 1385 } 1171 foreach var {x y z label frac } { 1172 set entrycmd($var) "atominfo $p $atomnum $var" 1173 set entryvar($var) [eval $entrycmd($var)] 1386 if {[lindex $expmap(phasetype) 0] == 4} { 1387 foreach var {x y z label frac } { 1388 set entrycmd($var) "mmatominfo $p $atomnum $var" 1389 set entryvar($var) [eval $entrycmd($var)] 1390 } 1391 } else { 1392 foreach var {x y z label frac } { 1393 set entrycmd($var) "atominfo $p $atomnum $var" 1394 set entryvar($var) [eval $entrycmd($var)] 1395 } 1174 1396 } 1175 1397 } … … 2655 2877 {phaseFrame Phase \ 2656 2878 "" \ 2657 "SelectOnePhase \$expgui(curPhase); DisplayAllAtoms noreset"\2879 {SelectOnePhase $expgui(curPhase)} \ 2658 2880 0 expgui2.html ""} 2659 2881 {histFrame Histogram \ … … 2692 2914 set expgui($frm) [\ 2693 2915 .n insert end $frm -text [lindex $item 1] \ 2694 -createcmd [lindex $item 2]\2916 -createcmd "set expgui(pagenow) $frm; [lindex $item 2]" \ 2695 2917 -raisecmd "set expgui(pagenow) $frm; [lindex $item 3]"] 2696 2918 … … 2718 2940 } 2719 2941 lappend expgui(frameactionlist) "lsFrame SetupExtractHist" 2720 lappend expgui(frameactionlist) "phaseFrame {DisplayAllAtoms noreset}"2942 lappend expgui(frameactionlist) "phaseFrame {DisplayAllAtoms $expgui(curPhase) noreset}" 2721 2943 lappend expgui(frameactionlist) "histFrame DisplayHistogram" 2722 2944 lappend expgui(frameactionlist) "fracFrame DisplayFrac" … … 2732 2954 global expgui 2733 2955 if $expgui(haveBW) { 2956 set expgui(pagenow) $nextpage 2734 2957 .n see $nextpage 2735 2958 .n raise $nextpage 2736 set expgui(pagenow) $nextpage2737 2959 } else { 2738 2960 Notebook:raise .n $nextpage … … 2835 3057 incr i 2836 3058 set expgui(asorttype) [lindex {number type mult x y z occupancy number} $i] 2837 DisplayAllAtoms 2838 } 2839 bind $expgui(atomtitle) <Button-3> {set expgui(asorttype) number; DisplayAllAtoms }3059 DisplayAllAtoms $expgui(curPhase) 3060 } 3061 bind $expgui(atomtitle) <Button-3> {set expgui(asorttype) number; DisplayAllAtoms $expgui(curPhase)} 2840 3062 2841 3063 $expgui(atomtitle) configure -selectmode extended … … 2870 3092 -command {MakeAddAtomsBox $expgui(curPhase)} 2871 3093 grid $frame3.newa -column 11 -row 0 3094 set expgui(AddAtomBut) $frame3.newa 2872 3095 } 2873 3096 button [set expgui(atomxform) $frame3.xa] \ … … 3002 3225 } 3003 3226 } 3227 3004 3228 grid [frame $expgui(histFrame).bb] -column 1 -row 6 3005 3229 if [file executable $expgui(exptool)] { … … 3041 3265 -row 2 -column 4 -sticky news -padx 4 -pady 3 -sticky e 3042 3266 #^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^END OF HISTOGRAM PANE CODE ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3043 # insert the histograms & resize in case the pane needs more space 3267 # insert the histograms & resize in case the pane needs more space 3044 3268 sethistlist 3045 3269 ResizeNotebook … … 3398 3622 menu $expgui(fm).option.menu.asort 3399 3623 foreach opt {number type mult x y z occupancy} { 3400 $expgui(fm).option.menu.asort add radiobutton -command DisplayAllAtoms\3624 $expgui(fm).option.menu.asort add radiobutton -command {DisplayAllAtoms $expgui(curPhase)}\ 3401 3625 -label $opt -value $opt -variable expgui(asorttype) 3402 3626 } … … 3482 3706 3483 3707 if {$expgui(shell)} { 3708 # add an export command to the last menu that gets filled in later 3709 $expgui(fm).$m.menu add cascade -label "Coord Export" \ 3710 -menu $expgui(fm).$m.menu.coordexp 3711 menu $expgui(fm).$m.menu.coordexp \ 3712 -postcommand "BuildCoordExpMenu $expgui(fm).$m.menu.coordexp" 3713 $expgui(fm).$m.menu.coordexp add command -label "Building menu" \ 3714 -state disabled 3715 $expgui(fm).$m.menu.coordexp add command -label "Please wait..." \ 3716 -state disabled 3717 3484 3718 # add the commands in expgui_menulist 3485 3719 foreach menu [array names expgui_menulist ] { … … 3540 3774 #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF MENU DEFINITION ^^^^^^^^^^^^^^^^^^^ 3541 3775 3542 # make the phase pane 3776 # make the phase pane -- this must be done before setphases 3777 # can be called (in loadexp) 3543 3778 MakePhasePane 3544 3779 # and the rest of the windows w/o BWidget 3545 if !$expgui(haveBW){3780 if {!$expgui(haveBW)} { 3546 3781 MakeHistPane 3547 3782 MakeScalingPane … … 3553 3788 bind . <Control-c> catchQuit 3554 3789 3555 set expgui(curPhase) ""3556 3790 set expgui(pagenow) "" 3557 3791 set expgui(curhist) {} … … 3560 3794 loadexp $expgui(expfile) 3561 3795 3562 # select the 1st phase3563 SelectOnePhase [lindex $expmap(phaselist) 0] 3796 # reset the phase selection 3797 set expgui(curPhase) {} 3564 3798 # select the first histogram in the list by default (if there are any) 3565 3799 if {[llength $expmap(histlistboxcontents)] > 0} {
Note: See TracChangeset
for help on using the changeset viewer.