Changeset 95 for trunk/gui/scripts


Ignore:
Timestamp:
Oct 9, 2005 9:41:29 PM (19 years ago)
Author:
mmc
Message:
  • Fixed an annoying bug in the scroller that would cause the device to jitter up and down in some cases. (1-barrier case of app-rtd)
  • Fixed cloud/mesh objects to allow different units for each of the various axes.
  • Fixed the install.tcl script to avoid popping up the notice about Rappture being installed when tclsh is running the script.
Location:
trunk/gui/scripts
Files:
4 edited

Legend:

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

    r69 r95  
    157157    pack $w.info -expand yes -fill both -padx 4 -pady 4
    158158    itk_component add runinfo {
    159         text $w.info.text -width 1 -height 1 -wrap word \
     159        text $w.info.text -width 1 -height 1 -wrap none \
    160160            -borderwidth 0 -highlightthickness 0 \
    161161            -state disabled
  • trunk/gui/scripts/cloud.tcl

    r17 r95  
    3232    private variable _cloud ""   ;# lib obj representing this cloud
    3333
    34     private variable _units "m"  ;# system of units for this cloud
    35     private variable _limits     ;# limits xmin, xmax, ymin, ymax, ...
     34    private variable _units "m m m" ;# system of units for x, y, z
     35    private variable _limits        ;# limits xmin, xmax, ymin, ymax, ...
    3636
    3737    private common _xp2obj       ;# used for fetch/release ref counting
     
    9898    set u [$_cloud get units]
    9999    if {"" != $u} {
     100        while {[llength $u] < 3} {
     101            lappend u [lindex $u end]
     102        }
    100103        set _units $u
    101104    }
     
    120123        # extract each point and add it to the points list
    121124        foreach {x y z} $line break
    122         foreach dim {x y z} {
     125        foreach dim {x y z} units $_units {
    123126            set v [Rappture::Units::convert [set $dim] \
    124                 -context $_units -to $_units -units off]
     127                -context $units -to $units -units off]
    125128
    126129            set $dim $v  ;# save back to real x/y/z variable
  • trunk/gui/scripts/mesh.tcl

    r17 r95  
    3535    private variable _mesh ""    ;# lib obj representing this mesh
    3636
    37     private variable _units "m"  ;# system of units for this mesh
    38     private variable _limits     ;# limits xmin, xmax, ymin, ymax, ...
     37    private variable _units "m m m" ;# system of units for x, y, z
     38    private variable _limits        ;# limits xmin, xmax, ymin, ymax, ...
    3939
    4040    private common _xp2obj       ;# used for fetch/release ref counting
     
    101101    set u [$_mesh get units]
    102102    if {"" != $u} {
     103        while {[llength $u] < 3} {
     104            lappend u [lindex $u end]
     105        }
    103106        set _units $u
    104107    }
     
    126129        # extract each point and add it to the points list
    127130        foreach {x y z} $xyz break
    128         foreach dim {x y z} {
     131        foreach dim {x y z} units $_units {
    129132            set v [Rappture::Units::convert [set $dim] \
    130                 -context $_units -to $_units -units off]
     133                -context $units -to $units -units off]
    131134
    132135            set $dim $v  ;# save back to real x/y/z variable
  • trunk/gui/scripts/scroller.tcl

    r44 r95  
    3535    protected method _fixframe {which}
    3636    protected method _fixsize {}
    37     protected method _lock {option}
     37    protected method _lock {option which}
    3838
    3939    private variable _dispatcher "" ;# dispatcher for !events
    4040    private variable _contents ""   ;# widget being controlled
    4141    private variable _frame ""      ;# for "contents frame" calls
    42     private variable _lock 0        ;# for _lock on x-scrollbar
     42    private variable _lock          ;# for _lock on x/y scrollbar
    4343}
    4444                                                                               
     
    5454# ----------------------------------------------------------------------
    5555itcl::body Rappture::Scroller::constructor {args} {
     56    array set _lock { x 0 y 0 }
     57
    5658    Rappture::dispatcher _dispatcher
    5759
     
    196198        x {
    197199            if {$state} {
    198                 grid $itk_component(xsbar) -row 1 -column 0 -sticky ew
    199                 _lock set
     200                if {![_lock active x]} {
     201                    grid $itk_component(xsbar) -row 1 -column 0 -sticky ew
     202                }
    200203            } else {
    201                 if {![_lock active]} {
    202                     grid forget $itk_component(xsbar)
    203                 }
     204                grid forget $itk_component(xsbar)
     205                _lock set x
    204206            }
    205207        }
    206208        y {
    207209            if {$state} {
    208                 grid $itk_component(ysbar) -row 0 -column 1 -sticky ns
     210                if {![_lock active y]} {
     211                    grid $itk_component(ysbar) -row 0 -column 1 -sticky ns
     212                }
    209213            } else {
    210214                grid forget $itk_component(ysbar)
     215                _lock set y
    211216            }
    212217        }
     
    263268
    264269# ----------------------------------------------------------------------
    265 # USAGE: _lock set
    266 # USAGE: _lock reset
    267 # USAGE: _lock active
     270# USAGE: _lock set <which>
     271# USAGE: _lock reset <which>
     272# USAGE: _lock active <which>
    268273#
    269274# Used internally to lock out vibrations when the x-scrollbar pops
     
    275280# up.
    276281# ----------------------------------------------------------------------
    277 itcl::body Rappture::Scroller::_lock {option} {
     282itcl::body Rappture::Scroller::_lock {option which} {
    278283    switch -- $option {
    279284        set {
    280             set _lock 1
    281             after cancel [itcl::code $this _lock reset]
    282             after 50 [itcl::code $this _lock reset]
     285            set _lock($which) 1
     286            after cancel [itcl::code $this _lock reset $which]
     287            after 50 [itcl::code $this _lock reset $which]
    283288        }
    284289        reset {
    285             set _lock 0
     290            set _lock($which) 0
    286291        }
    287292        active {
    288             return $_lock
     293            return $_lock($which)
    289294        }
    290295        default {
Note: See TracChangeset for help on using the changeset viewer.