Ignore:
Timestamp:
Jun 27, 2009 1:34:06 PM (15 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/nanovisviewer.tcl

    r1531 r1535  
    102102    private method ParseLevelsOption { tf levels }
    103103    private method ParseMarkersOption { tf markers }
     104    private method volume { tag name }
     105    private method GetVolumeInfo { w }
    104106
    105107    private variable _outbuf       ;# buffer for outgoing commands
     
    17301732        4,0 $inner.legend  -columnspan 2 -anchor w
    17311733
     1734    bind $inner <Map> [itcl::code $this GetFlowInfo $inner]
     1735
    17321736    blt::table configure $inner r* -resize none
    17331737    blt::table configure $inner r5 -resize expand
     
    20292033    }
    20302034}
     2035
     2036itcl::body Rappture::NanovisViewer::GetVolumeInfo { w } {
     2037    set flowobj ""
     2038    foreach key [array names _obj2flow] {
     2039        set flowobj $_obj2flow($key)
     2040        break
     2041    }
     2042    if { $flowobj == "" } {
     2043        return
     2044    }
     2045    if { [winfo exists $w.frame] } {
     2046        destroy $w.frame
     2047    }
     2048    set inner [frame $w.frame]
     2049    blt::table $w \
     2050        5,0 $inner -fill both -columnspan 2 -anchor nw
     2051    array set hints [$dataobj hints]
     2052
     2053    label $inner.volumes -text "Volumes" -font "Arial 9 bold"
     2054    blt::table $inner \
     2055        1,0 $inner.volumes  -anchor w \
     2056    blt::table configure $inner c0 c1 -resize none
     2057    blt::table configure $inner c2 -resize expand
     2058
     2059    set row 3
     2060    set volumes [get]
     2061    if { [llength $volumes] > 0 } {
     2062        blt::table $inner $row,0 $inner.volumes  -anchor w
     2063        incr row
     2064    }
     2065    foreach vol $volumes {
     2066        array unset info
     2067        array set info $vol
     2068        set name $info(name)
     2069        if { ![info exists _settings($this-volume-$name)] } {
     2070            set _settings($this-volume-$name) $info(hide)
     2071        }
     2072        checkbutton $inner.vol$row -text $info(label) \
     2073            -variable [itcl::scope _settings($this-volume-$name)] \
     2074            -onvalue 0 -offvalue 1 \
     2075            -command [itcl::code $this volume $key $name] \
     2076            -font "Arial 9"
     2077        Rappture::Tooltip::for $inner.vol$row $info(description)
     2078        blt::table $inner $row,0 $inner.vol$row -anchor w
     2079        if { !$_settings($this-volume-$name) } {
     2080            $inner.vol$row select
     2081        }
     2082        incr row
     2083    }
     2084    blt::table configure $inner r* -resize none
     2085    blt::table configure $inner r$row -resize expand
     2086    blt::table configure $inner c3 -resize expand
     2087    event generate [winfo parent [winfo parent $w]] <Configure>
     2088}
     2089
     2090itcl::body Rappture::NanovisViewer::volume { tag name } {
     2091    set bool $_settings($this-volume-$name)
     2092    SendCmd "volume statue $bool $name"
     2093}
     2094
Note: See TracChangeset for help on using the changeset viewer.