Changeset 924
- Timestamp:
- Dec 4, 2009 5:14:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsascmds.tcl
- Property rcs:date changed from 2008/04/15 17:20:39 to 2008/07/14 01:19:02
- Property rcs:lines changed from +404 -12 to +73 -18
- Property rcs:rev changed from 1.64 to 1.65
r910 r924 485 485 set expgui(temp) $initvalue 486 486 pack [frame $w.b -bg beige] -side top -fill x -expand yes 487 pack [button $w.b.2 -text Set-command "destroy $w"] -side left487 pack [button $w.b.2 -text Continue -command "destroy $w"] -side left 488 488 if $quit { 489 489 pack [button $w.b.3 -text Quit \ … … 1506 1506 # open a new window 1507 1507 catch {toplevel .disagl} 1508 eval destroy [winfo child .disagl] 1509 set txt .disagl.txt 1508 1510 catch {eval grid forget [grid slaves .disagl]} 1509 text .disagl.txt -width 100 -wrap none \1511 text $txt -width 100 -wrap none \ 1510 1512 -yscrollcommand ".disagl.yscroll set" \ 1511 1513 -xscrollcommand ".disagl.xscroll set" 1512 scrollbar .disagl.yscroll -command " .disagl.txt yview"1513 scrollbar .disagl.xscroll -command " .disagl.txt xview" -orient horizontal1514 scrollbar .disagl.yscroll -command "$txt yview" 1515 scrollbar .disagl.xscroll -command "$txt xview" -orient horizontal 1514 1516 grid .disagl.xscroll -column 0 -row 2 -sticky ew 1515 grid .disagl.txt -column 0 -row 1 -sticky nsew1517 grid $txt -column 0 -row 1 -sticky nsew 1516 1518 grid .disagl.yscroll -column 1 -row 1 -sticky ns 1517 1519 grid [frame .disagl.f] -column 0 -columnspan 2 -row 3 -sticky ew … … 1526 1528 # allow font changes on the fly 1527 1529 if {$tcl_version >= 8.0} { 1528 .disagl.txt config -font $txtvw(font)1530 $txt config -font $txtvw(font) 1529 1531 set fontbut [tk_optionMenu .disagl.f.font txtvw(font) ""] 1530 1532 grid .disagl.f.font -column 1 -row 0 -sticky w … … 1534 1536 $fontbut add command -label "Courier $f" -font "Courier $f"\ 1535 1537 -command "set txtvw(font) \"Courier $f\"; \ 1536 .disagl.txt config -font \$txtvw(font)"1538 $txt config -font \$txtvw(font)" 1537 1539 } 1538 1540 } … … 1543 1545 wm iconname .disagl "DISAGL $root" 1544 1546 set in [open $root.tmp r] 1545 .disagl.txt insert end [read $in]1547 $txt insert end [read $in] 1546 1548 close $in 1547 1549 bind all {destroy .disagl} 1548 bind .disagl " .disagl.txt yview scroll -1 page"1549 bind .disagl " .disagl.txt yview scroll 1 page"1550 bind .disagl " .disagl.txt xview scroll 1 unit"1551 bind .disagl " .disagl.txt xview scroll -1 unit"1552 bind .disagl " .disagl.txt yview scroll -1 unit"1553 bind .disagl " .disagl.txt yview scroll 1 unit"1554 bind .disagl " .disagl.txt yview 0"1555 bind .disagl " .disagl.txt yview end"1550 bind .disagl "$txt yview scroll -1 page" 1551 bind .disagl "$txt yview scroll 1 page" 1552 bind .disagl "$txt xview scroll 1 unit" 1553 bind .disagl "$txt xview scroll -1 unit" 1554 bind .disagl "$txt yview scroll -1 unit" 1555 bind .disagl "$txt yview scroll 1 unit" 1556 bind .disagl "$txt yview 0" 1557 bind .disagl "$txt yview end" 1556 1558 # don't disable in Win as this prevents the highlighting of selected text 1557 1559 if {$tcl_platform(platform) != "windows"} { 1558 .disagl.txt config -state disabled1560 $txt config -state disabled 1559 1561 } 1562 # find the beginning of the disagl text 1563 1564 set pos 1.0 1565 set nph 0 1566 while {[set loc [$txt search "Program DISAGL Version" $pos end]] != ""} { 1567 set pos [expr {$loc + 1}] 1568 incr nph 1569 } 1570 #puts "Found $nph DISAGL run(s)" 1571 # count phases 1572 set l {} 1573 while {[set loc [$txt search "Lattice constants are" $pos end]] != ""} { 1574 lappend l $loc 1575 set pos [expr {$loc + 1}] 1576 } 1577 catch {unset phaseloc} 1578 1579 set j 0 1580 foreach pos $l { 1581 if {$j == 0} { 1582 set prev $pos 1583 incr j 1584 continue 1585 } 1586 set phaseloc($j) [list $prev $pos] 1587 incr j 1588 } 1589 set phaseloc($j) [list $pos end] 1590 if {$nph >= 1 && $j >= 2} { 1591 grid [menubutton .disagl.f.copy \ 1592 -menu .disagl.f.copy.menu \ 1593 -text "Copy phase..." -bd 2 -relief raised] \ 1594 -column 2 -row 0 -sticky nse 1595 menu .disagl.f.copy.menu 1596 for {set i 1} {$i <= $j} {incr i} { 1597 .disagl.f.copy.menu add command \ 1598 -command "seldisaglphase $txt [list $phaseloc($i)]" \ 1599 -label "Copy phase $i to clipboard" 1600 } 1601 } elseif {$nph >= 1} { 1602 grid [button .disagl.f.copy \ 1603 -command "seldisaglphase $txt [list $phaseloc($j)]" \ 1604 -text "Copy phase $j to clipboard"] \ 1605 -column 2 -row 0 -sticky e 1606 } 1560 1607 } else { 1561 1608 runGSASwEXP disagl … … 1563 1610 } 1564 1611 1612 proc seldisaglphase {txt phaselist} { 1613 # clear selection 1614 $txt tag remove sel 1.1 end 1615 eval $txt tag add sel $phaselist 1616 clipboard clear 1617 clipboard append " | Program DISAGL Version MacOSX |\n" 1618 clipboard append [eval $txt get [$txt tag ranges sel]] 1619 } 1565 1620 #------------------------------------------------------------------------------ 1566 1621 # file conversions
Note: See TracChangeset
for help on using the changeset viewer.