Changeset 2295
- Timestamp:
- 03/17/99 10:07:26 (14 years ago)
- Files:
-
- 1 modified
-
rat/trunk/ui_audiotool.tcl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rat/trunk/ui_audiotool.tcl
r2293 r2295 21 21 } 22 22 23 set statsfont {helvetica 10}24 set titlefont {helvetica 10}25 set infofont {helvetica 10}26 set smallfont {helvetica 8}27 set verysmallfont {helvetica 8}23 set statsfont [font actual {helvetica 10}] 24 set titlefont [font actual {helvetica 10}] 25 set infofont [font actual {helvetica 10}] 26 set smallfont [font actual {helvetica 8}] 27 set verysmallfont [font actual {helvetica 8}] 28 28 29 29 option add *Entry.relief sunken … … 732 732 set tool_frag [split $tool] 733 733 set tool_name "UCL [lindex $tool_frag 0] [lindex $tool_frag 1]" 734 wm title . ""735 734 } 736 735 } … … 1200 1199 wm title $win "Participant $NAME($cname)" 1201 1200 wm resizable $win 1 0 1202 constrain_window $win 0 250 21 01201 constrain_window $win $statsfont 30 28 1203 1202 } 1204 1203 } … … 1374 1373 } 1375 1374 1376 proc constrain_window {win maxstr xpad ylines ypad} { 1377 set fn [.prefs.buttons.apply cget -font] 1378 set w [expr [font measure $fn $maxstr] + $xpad] 1379 set h [expr $ylines * [font metrics $fn -linespace] + $ypad] 1380 wm geometry $win [format "%sx%s" $w $h] 1381 } 1375 proc averageCharacterWidth {font} { 1376 set sample "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 1377 set slen [string length $sample] 1378 set wpc [expr [font measure $font $sample] / $slen + 1] 1379 return $wpc 1380 } 1381 1382 # constrain_window - window, font, characters wide, characters high 1383 proc constrain_window {w font cW cH} { 1384 1385 catch { 1386 set wpc [averageCharacterWidth $font] 1387 set hpc [font metrics $font -ascent] 1388 1389 # Calculate dimensions 1390 set width [expr $cW * $wpc] 1391 set height [expr $cH * $hpc] 1392 wm geometry $w [format "%sx%s" $width $height] 1393 set dummy "" 1394 } err 1395 if {$err != ""} { 1396 puts "Error: $err" 1397 } 1398 } 1382 1399 1383 1400 proc tk_optionCmdMenu {w varName firstValue args} { … … 1437 1454 1438 1455 # setup width of prefs panel 1439 constrain_window .prefs "XXXXXXXX48-kHzXXXStereoXXXLinear-16XXXUnitsXPerXPcktXXXXXXX" 0 12 1281456 constrain_window .prefs $infofont 56 28 1440 1457 1441 1458 # Personal Info Pane … … 1633 1650 pack $i.of.l -side top -fill x 1634 1651 1635 frame $i.of.codecs 1636 1637 pack $i.of.codecs -side left -padx 2 1652 frame $i.of.codecs 1653 1654 pack $i.of.codecs -side left -padx 2 -fill y 1638 1655 label $i.of.codecs.l -text "Codec" -relief raised 1639 1656 listbox $i.of.codecs.lb -width 20 -yscrollcommand "$i.of.codecs.scroll set" … … 1646 1663 1647 1664 frame $i.of.details.upper 1648 pack $i.of.details.upper -fill x -pady 21665 pack $i.of.details.upper -fill x 1649 1666 1650 1667 frame $i.of.details.desc … … 1687 1704 } 1688 1705 1689 label $i.of.details.desc.l -text "Description:" -anchor w -wraplength 190 -justify left 1706 set descw [expr [averageCharacterWidth $infofont] * 30] 1707 label $i.of.details.desc.l -text "Description:" -anchor w -wraplength $descw -justify left 1690 1708 pack $i.of.details.desc.l -side left -fill x 1709 unset descw 1691 1710 1692 1711 bind $i.of.codecs.lb <1> { … … 1862 1881 set about_pane Copyright 1863 1882 set_pane about_pane .about.rim.d "Credits" 1864 constrain_window .about "XANDXFITNESSXFORXAXPARTICULARXPURPOSEXAREXDISCLAIMED.XINXNOXEVENTX" 0 21 281883 constrain_window .about $infofont 70 25 1865 1884 1866 1885 .about.rim.d.copyright.f.f.blurb insert end {
