Changeset 935
- Timestamp:
- Mar 3, 2010 9:27:00 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/expgui_cfg.html
r930 r935 166 166 files that cannot be 167 167 run at the time when the files are sourced. <I>(added in EXPGUI v1.21)</I> 168 </DL> 169 <P><B>Window location variables.</B> These variables determine where 170 the EXPGUI window is located on the screen. 171 Note that regardless of the values, the window will never be placed so 172 that any part is outside of the screen. 173 <DL> 174 <DT><FONT FACE="COURIER">expgui(xpos)</FONT><DD> 175 Horizontal window location where 0 is fully to the left and 100 is 176 fully to the right. Default is 50 (middle). 177 <DT><FONT FACE="COURIER">expgui(ypos)</FONT><DD> 178 Vertical window location where 0 is fully to the top and 100 is 179 fully to the bottom. Default is 50 (middle). 180 <DT><FONT FACE="COURIER">expgui(poscenter)</FONT><DD> 181 Specifies what part of the window is placed at the specifed location: N for top and S for 182 bottom; W for left and E for right. These letters can be combined, 183 so that NS centers vertically and EW centers horizontally. Default 184 is the middle of the window (NSEW). 185 <P> 186 <B>Example 1:</B> This code placed in the localconfig or gsas.config 187 (or .gsas_config) file causes the window to be placed in the lower 188 right side of the screen. Depending on the screen size, it may be 189 flush to the bottom-left: 190 <blockquote><PRE> 191 set expgui(xpos) 25 192 set expgui(ypos) 75 193 </PRE></blockquote> 194 <P> 195 <B>Example 2:</B> Instead, this code causes the window to be placed on the right side of 196 the screen, vertically centered, but only when the screen has more than 2000 pixels (probably 197 indicating a dual-screen configuration) 198 <blockquote><PRE> 199 if {[winfo screenwidth .] > 2000} { 200 set expgui(xpos) 25 201 } 202 </PRE></blockquote> 203 204 </DL> 205 168 206 </DL></DL> 169 207 … … 210 248 other systems do not. You can toggle this option using the 211 249 "Override Backspace" option on the file menu to see what works for you. 212 213 250 </DL></DL> 214 251 -
trunk/expgui
r930 r935 223 223 } 224 224 } 225 # do we have a PGPLOT fonts file? 226 # if it is in the "wrong" place/name -- make it "right" 227 if {![file exists [file join $expgui(gsasdir) pgl grfont.dat]] && \ 228 [file exists [file join $expgui(gsasdir) fonts grfont.dat]]} { 229 catch {file mkdir [file join $expgui(gsasdir) pgl]} 230 file copy [file join $expgui(gsasdir) fonts grfont.dat] \ 231 [file join $expgui(gsasdir) pgl grfont.dat] 232 } 233 # do we have a PGPLOT fonts file? 234 if {![file exists [file join $expgui(gsasdir) pgl grfont.dat]] && \ 235 [file exists [file join $expgui(gsasdir) fonts pgfont.dat]]} { 236 catch {file mkdir [file join $expgui(gsasdir) pgl]} 237 file copy [file join $expgui(gsasdir) fonts pgfont.dat] \ 238 [file join $expgui(gsasdir) pgl grfont.dat] 239 } 240 # do we have a PGPLOT fonts file? 241 if {![file exists [file join $expgui(gsasdir) pgl grfont.dat]] && \ 242 [file exists [file join $expgui(gsasdir) pgl pgfont.dat]]} { 243 file copy [file join $expgui(gsasdir) pgl pgfont.dat] \ 244 [file join $expgui(gsasdir) pgl grfont.dat] 245 } 246 if ![file exists [file join $expgui(gsasdir) pgl grfont.dat]] { 225 # find the pgplot directory 226 if {[file exists [file join $expgui(gsasdir) pgl]]} { 227 set expgui(pgplotdir) [file join $expgui(gsasdir) pgl] 228 } elseif {[file exists [file join $expgui(gsasdir) pgplot]]} { 229 set expgui(pgplotdir) [file join $expgui(gsasdir) pgplot] 230 } else { 247 231 MyMessageBox -parent . -title "PGPLOT Error" \ 248 -message "Warning -- Unable to find file GRFONT.DAT in [file join $expgui(gsasdir) pgl]. GSAS graphics will not work. Is GSAS correctly installed?" \ 232 -message "Warning -- Unable to find PGPLOT directory. GSAS graphics will not work without this. Is GSAS correctly installed?" \ 233 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \ 234 -helplink "expguierr.html NoPGPLOT" 235 set expgui(resize) 1 236 set expgui(pgplotdir) "" 237 } 238 239 # old code used to fix up bad distributions 240 # # do we have a PGPLOT fonts file? 241 # # if it is in the "wrong" place/name -- make it "right" 242 # if {![file exists [file join $expgui(pgplotdir) grfont.dat]] && \ 243 # [file exists [file join $expgui(gsasdir) fonts grfont.dat]]} { 244 # catch {file mkdir $expgui(pgplotdir)} 245 # file copy [file join $expgui(gsasdir) fonts grfont.dat] \ 246 # [file join $expgui(pgplotdir) grfont.dat] 247 # } 248 # # do we have a PGPLOT fonts file? 249 # if {![file exists [file join $expgui(pgplotdir) grfont.dat]] && \ 250 # [file exists [file join $expgui(gsasdir) fonts pgfont.dat]]} { 251 # catch {file mkdir $expgui(pgplotdir)} 252 # file copy [file join $expgui(gsasdir) fonts pgfont.dat] \ 253 # [file join $expgui(pgplotdir) grfont.dat] 254 # } 255 # # do we have a PGPLOT fonts file? 256 # if {![file exists [file join $expgui(pgplotdir) grfont.dat]] && \ 257 # [file exists [file join $expgui(pgplotdir) pgfont.dat]]} { 258 # file copy [file join $expgui(pgplotdir) pgfont.dat] \ 259 # [file join $expgui(pgplotdir) grfont.dat] 260 # } 261 262 if { $expgui(pgplotdir) != "" && \ 263 ![file exists [file join $expgui(pgplotdir) grfont.dat]]} { 264 MyMessageBox -parent . -title "PGPLOT Error" \ 265 -message "Warning -- Unable to find file GRFONT.DAT in $expgui(pgplotdir). GSAS graphics will not work. Is GSAS correctly installed?" \ 249 266 -icon warning -type {"Limp Ahead"} -default "Limp Ahead" \ 250 267 -helplink "expguierr.html NoPGPLOT" … … 282 299 } 283 300 if {$expgui(expfile) == ""} { 284 # center the parent window because the getExpFileName window 285 # will be centered above it. 286 wm withdraw . 287 set x [expr [winfo screenwidth .]/2 - [winfo reqwidth .]/2 ] 288 set y [expr [winfo screenheight .]/2 - [winfo reqheight .]/2] 289 wm geom . +$x+$y 290 wm deiconify . 301 # place the parent window because the getExpFileName window will be centered above it. 302 set xpos 50 303 catch {set xpos $expgui(xpos)} 304 set ypos 50 305 catch {set ypos $expgui(ypos)} 306 set poscntr "nsew" 307 catch {set posnctr $expgui(poscenter)} 308 LocateWindow "." $xpos $ypos $poscntr 291 309 # windows needed this update before when using tk_getOpenFile. 292 310 # I am not sure it is still needed. … … 4390 4408 #wm geom . [winfo reqwidth .]x[winfo reqheight .] 4391 4409 wm geom . {} 4392 # center the EXPGUI window 4393 wm withdraw . 4394 set x [expr [winfo screenwidth .]/2 - [winfo reqwidth .]/2 ] 4395 set y [expr [winfo screenheight .]/2 - [winfo reqheight .]/2] 4396 wm geom . +$x+$y 4397 wm deiconify . 4398 } 4399 4410 } 4411 # place the EXPGUI window 4412 set xpos 50 4413 catch {set xpos $expgui(xpos)} 4414 set ypos 50 4415 catch {set ypos $expgui(ypos)} 4416 set poscntr "nsew" 4417 catch {set posnctr $expgui(poscenter)} 4418 LocateWindow "." $xpos $ypos $poscntr 4419 update 4400 4420 RaisePage lsFrame 4401 4421 if {[CountHistory] > 200} { -
trunk/gsascmds.tcl
r930 r935 464 464 afterputontop 465 465 return $makenew(result) 466 } 467 468 # place a window on a selected part of the screen 469 # xfrac specifies the hozontal position with 0 to the left and 100 to the right 470 # yfrac specifies the vertical position with 0 to the top and 100 to the bottom 471 # loc chooses the part of the window to place at that location: N: upper, S: lower, W: left, E: right 472 # use NSEW for center 473 proc LocateWindow {win {xfrac 50} {yfrac 50} {loc c}} { 474 wm withdraw $win 475 set maxx [winfo screenwidth $win] 476 set maxy [winfo screenheight $win] 477 set reqx [winfo reqwidth $win] 478 set reqy [winfo reqheight $win] 479 set x [expr {$maxx*$xfrac/100.}] 480 set y [expr {$maxy*$yfrac/100.}] 481 if {[string match -nocase "*e*" $loc] && [string match -nocase "*w*" $loc]} { 482 # EW: center 483 set x [expr {$x - $reqx/2. }] 484 } elseif {[string match -nocase "*e*" $loc]} { 485 # right corner 486 set x [expr {$x - $reqx}] 487 } elseif {[string match -nocase "*w*" $loc]} { 488 # left corner -- do nothing 489 } else { 490 # center 491 set x [expr {$x - $reqx/2. }] 492 } 493 if {[string match -nocase "*n*" $loc] && [string match -nocase "*s*" $loc]} { 494 # NS: center 495 set y [expr {$y - $reqy/2 }] 496 } elseif {[string match -nocase "*n*" $loc]} { 497 # upper corner -- do nothing 498 } elseif {[string match -nocase "*s*" $loc]} { 499 # lower corner 500 set y [expr {$y - $reqy}] 501 } else { 502 # center 503 set y [expr {$y - $reqy/2 }] 504 } 505 set x [expr {int($x + 0.5)}] 506 set y [expr {int($y + 0.5)}] 507 if {$x < 0} {set x 0} 508 if {$x > $maxx-$reqx} {set x [expr {$maxx-$reqx}]} 509 if {$y < 0} {set y 0} 510 if {$y > $maxy-$reqy} {set y [expr {$maxy-$reqy}]} 511 wm geom $win +$x+$y 512 wm deiconify $win 466 513 } 467 514 … … 2525 2572 set env(GSAS) [file nativename $expgui(gsasdir)] 2526 2573 # PGPLOT_FONT is needed by PGPLOT 2527 set env(PGPLOT_FONT) [file nativename [file join $expgui( gsasdir) pglgrfont.dat]]2574 set env(PGPLOT_FONT) [file nativename [file join $expgui(pgplotdir) grfont.dat]] 2528 2575 # this is the number of lines/page in the .LST (etc.) file 2529 2576 set env(LENPAGE) 60 … … 2611 2658 set env(GSAS) [file nativename $expgui(gsasdir)] 2612 2659 # PGPLOT_FONT is needed by PGPLOT 2613 set env(PGPLOT_FONT) [file nativename [file join $expgui( gsasdir) pglgrfont.dat]]2660 set env(PGPLOT_FONT) [file nativename [file join $expgui(pgplotdir) grfont.dat]] 2614 2661 # this is the number of lines/page in the .LST (etc.) file 2615 2662 set env(LENPAGE) 60 … … 2638 2685 # replace the forward slashes with backward 2639 2686 regsub -all / $cmd \\ cmd 2687 # use of file attributes -shortname & normalize and nativename 2688 # might help here 2640 2689 exec $env(COMSPEC) /c \ 2641 2690 "start [file join $expgui(scriptdir) $script] $cmd" … … 2671 2720 set env(ATMXSECT) [file join $expgui(gsasdir) data atmxsect.dat] 2672 2721 # PGPLOT_DIR is needed by PGPLOT 2673 set env(PGPLOT_DIR) [file join $expgui(gsasdir) pgl]2722 set env(PGPLOT_DIR) $expgui(pgplotdir) 2674 2723 # this is the number of lines/page in the .LST (etc.) file 2675 2724 set env(LENPAGE) 60 … … 2717 2766 set env(GSAS) [file nativename $expgui(gsasdir)] 2718 2767 # PGPLOT_FONT is needed by PGPLOT 2719 set env(PGPLOT_FONT) [file nativename [file join $expgui( gsasdir) pglgrfont.dat]]2768 set env(PGPLOT_FONT) [file nativename [file join $expgui(pgplotdir) grfont.dat]] 2720 2769 # this is the number of lines/page in the .LST (etc.) file 2721 2770 set env(LENPAGE) 60 … … 2737 2786 set env(ATMXSECT) [file join $expgui(gsasdir) data atmxsect.dat] 2738 2787 # PGPLOT_DIR is needed by PGPLOT 2739 set env(PGPLOT_DIR) [file join $expgui(gsasdir) pgl]2788 set env(PGPLOT_DIR) $expgui(pgplotdir) 2740 2789 # this is the number of lines/page in the .LST (etc.) file 2741 2790 set env(LENPAGE) 60 -
trunk/import_cif.tcl
r930 r935 173 173 z [ValueFromCIF block${i} _atom_site_fract_z] \ 174 174 lbl $lbllist uiso $uisolist occ $occlist type $typelist { 175 if {$uiso == ""} {set uiso 0.025} 175 # deal with defaults 176 if {$occ == "" || $occ == "."} {set occ 1.0} 177 if {$uiso == "" || $uiso == "."} {set uiso 0.025} 176 178 # should not be any quotes, but remove them, if there are 177 179 foreach var {lbl type} {
Note: See TracChangeset
for help on using the changeset viewer.