Changeset 1005 for branches/sandbox/distrest.tcl
- Timestamp:
- Sep 15, 2010 5:54:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sandbox/distrest.tcl
r1004 r1005 42 42 -sticky sw -columnspan 2 43 43 44 set h_list .hard_list 44 45 45 foreach {top main side lbl} [MakeScrollTable $rightfr] {} 46 46 47 button $top.alabel1 -text "Atom 1 " 48 button $top.alabel2 -text "Atom 2 " 49 label $top.rlabel1 -text "Restraint" 50 label $top.rlabel2 -text "esd" 51 52 grid $top.alabel1 -column 1 -row 2 53 grid $top.alabel2 -column 2 -row 2 47 set atom1_state 1 48 set atom2_state 1 49 50 button $top.alabel1 -text "Atom 1" -width 6 -anchor center \ 51 -command "SR_Sort atom1 $main $top.alabel1 $top.alabel2 {}" 52 53 button $top.alabel2 -text "Atom 2" -width 6 -anchor center \ 54 -command "SR_Sort atom2 $main $top.alabel1 $top.alabel2 {}" 55 56 label $top.rlabel1 -text "Restraint" -width 9 -anchor center 57 label $top.rlabel2 -text "esd" -width 9 -anchor center 58 59 grid $top.alabel1 -column 1 -row 2 -padx 3 60 grid $top.alabel2 -column 2 -row 2 -padx 3 54 61 grid $top.rlabel1 -column 4 -row 2 55 62 grid $top.rlabel2 -column 5 -row 2 … … 66 73 #source c:/gsas/expgui/readexp.tcl 67 74 #source c:/gsas/expgui/gsascmds.tcl 75 76 77 78 68 79 69 80 #********************************************************************************************* … … 176 187 # Procedure to sort soft restraints --------------------------------------------- 177 188 #************************************************************************************** 178 proc SR_Sort {whichbutton main } {189 proc SR_Sort {whichbutton main alabel1 alabel2 dlabel1} { 179 190 # reset all button labels 180 $ ::sr_top.alabel1 config -text "Atom 1"181 $ ::sr_top.alabel2 config -text "Atom 2"182 $::sr_top.dlabel1 config -text "Distance"191 $alabel1 config -text "Atom 1" 192 $alabel2 config -text "Atom 2" 193 if {$dlabel1 != ""} {$dlabel1 config -text "Distance"} 183 194 184 195 if {$whichbutton == "atom1"} { … … 186 197 set sr_prsort [lsort -integer -decreasing -index 1 $::sr_bond_list] 187 198 188 $ ::sr_top.alabel1 config -text "Atom 1 \u2193"199 $alabel1 config -text "Atom 1 \u2193" 189 200 } else { 190 201 set sr_prsort [lsort -integer -increasing -index 1 $::sr_bond_list] 191 $ ::sr_top.alabel1 config -text "Atom 1 \u2191"202 $alabel1 config -text "Atom 1 \u2191" 192 203 } 193 204 set x [expr $::sr_atom1_button * -1] … … 197 208 if {$::sr_atom2_button == 1} { 198 209 set sr_prsort [lsort -integer -decreasing -index 2 $::sr_bond_list] 199 $ ::sr_top.alabel2 config -text "Atom 2 \u2193"210 $alabel2 config -text "Atom 2 \u2193" 200 211 } else { 201 212 set sr_prsort [lsort -integer -increasing -index 2 $::sr_bond_list] 202 $ ::sr_top.alabel2 config -text "Atom 2 \u2191"213 $alabel2 config -text "Atom 2 \u2191" 203 214 } 204 215 set x [expr $::sr_atom2_button * -1] … … 208 219 puts "distance" 209 220 set sr_prsort [lsort -increasing -index 8 $::sr_bond_list] 210 $ ::sr_top.dlabel1 config -text "Distance \u2193"221 $dlabel1 config -text "Distance \u2193" 211 222 } else { 212 223 set sr_prsort [lsort -decreasing -index 8 $::sr_bond_list] 213 $ ::sr_top.dlabel1 config -text "Distance \u2191"224 $dlabel1 config -text "Distance \u2191" 214 225 } 215 226 set x [expr $::sr_distance_button * -1] … … 233 244 set ::contraintmainbox $main 234 245 235 button $::sr_top.alabel1 -text "Atom 1 " -command "SR_Sort atom1 $main" 236 button $::sr_top.alabel2 -text "Atom 2 " -command "SR_Sort atom2 $main" 237 button $::sr_top.dlabel1 -text "Distance " -command "SR_Sort distance $main" 246 button $::sr_top.alabel1 -text "Atom 1 " \ 247 -command "SR_Sort atom1 $main $::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1" 248 button $::sr_top.alabel2 -text "Atom 2 " \ 249 -command "SR_Sort atom2 $main $::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1" 250 button $::sr_top.dlabel1 -text "Distance " \ 251 -command "SR_Sort distance $main $::sr_top.alabel1 $::sr_top.alabel2 $::sr_top.dlabel1" 238 252 239 253 grid $::sr_top.alabel1 -column 1 -row 2
Note: See TracChangeset
for help on using the changeset viewer.