Changeset 5659 for trunk/gui


Ignore:
Timestamp:
Jun 5, 2015 10:05:30 AM (9 years ago)
Author:
ldelgass
Message:

whitespace

Location:
trunk/gui/scripts
Files:
110 edited

Legend:

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

    r5044 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: analyzer - output area for Rappture
     
    5050    itk_option define -notebookpage notebookPage NotebookPage ""
    5151
    52     constructor {tool args} { 
    53         # defined below 
    54     }
    55     destructor { 
    56         # defined below 
     52    constructor {tool args} {
     53        # defined below
     54    }
     55    destructor {
     56        # defined below
    5757    }
    5858
     
    405405        }
    406406        set args ""
    407     } 
     407    }
    408408
    409409    # simulation is needed -- go to simulation page
     
    447447    if {$status != 0} {
    448448        $itk_component(runinfo) configure -state normal
    449         # Don't erase program error messages. 
     449        # Don't erase program error messages.
    450450        # $itk_component(runinfo) delete 1.0 end
    451451        $itk_component(runinfo) insert end "\n\nProblem launching job:\n\n" text
     
    589589                    $popup activate $widget below
    590590                } else {
    591                     download now $widget 
     591                    download now $widget
    592592                }
    593593            } else {
     
    12861286            set frame ${sequence}.element($frameNum)
    12871287            $xmlobj put ${frame}.index $frameNum
    1288            
     1288
    12891289            set molecule ${frame}.structure.components.molecule
    12901290            $xmlobj put ${molecule}.pdb $contents
     
    13291329                set frame ${sequence}.element($frameNum)
    13301330                $xmlobj put ${frame}.index $frameNum
    1331                
     1331
    13321332                set molecule ${frame}.structure.components.molecule
    13331333                $xmlobj put ${molecule}.lammps $frameContents
    13341334                $xmlobj put ${molecule}.lammpstypemap $typemap
    1335                
     1335
    13361336                incr frameNum
    13371337                set frameContents ""
     
    13491349        set frame ${sequence}.element($frameNum)
    13501350        $xmlobj put ${frame}.index $frameNum
    1351        
     1351
    13521352        set molecule ${frame}.structure.components.molecule
    13531353        $xmlobj put ${molecule}.lammps $frameContents
     
    13591359# USAGE: _trajToSequence <xmlobj> ?<path>?
    13601360#
    1361 #       Check for PDB and LAMMPS trajectories in molecule data and rewrite 
    1362 #       the individual models as a sequence of molecules.  Used internally 
     1361#       Check for PDB and LAMMPS trajectories in molecule data and rewrite
     1362#       the individual models as a sequence of molecules.  Used internally
    13631363#       to detect any molecule output elements that contain trajectory data.
    13641364#       Trajectories will be converted into sequences of individual molecules.
    13651365#       All other elements will be unaffected. Scans the entire xml tree if a
    1366 #       starting path is not specified. 
     1366#       starting path is not specified.
    13671367#
    13681368# ----------------------------------------------------------------------
  • trunk/gui/scripts/animicon.tcl

    r3996 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: animicon - an animated icon
  • trunk/gui/scripts/animover.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: animover - animated move
     
    3232
    3333    constructor {args} { # defined below }
    34                                                                                
     34
    3535    protected method _redraw {}
    3636    protected variable _x0 0   ;# min value for middle image
     
    5151        [file join $dir images bgr.gif]]
    5252}
    53                                                                                
     53
    5454itk::usual Animover {
    5555}
  • trunk/gui/scripts/barchartresult.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: barchartresult - X/Y plot in a ResultSet
     
    8281    itk_option define -autocolors autoColors AutoColors ""
    8382
    84     constructor {args} { 
    85         # defined below 
    86     }
    87     destructor { 
    88         # defined below 
     83    constructor {args} {
     84        # defined below
     85    }
     86    destructor {
     87        # defined below
    8988    }
    9089    public method add {dataobj {settings ""}}
     
    9291    public method delete {args}
    9392    public method scale {args}
    94     public method parameters {title args} { 
    95         # do nothing 
     93    public method parameters {title args} {
     94        # do nothing
    9695    }
    9796    public method download {option args}
     
    103102    protected method _axis {option args}
    104103    protected method _getAxes {dataobj}
    105     protected method _getLineMarkerOptions { style } 
    106     protected method _getTextMarkerOptions { style } 
     104    protected method _getLineMarkerOptions { style }
     105    protected method _getTextMarkerOptions { style }
    107106    protected method _enterMarker { g name x y text }
    108107    protected method _leaveMarker { g name }
    109     private method _formatTickLabel { w value } 
     108    private method _formatTickLabel { w value }
    110109    private method ResetLegend {}
    111110
     
    129128    private variable _tickLabels
    130129}
    131                                                                                
     130
    132131itk::usual BarchartResult {
    133132    keep -background -foreground -cursor -font
     
    558557                        # Create the print dialog widget and add it to the
    559558                        # the balloon popup.
    560                         Rappture::XyPrint $inner.print 
     559                        Rappture::XyPrint $inner.print
    561560                        $popup configure \
    562                             -deactivatecommand [list $inner.print reset] 
     561                            -deactivatecommand [list $inner.print reset]
    563562                        blt::table $inner 0,0 $inner.print -fill both
    564563                    }
     
    570569                    set output [$inner.print print $itk_component(plot) \
    571570                                    $toolName $plotName]
    572                     $popup deactivate 
     571                    $popup deactivate
    573572                    return $output
    574573                }
     
    595594    eval $g marker delete [$g marker names]
    596595    foreach axis [$g axis names] {
    597         $g axis configure $axis -hide yes -checklimits no 
     596        $g axis configure $axis -hide yes -checklimits no
    598597    }
    599598    # Presumably you want at least an X-axis and Y-axis displayed.
     
    718717                $g axis configure $mapx \
    719718                    -command [itcl::code $this _formatTickLabel] \
    720                     -minorticks 0 
     719                    -minorticks 0
    721720                set _tickLabels $labels
    722721            }
     
    739738            $g element configure $elem -label $elabel
    740739        }
    741     }       
     740    }
    742741
    743742    foreach dataobj $_dlist {
     
    746745        set xmax Inf
    747746        set ymax Inf
    748         # 
    749         # Create text/line markers for each *axis.marker specified. 
    750         # 
     747        #
     748        # Create text/line markers for each *axis.marker specified.
     749        #
    751750        foreach m [$dataobj xmarkers] {
    752751            foreach {at label style} $m break
     
    897896    set g $itk_component(plot)
    898897    set elem ""
    899    
     898
    900899    # Peek inside of Blt_ZoomStack package to see if we're currently in the
    901900    # middle of a zoom selection.
     
    905904    set tip ""
    906905    if {$state == "at"} {
    907         set state 0
     906        set state 0
    908907        if {[$g element closest $x $y info -interpolate yes]} {
    909908            # for dealing with xy line plots
    910909            set elem $info(name)
    911            
     910
    912911            # Some elements are generated dynamically and therefore will
    913912            # not have a dataobj associated with them.
     
    917916                foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    918917            }
    919            
     918
    920919            # search again for an exact point -- this time don't interpolate
    921920            set tip ""
    922921            array unset info
    923922            if {[$g element closest $x $y info -interpolate no]
    924                 && $info(name) == $elem} {
    925                
     923                && $info(name) == $elem} {
     924
    926925                set x [$g axis transform $mapx $info(x)]
    927926                set y [$g axis transform $mapy $info(y)]
    928                
     927
    929928                if {[info exists _elem2dataobj($elem)]} {
    930929                    set dataobj $_elem2dataobj($elem)
     
    946945            # for dealing with xy scatter plot
    947946            set elem $info(name)
    948            
     947
    949948            # Some elements are generated dynamically and therefore will
    950949            # not have a dataobj associated with them.
     
    954953                foreach {mapx mapy} [_getAxes $_elem2dataobj($elem)] break
    955954            }
    956            
     955
    957956            set tip ""
    958957            set x [$g axis transform $mapx $info(x)]
    959958            set y [$g axis transform $mapy $info(y)]
    960            
    961             if {[info exists _elem2dataobj($elem)]} {
    962                 set dataobj $_elem2dataobj($elem)
    963                 set yunits [$dataobj hints yunits]
    964                 set xunits [$dataobj hints xunits]
    965             } else {
    966                 set xunits ""
    967                 set yunits ""
    968             }
    969             set tip [$g element cget $elem -label]
    970             set yval [_axis format y dummy $info(y)]
    971             append tip "\n$yval$yunits"
    972             set xval [_axis format x dummy $info(x)]
    973             append tip " @ $xval$xunits"
    974             set tip [string trim $tip]
    975             set state 1
    976         }
     959
     960            if {[info exists _elem2dataobj($elem)]} {
     961                set dataobj $_elem2dataobj($elem)
     962                set yunits [$dataobj hints yunits]
     963                set xunits [$dataobj hints xunits]
     964            } else {
     965                set xunits ""
     966                set yunits ""
     967            }
     968            set tip [$g element cget $elem -label]
     969            set yval [_axis format y dummy $info(y)]
     970            append tip "\n$yval$yunits"
     971            set xval [_axis format x dummy $info(x)]
     972            append tip " @ $xval$xunits"
     973            set tip [string trim $tip]
     974            set state 1
     975        }
    977976    } else {
    978         set state 0
     977        set state 0
    979978    }
    980979
     
    10841083            }
    10851084        }
    1086        
     1085
    10871086        set ally [$g y2axis use]
    10881087        if {[llength $ally] > 0} {
     
    15991598
    16001599itcl::body Rappture::BarchartResult::_leaveMarker { g name } {
    1601     if { [info exists _markers($name)] } { 
     1600    if { [info exists _markers($name)] } {
    16021601        set id $_markers($name)
    16031602        $g marker delete $id
     
    16111610    set index [expr round($value)]
    16121611    if { $index != $value } {
    1613         return $value 
     1612        return $value
    16141613    }
    16151614    return [lindex  $_tickLabels [expr $index - 1]]
  • trunk/gui/scripts/booleanentry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: BooleanEntry - widget for entering boolean values
     
    7171        pack $itk_component(icon) -fill x -side left
    7272    }
    73    
     73
    7474    #
    7575    # Create the widget and configure it properly based on other
  • trunk/gui/scripts/bugreport.tcl

    r5196 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  UTILITY: bugreport
     
    9696        if { $mw == 1 } {
    9797            set mw [winfo reqwidth .main]
    98         }           
     98        }
    9999        set mh [winfo height .main]
    100100        if { $mh == 1 } {
    101101            set mh [winfo reqwidth .main]
    102         }           
     102        }
    103103        if { $mw > $w } {
    104104            set x [expr { $x + (($mw-$w)/2) }]
     
    167167    if { $mw == 1 } {
    168168        set mw [winfo reqwidth .main]
    169     }           
     169    }
    170170    set mh [winfo height .main]
    171171    if { $mh == 1 } {
    172172        set mh [winfo reqwidth .main]
    173     }           
     173    }
    174174
    175175    if { $mw > $w } {
  • trunk/gui/scripts/choiceentry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: ChoiceEntry - widget for entering a choice of strings
  • trunk/gui/scripts/color.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  UTILITY: color
     
    7979proc Rappture::color::RGBtoHSV {color} {
    8080    #
    81     # If the colors are exhausted sometimes winfo can fail with a 
     81    # If the colors are exhausted sometimes winfo can fail with a
    8282    # division by zero.  Catch it to avoid problems.
    8383    #
    84     if { [catch {winfo rgb . $color} status] != 0 } { 
     84    if { [catch {winfo rgb . $color} status] != 0 } {
    8585        set s 0
    8686        set v 0
     
    105105        return [list $h $s $v]
    106106    }
    107   
     107 
    108108    if {$max > 0} {
    109109        set s [expr {$delta/double($max)}]
     
    216216}
    217217
    218 # Returns a list containing three decimal values in the range 0 to 65535, 
    219 # which are the red, green, and blue intensities that correspond to color 
    220 # in the window given by window. Color may be specified in any of the forms 
    221 # acceptable for a color option. 
     218# Returns a list containing three decimal values in the range 0 to 65535,
     219# which are the red, green, and blue intensities that correspond to color
     220# in the window given by window. Color may be specified in any of the forms
     221# acceptable for a color option.
    222222proc Rappture::color::RGB {color} {
    223223    if {[string match "*nm" $color]} {
  • trunk/gui/scripts/combobox.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: combobox - entry widget with a drop-down list of values
     
    6059    private variable _label2value
    6160}
    62                                                                                
     61
    6362itk::usual Combobox {
    6463    keep -cursor -font
  • trunk/gui/scripts/combochecks.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: combochecks - like a combobox, but items with checkboxes
     
    5252    private variable _label2value
    5353}
    54                                                                                
     54
    5555itk::usual Combochecks {
    5656    keep -cursor -font
  • trunk/gui/scripts/controlOwner.tcl

    r3636 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: owner - manages Rappture controls
     
    296296        set type [[tool] xml element -as type $path]
    297297        if {[info exists _type2curpath($type)]} {
    298             if { $_type2curpath($type) == "all" } {
    299                 set currentpath $path
    300             } else {
    301                 set currentpath $path.$_type2curpath($type)
    302             }
     298            if { $_type2curpath($type) == "all" } {
     299                set currentpath $path
     300            } else {
     301                set currentpath $path.$_type2curpath($type)
     302            }
    303303        } else {
    304304            # default incase i forgot an input type in _type2curpath
  • trunk/gui/scripts/controls.tcl

    r4042 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: controls - a container for various Rappture controls
     
    5454    private variable _sentenceparts  ;# info for layout scheme "sentence:"
    5555}
    56                                                                                
     56
    5757itk::usual Controls {
    5858}
     
    180180        control {
    181181            set label [string trim [$_owner xml get $path.label]]
    182             if {"" == $label} { 
    183                 set label "Simulate" 
     182            if {"" == $label} {
     183                set label "Simulate"
    184184            }
    185185            set service [string trim [$_owner xml get $path.service]]
     
    207207    set disablestyle [string trim [$_owner xml get $path.about.disablestyle]]
    208208    if { $disablestyle != "" } {
    209         set _name2info($name-disablestyle) $disablestyle
     209        set _name2info($name-disablestyle) $disablestyle
    210210    }
    211211    #
     
    340340        }
    341341        $_owner widgetfor $_name2info($name-path) ""
    342         array unset _name2info $name-*
     342        array unset _name2info $name-*
    343343    }
    344344    set _controls [lreplace $_controls $first $last]
     
    436436    }
    437437    grid rowconfigure $_frame 99 -weight 0
    438    
     438
    439439    for {set c 0} {$c < $cmax} {incr c} {
    440440        grid columnconfigure $_frame $c -weight 0 -minsize 0
    441441    }
    442    
     442
    443443    foreach name $_controls {
    444444        foreach elem {label value} {
     
    450450    }
    451451    grid forget $_frame.empty
    452    
     452
    453453    if {[$_tabs size] > 0} {
    454454        $_tabs delete 0 end
    455455    }
    456    
     456
    457457    #
    458458    # Decide which widgets should be shown and which should be hidden.
     
    465465        if {[string is boolean $cond] && !$cond} {
    466466            # hard-coded "off" -- ignore completely
    467            
     467
    468468            # When the "enable" of a control is hardcoded "off", "0", etc., it
    469469            # means to hide the control. This is used by bandstrlab to add
    470470            # invisible parameters to a structure.  The value of the parameter
    471471            # is used by other widgets with enable statements.
    472            
    473             # The proper method for doing this is to add a 
    474             #   <disablestyle>hide<disablestyle> 
    475             # tag to the about section of the control. 
    476            
     472
     473            # The proper method for doing this is to add a
     474            #   <disablestyle>hide<disablestyle>
     475            # tag to the about section of the control.
     476
    477477        } elseif {[catch {expr $cond} show] == 0} {
    478478            set type $_name2info($name-type)
     
    480480            set lwidget $_name2info($name-label)
    481481            set vwidget $_name2info($name-value)
    482             if {[lsearch -exact {group image structure} $type] >= 0 || 
     482            if {[lsearch -exact {group image structure} $type] >= 0 ||
    483483                $disablestyle == "hide" } {
    484484                if {$show ne "" && $show} {
     
    507507        }
    508508    }
    509    
     509
    510510    # store the showing tabs in the object so it can be used in _changeTabs
    511511    set _showing $showing
    512    
     512
    513513    #
    514514    # Decide on a layout scheme:
     
    535535        }
    536536    }
    537    
     537
    538538    # if the layout is "sentence:..." then create new parts
    539539    if {[string match {sentence:*} $itk_option(-layout)]
     
    545545            foreach {s0 s1} $name break
    546546            set name [string range $str $s0 $s1]
    547            
     547
    548548            # create a label for the string before the substitution
    549549            foreach {s0 s1} $match break
     
    555555                lappend _sentenceparts(fragments) $lname
    556556            }
    557            
     557
    558558            # add the widget for the substitution part
    559559            set found ""
     
    569569                puts stderr "WARNING: name \"$name\" in sentence layout \"$itk_option(-layout)\" not recognized"
    570570            }
    571            
     571
    572572            set str [string range $str [expr {$s1+1}] end]
    573573        }
    574        
     574
    575575        # create a label for any trailing string
    576576        set str [string trim $str]
     
    582582        }
    583583    }
    584    
     584
    585585    switch -glob -- $_scheme {
    586586        tabs {
     
    589589            # put a series of groups into a tabbed notebook
    590590            #
    591            
     591
    592592            # stop covering up the tabset and put the _frame inside the tabs
    593593            pack forget $_frame
    594594            $_tabs configure -width 0 -height 0
    595            
     595
    596596            set gn 1
    597597            foreach name $showing {
     
    608608                incr gn
    609609            }
    610            
     610
    611611            # compute the overall size
    612612            # BE CAREFUL: do this after setting "-heading no" above
    613613            $_dispatcher event -now !resize
    614            
     614
    615615            grid columnconfigure $_frame 0 -weight 1
    616616            grid rowconfigure $_frame 0 -weight 1
    617            
     617
    618618            $_tabs select 0; _changeTabs
    619619        }
    620        
     620
    621621        vertical {
    622622            #
     
    630630            $_tabs configure -width [winfo reqwidth $_frame] \
    631631                -height [winfo reqheight $_frame]
    632            
     632
    633633            set expand 0  ;# most controls float to top
    634634            set row 0
     
    638638                    grid $wl -row $row -column 0 -sticky e
    639639                }
    640                
     640
    641641                set wv $_name2info($name-value)
    642642                if {$wv ne "" && [winfo exists $wv]} {
     
    646646                        grid $wv -row $row -column 0 -columnspan 2 -sticky ew
    647647                    }
    648                    
     648
    649649                    grid rowconfigure $_frame $row -weight 0
    650                    
     650
    651651                    switch -- [winfo class $wv] {
    652652                        TextEntry {
     
    661661                        GroupEntry {
    662662                            $wv configure -heading yes
    663                            
     663
    664664                            #
    665665                            # Scan through all children in this group
     
    695695                    grid columnconfigure $_frame 1 -weight 1
    696696                }
    697                
     697
    698698                incr row
    699699                grid rowconfigure $_frame $row -minsize $itk_option(-padding)
     
    701701            }
    702702            grid $_frame.empty -row $row
    703            
     703
    704704            #
    705705            # If there are any hidden items, then make the bottom of
     
    714714            }
    715715        }
    716        
     716
    717717        horizontal {
    718718            #
     
    726726            $_tabs configure -width [winfo reqwidth $_frame] \
    727727                -height [winfo reqheight $_frame]
    728            
     728
    729729            set col 0
    730730            set pad [expr {$itk_option(-padding)/2}]
     
    735735                    incr col
    736736                }
    737                
     737
    738738                set wv $_name2info($name-value)
    739739                if {$wv != "" && [winfo exists $wv]} {
     
    744744            }
    745745        }
    746        
     746
    747747        sentence:* {
    748748            #
     
    756756            $_tabs configure -width [winfo reqwidth $_frame] \
    757757                -height [winfo reqheight $_frame]
    758            
     758
    759759            set col 0
    760760            set pad [expr {$itk_option(-padding)/2}]
  • trunk/gui/scripts/coverflow.tcl

    r4209 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Coverflow - browse through a series of images
  • trunk/gui/scripts/curve.tcl

    r4791 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: curve - extracts data from an XML description of a field
     
    1918package require BLT
    2019
    21 namespace eval Rappture { 
    22     # forward declaration 
     20namespace eval Rappture {
     21    # forward declaration
    2322}
    2423
    2524itcl::class Rappture::Curve {
    26     constructor {xmlobj path} { 
    27         # defined below 
    28     }
    29     destructor { 
    30         # defined below 
     25    constructor {xmlobj path} {
     26        # defined below
     27    }
     28    destructor {
     29        # defined below
    3130    }
    3231
     
    314313            $yv set [$_curve get $cname.yvector]
    315314        }
    316         if { (([$xv length] == 0) && ([$yv length] == 0)) || 
     315        if { (([$xv length] == 0) && ([$yv length] == 0)) ||
    317316             ([$xv length] != [$yv length]) } {
    318317            # FIXME: need to show an error about improper data.
     
    321320            continue;
    322321        }
    323         $xev set [$_curve get "$cname.xerrorbars"] 
    324         $yev set [$_curve get "$cname.yerrorbars"] 
     322        $xev set [$_curve get "$cname.xerrorbars"]
     323        $yev set [$_curve get "$cname.yerrorbars"]
    325324        set _comp2xy($cname) [list $xv $yv $xev $yev]
    326325        incr _counter
  • trunk/gui/scripts/datatable.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2  
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: datatable - extracts data from an XML description of a field
     
    1918package require BLT
    2019
    21 namespace eval Rappture { 
    22     # forward declaration 
     20namespace eval Rappture {
     21    # forward declaration
    2322}
    2423
    2524itcl::class Rappture::DataTable {
    26     constructor {xmlobj path} { 
    27         # defined below 
     25    constructor {xmlobj path} {
     26        # defined below
    2827    }
    29     destructor { 
    30         # defined below 
     28    destructor {
     29        # defined below
    3130    }
    3231
     
    5352    set _xmlobj $xmlobj
    5453    set _datatable [$xmlobj element -as object $path]
    55    
     54
    5655    # build up vectors for various components of the datatable
    5756    Build
     
    6766
    6867# ----------------------------------------------------------------------
    69 # USAGE: values 
     68# USAGE: values
    7069#
    7170# Returns the values for the datatable as a BLT tree.
     
    7675
    7776# ----------------------------------------------------------------------
    78 # USAGE: columns 
     77# USAGE: columns
    7978#
    8079# Returns the columns of the datatable in order.
     
    144143        foreach row $csvlist {
    145144            set child [$_tree insert 0]
    146             set c 0 
     145            set c 0
    147146            foreach value $row {label description style} $_columns {
    148147                if { $label == "" } {
     
    150149                }
    151150                $_tree set $child $label $value
    152                 incr c 
     151                incr c
    153152            }
    154153        }
  • trunk/gui/scripts/datatableresult.tcl

    r3799 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: datatableresult - X/Y plot in a ResultSet
     
    2928
    3029itk::usual TreeView {
    31     keep -foreground -cursor 
     30    keep -foreground -cursor
    3231}
    3332
     
    4140    private variable _tree ""
    4241
    43     constructor {args} { 
    44         # defined below 
    45     }
    46     destructor { 
    47         # defined below 
     42    constructor {args} {
     43        # defined below
     44    }
     45    destructor {
     46        # defined below
    4847    }
    4948    public method add {dataobj {settings ""}}
     
    5554    public method snap { w h }
    5655    public method tooltip { desc x y }
    57     public method parameters {title args} { 
    58         # do nothing 
     56    public method parameters {title args} {
     57        # do nothing
    5958    }
    6059    public method download {option args}
     
    7170    common _downloadPopup          ;# download options from popup
    7271}
    73                                                                                
     72
    7473itk::usual DataTableResult {
    7574    keep -background -foreground -cursor -font
     
    102101        ignore -borderwidth -highlightthickness
    103102    }
    104     $itk_component(treeview) style textbox lowered -background grey95 
     103    $itk_component(treeview) style textbox lowered -background grey95
    105104    $itk_component(treeview) style textbox raised -background white
    106105    $itk_interior.scroller contents $itk_component(treeview)
     
    290289itcl::body Rappture::DataTableResult::Rebuild {} {
    291290    eval $_tree delete [$_tree children 0]
    292    
     291
    293292    foreach dataobj $_dlist {
    294293        scan $dataobj "::dataTable%d" suffix
     
    317316    }
    318317    $itk_component(treeview) column configure treeView -hide yes
    319     set dataobj [lindex $_dlist 0] 
     318    set dataobj [lindex $_dlist 0]
    320319    if { $dataobj != "" } {
    321320        foreach { label description style } [$dataobj columns] {
     
    327326                    { Rappture::Tooltip::tooltip cancel }
    328327            }
    329         }   
     328        }
    330329    }
    331330    if { [llength $_dlist] == 1 } {
     
    334333                $itk_component(treeview) column configure $c -text $label
    335334            }
    336         }   
     335        }
    337336    }
    338337    if { $_raised != "" } {
     
    354353        set w [winfo width $g]
    355354        set h [winfo height $g]
    356     } 
     355    }
    357356    set img [image create picture -width $w -height $h]
    358357    $g snap $img -width $w -height $h
  • trunk/gui/scripts/deviceEditor.tcl

    r5330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: deviceEditor - general-purpose device editor
     
    2525    constructor {owner args} {
    2626        Rappture::ControlOwner::constructor $owner
    27     } { 
    28         # defined below 
     27    } {
     28        # defined below
    2929    }
    3030    public method value {args}
    3131    public method download {option args}
    32     public method add {dataobj {settings ""}} 
     32    public method add {dataobj {settings ""}}
    3333    public method delete {args}
    34     public method parameters {title args} { 
    35         # do nothing 
     34    public method parameters {title args} {
     35        # do nothing
    3636    }
    3737    public method snap {w h}
     
    5252    }
    5353}
    54                                                                                
     54
    5555itk::usual DeviceEditor {
    5656}
  • trunk/gui/scripts/deviceLayout1D.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: deviceLayout1D - visualizer for 1D device geometries
     
    6666    private variable _icons         ;# maps icon data => image handle
    6767}
    68                                                                                
     68
    6969itk::usual DeviceLayout1D {
    7070    keep -background -cursor
     
    209209    foreach m $_maters {
    210210        if {"" != $m} {
    211             set extra [expr {1.5*[font metrics $fnt -linespace]}] 
     211            set extra [expr {1.5*[font metrics $fnt -linespace]}]
    212212            set hmax [expr {$hmax+$extra}]
    213213            break
     
    219219        foreach nn [$_device children components] {
    220220            if {"" != [$_device get components.$nn.about.label]} {
    221                 set extra [expr {1.2*[font metrics $fnt -linespace]}] 
     221                set extra [expr {1.2*[font metrics $fnt -linespace]}]
    222222                set hmax [expr {$hmax+$extra}]
    223223                break
  • trunk/gui/scripts/deviceViewer1D.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: deviceViewer1D - visualizer for 1D device geometries
     
    4141    public method controls {option args}
    4242    public method download {option args}
    43                                                                                
     43
    4444    protected method _loadDevice {}
    4545    protected method _loadParameters {frame path}
     
    6363    private variable _marker        ;# marker currently being edited
    6464}
    65                                                                                
     65
    6666itk::usual DeviceViewer1D {
    6767}
     
    168168    }
    169169    array set params $settings
    170  
     170
    171171    set pos [lsearch -exact $_dlist $dataobj]
    172172
  • trunk/gui/scripts/deviceresult.tcl

    r3799 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: DeviceResult - output for <structure>
     
    3434    private variable _dataobj ""  ;# data object currently being displayed
    3535}
    36                                                                                
     36
    3737itk::usual DeviceResult {
    3838    keep -background -foreground -cursor -font
  • trunk/gui/scripts/diffview.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  WIDGET: diffview - view differences between two strings
  • trunk/gui/scripts/dispatcher.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: dispatcher - central notification mechanism
     
    4646    private variable _extraargs      ;# extra args for dispatch calls
    4747}
    48                                                                                
     48
    4949# ----------------------------------------------------------------------
    5050# CONSTRUCTOR
     
    5353    # nothing to do
    5454}
    55                                                                                
     55
    5656# ----------------------------------------------------------------------
    5757# DESTRUCTOR
  • trunk/gui/scripts/drawingentry.tcl

    r4407 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: DrawingEntry - widget for entering numeric values
     
    5352    private variable _cursor ""
    5453
    55     constructor {owner path args} { 
    56         # defined below
     54    constructor {owner path args} {
     55        # defined below
    5756    }
    5857    destructor {
    59         # defined below
     58        # defined below
    6059    }
    6160    public method value { args }
     
    6362    public method tooltip {}
    6463
    65     private method Activate { tag } 
    66     private method AdjustDrawingArea { xAspect yAspect } 
    67     private method Deactivate { tag } 
    68     private method Highlight { tag } 
    69     private method Invoke { name x y } 
     64    private method Activate { tag }
     65    private method AdjustDrawingArea { xAspect yAspect }
     66    private method Deactivate { tag }
     67    private method Highlight { tag }
     68    private method Invoke { name x y }
    7069    private method ParseBackground {}
    7170    private method ParseDescription {}
     
    8079    private method ParseText { cpath cname }
    8180    private method Redraw {}
    82     private method ScreenCoords { coords } 
    83     private method ScreenX { x } 
    84     private method ScreenY { y } 
     81    private method ScreenCoords { coords }
     82    private method ScreenX { x }
     83    private method ScreenY { y }
    8584    private method UpdateSubstitutions {}
    86     private method XmlGet { path } 
    87     private method XmlGetSubst { path } 
    88     private method Hotspot { option cname item args } 
     85    private method XmlGet { path }
     86    private method XmlGetSubst { path }
     87    private method Hotspot { option cname item args }
    8988}
    9089
     
    115114    #
    116115    itk_component add drawing {
    117         canvas $itk_interior.canvas -background white -relief sunken -bd 1 \
    118             -width 400 -height 300
     116        canvas $itk_interior.canvas -background white -relief sunken -bd 1 \
     117            -width 400 -height 300
    119118    } {
    120         ignore -background
     119        ignore -background
    121120    }
    122121    pack $itk_component(drawing) -expand yes -fill both
     
    127126    set subs [$_xmlobj children -as path -type variable $_path.substitutions]
    128127    foreach cpath $subs {
    129         set map ""
    130         set name ""
    131         set path ""
    132         foreach elem [$_xmlobj children $cpath] {
    133             switch -glob -- $elem {
    134                 "name*" {
    135                     set name [XmlGet $cpath.$elem]
    136                 }
    137                 "path*" {
    138                     set path [XmlGet $cpath.$elem]
    139                 }
    140                 "map*" {
    141                     set from [XmlGet $cpath.$elem.from]
    142                     set to [XmlGet $cpath.$elem.to]
    143                     lappend map $from $to
    144                 }
    145             }
    146         }
    147         if {$name eq ""} {
    148             puts stderr "no name defined for substitution variable \"$cpath\""
    149             continue
    150         }
    151         if {[info exists _name2path($name)]} {
    152             puts stderr "substitution variable \"$name\" already defined"
    153             continue
    154         }
    155         set _name2path($name) $path
    156         if {$path eq ""} {
    157             puts stderr "no path defined for substitution variable \"$cpath\""
    158             continue
    159         }
    160         set _name2map($name) $map
     128        set map ""
     129        set name ""
     130        set path ""
     131        foreach elem [$_xmlobj children $cpath] {
     132            switch -glob -- $elem {
     133                "name*" {
     134                    set name [XmlGet $cpath.$elem]
     135                }
     136                "path*" {
     137                    set path [XmlGet $cpath.$elem]
     138                }
     139                "map*" {
     140                    set from [XmlGet $cpath.$elem.from]
     141                    set to [XmlGet $cpath.$elem.to]
     142                    lappend map $from $to
     143                }
     144            }
     145        }
     146        if {$name eq ""} {
     147            puts stderr "no name defined for substitution variable \"$cpath\""
     148            continue
     149        }
     150        if {[info exists _name2path($name)]} {
     151            puts stderr "substitution variable \"$name\" already defined"
     152            continue
     153        }
     154        set _name2path($name) $path
     155        if {$path eq ""} {
     156            puts stderr "no path defined for substitution variable \"$cpath\""
     157            continue
     158        }
     159        set _name2map($name) $map
    161160
    162161        # keep track of controls built for each variable (see below)
     
    193192    }
    194193    set c $itk_component(drawing)
    195     set texts [$_xmlobj children -type text -as path $_path.components] 
     194    set texts [$_xmlobj children -type text -as path $_path.components]
    196195    foreach cpath $texts {
    197196        set popup ""
     
    205204        set id [$c create hotspot 0 0 -text [XmlGet $cpath.text]]
    206205        foreach varName [Rappture::hotspot variables $c $id] {
    207             if {[info exists _name2path($varName)]} {
    208                 set cntlpath $_name2path($varName)
     206            if {[info exists _name2path($varName)]} {
     207                set cntlpath $_name2path($varName)
    209208
    210209                if {$controls($cntlpath) ne "unused"} {
     
    229228                $inner.controls insert end $cntlpath
    230229                set _cpath2popup($cntlpath) $popup
    231             } else {
    232                 puts stderr "unknown variable \"$varName\" in drawing item at $cpath"
     230            } else {
     231                puts stderr "unknown variable \"$varName\" in drawing item at $cpath"
    233232            }
    234233        }
     
    253252    # tear down the value subsitution parser
    254253    if {$_parser != ""} {
    255         $_parser delete
     254        $_parser delete
    256255    }
    257256}
     
    305304    # Delete any images that we created.
    306305    foreach name [array names _cname2image] {
    307         image delete $_cname2image($name)
     306        image delete $_cname2image($name)
    308307    }
    309308    array unset _cname2id
    310309    array unset _cname2image
    311    
     310
    312311    # Recompute the size of the canvas/drawing area
    313     set _canvasWidth [winfo width $itk_component(drawing)] 
     312    set _canvasWidth [winfo width $itk_component(drawing)]
    314313    if { $_canvasWidth < 2 } {
    315         set _canvasWidth [winfo reqwidth $itk_component(drawing)]
     314        set _canvasWidth [winfo reqwidth $itk_component(drawing)]
    316315    }
    317316    set _canvasHeight [winfo height $itk_component(drawing)]
    318317    if { $_canvasHeight < 2 } {
    319         set _canvasHeight [winfo reqheight $itk_component(drawing)]
     318        set _canvasHeight [winfo reqheight $itk_component(drawing)]
    320319    }
    321320    set _drawingWidth $_canvasWidth
     
    329328
    330329#
    331 # ParseDescription -- 
     330# ParseDescription --
    332331#
    333332itcl::body Rappture::DrawingEntry::ParseDescription {} {
     
    335334    UpdateSubstitutions
    336335    foreach cname [$_xmlobj children $_path.components] {
    337         switch -glob -- $cname {
    338             "line*" {
    339                 ParseLine $_path.components.$cname $cname
    340             }
    341             "grid*" {
    342                 ParseGrid $_path.components.$cname $cname
    343             }
    344             "text*" {
    345                 ParseText $_path.components.$cname $cname
    346             }
    347             "picture*" {
    348                 ParsePicture $_path.components.$cname $cname
    349             }
    350             "rectangle*" {
    351                 ParseRectangle $_path.components.$cname $cname
    352             }
    353             "oval*" {
    354                 ParseOval $_path.components.$cname $cname
    355             }
    356             "polygon*" {
    357                 ParsePolygon $_path.components.$cname $cname
    358             }
    359             "hotspot*" {
    360                 ParseHotspot $_path.components.$cname $cname
    361             }
    362         }
    363     }
    364 }
    365 
    366 #
    367 # ParseGrid -- 
     336        switch -glob -- $cname {
     337            "line*" {
     338                ParseLine $_path.components.$cname $cname
     339            }
     340            "grid*" {
     341                ParseGrid $_path.components.$cname $cname
     342            }
     343            "text*" {
     344                ParseText $_path.components.$cname $cname
     345            }
     346            "picture*" {
     347                ParsePicture $_path.components.$cname $cname
     348            }
     349            "rectangle*" {
     350                ParseRectangle $_path.components.$cname $cname
     351            }
     352            "oval*" {
     353                ParseOval $_path.components.$cname $cname
     354            }
     355            "polygon*" {
     356                ParsePolygon $_path.components.$cname $cname
     357            }
     358            "hotspot*" {
     359                ParseHotspot $_path.components.$cname $cname
     360            }
     361        }
     362    }
     363}
     364
     365#
     366# ParseGrid --
    368367#
    369368itcl::body Rappture::DrawingEntry::ParseGrid { cpath cname } {
    370369    array set attr2option {
    371         "linewidth"     "-width"
    372         "arrow"         "-arrow"
    373         "dash"          "-dash"
    374         "color"         "-fill"
     370        "linewidth"     "-width"
     371        "arrow"         "-arrow"
     372        "dash"          "-dash"
     373        "color"         "-fill"
    375374    }
    376375    # Set default options first and then let tool.xml override them.
    377376    array set options {
    378         -arrow          none
    379         -width          0
    380         -fill           black
    381         -dash           ""
     377        -arrow          none
     378        -width          0
     379        -fill           black
     380        -dash           ""
    382381    }
    383382    # Coords
     
    385384    set ycoords [XmlGetSubst $cpath.ycoords]
    386385    if { $ycoords == "" } {
    387         set ycoords "0 1"
    388         set ymax 1
    389         set ymin 0
     386        set ycoords "0 1"
     387        set ymax 1
     388        set ymin 0
    390389    } else {
    391         set list {}
    392         set ymax -10000
    393         set ymin 10000
    394         foreach c $ycoords {
    395             set y [ScreenY $c]
    396             if { $y > $ymax } {
    397                 set ymax $y
    398             }
    399             if { $y < $ymin } {
    400                 set ymin $y
    401             }
    402             lappend list $y
    403         }
    404         set ycoords $list
     390        set list {}
     391        set ymax -10000
     392        set ymin 10000
     393        foreach c $ycoords {
     394            set y [ScreenY $c]
     395            if { $y > $ymax } {
     396                set ymax $y
     397            }
     398            if { $y < $ymin } {
     399                set ymin $y
     400            }
     401            lappend list $y
     402        }
     403        set ycoords $list
    405404    }
    406405    if { $xcoords == "" } {
    407         set xcoords "0 1"
    408         set xmax 1
    409         set xmin 0
     406        set xcoords "0 1"
     407        set xmax 1
     408        set xmin 0
    410409    } else {
    411         set list {}
    412         set xmax -10000
    413         set xmin 10000
    414         foreach c $xcoords {
    415             set x [ScreenX $c]
    416             if { $x > $xmax } {
    417                 set xmax $x
    418             }
    419             if { $x < $xmin } {
    420                 set xmin $x
    421             }
    422             lappend list $x
    423         }
    424         set xcoords $list
     410        set list {}
     411        set xmax -10000
     412        set xmin 10000
     413        foreach c $xcoords {
     414            set x [ScreenX $c]
     415            if { $x > $xmax } {
     416                set xmax $x
     417            }
     418            if { $x < $xmin } {
     419                set xmin $x
     420            }
     421            lappend list $x
     422        }
     423        set xcoords $list
    425424    }
    426425
    427426    set list {}
    428427    foreach attr [$_xmlobj children $cpath] {
    429         if { [info exists attr2option($attr)] } {
    430             set option $attr2option($attr)
    431             set value [XmlGetSubst $cpath.$attr]
    432             set options($option) $value
    433         }
     428        if { [info exists attr2option($attr)] } {
     429            set option $attr2option($attr)
     430            set value [XmlGetSubst $cpath.$attr]
     431            set options($option) $value
     432        }
    434433    }
    435434    set options(-tags) $cname
    436435    foreach y $ycoords {
    437         lappend ids \
    438             [eval $itk_component(drawing) create line $xmin $y $xmax $y \
    439                 [array get options]]
     436        lappend ids \
     437            [eval $itk_component(drawing) create line $xmin $y $xmax $y \
     438                [array get options]]
    440439    }
    441440    foreach x $xcoords {
    442         lappend ids \
    443             [eval $itk_component(drawing) create line $x $ymin $x $ymax \
    444                 [array get options]]
     441        lappend ids \
     442            [eval $itk_component(drawing) create line $x $ymin $x $ymax \
     443                [array get options]]
    445444    }
    446445    set _cname2id($cname) $ids
     
    448447
    449448#
    450 # ParseHotspot -- 
     449# ParseHotspot --
    451450#
    452451itcl::body Rappture::DrawingEntry::ParseHotspot { cpath cname } {
    453452    array set attr2option {
    454         "color" "-fill"
    455         "anchor" "-anchor"
     453        "color"  "-fill"
     454        "anchor" "-anchor"
    456455    }
    457456
    458457    # Set default options first and then let tool.xml override them.
    459458    array set options {
    460         -fill red
    461         -anchor c
     459        -fill red
     460        -anchor c
    462461    }
    463462    foreach attr [$_xmlobj children $cpath] {
    464         if { [info exists attr2option($attr)] } {
    465             set option $attr2option($attr)
    466             set value [XmlGetSubst $cpath.$attr]
    467             set options($option) $value
    468         }
     463        if { [info exists attr2option($attr)] } {
     464            set option $attr2option($attr)
     465            set value [XmlGetSubst $cpath.$attr]
     466            set options($option) $value
     467        }
    469468    }
    470469    # Coordinates
    471470    set coords [XmlGetSubst $cpath.coords]
    472471    if {$coords eq ""} {
    473         set coords "0 0 1 1"
     472        set coords "0 0 1 1"
    474473    }
    475474    set c $itk_component(drawing)
     
    489488
    490489#
    491 # ParseLine -- 
     490# ParseLine --
    492491#
    493492itcl::body Rappture::DrawingEntry::ParseLine { cpath cname } {
    494493    array set attr2option {
    495         "linewidth"     "-width"
    496         "arrow"         "-arrow"
    497         "dash"          "-dash"
    498         "color"         "-fill"
     494        "linewidth"     "-width"
     495        "arrow"         "-arrow"
     496        "dash"          "-dash"
     497        "color"         "-fill"
    499498    }
    500499    # Set default options first and then let tool.xml override them.
    501500    array set options {
    502         -arrow          none
    503         -width          0
    504         -fill           black
    505         -dash           ""
     501        -arrow          none
     502        -width          0
     503        -fill           black
     504        -dash           ""
    506505    }
    507506    # Coords
    508507    set coords [XmlGetSubst $cpath.coords]
    509508    if {$coords eq ""} {
    510         set coords "0 0"
     509        set coords "0 0"
    511510    }
    512511    set coords [ScreenCoords $coords]
     
    514513    set list {}
    515514    foreach attr [$_xmlobj children $cpath] {
    516         if { [info exists attr2option($attr)] } {
    517             set option $attr2option($attr)
    518             set value [XmlGetSubst $cpath.$attr]
    519             set options($option) $value
    520         }
     515        if { [info exists attr2option($attr)] } {
     516            set option $attr2option($attr)
     517            set value [XmlGetSubst $cpath.$attr]
     518            set options($option) $value
     519        }
    521520    }
    522521    set options(-tags) $cname
     
    527526
    528527#
    529 # ParseOval -- 
     528# ParseOval --
    530529#
    531530itcl::body Rappture::DrawingEntry::ParseOval { cpath cname } {
    532531    array set attr2option {
    533         "outline"       "-outline"
    534         "fill"          "-fill"
    535         "linewidth"     "-width"
     532        "outline"       "-outline"
     533        "fill"          "-fill"
     534        "linewidth"     "-width"
    536535    }
    537536
    538537    # Set default options first and then let tool.xml override them.
    539538    array set options {
    540         -fill blue
    541         -width 1
    542         -outline black
     539        -fill blue
     540        -width 1
     541        -outline black
    543542    }
    544543    foreach attr [$_xmlobj children $cpath] {
    545         if { [info exists attr2option($attr)] } {
    546             set option $attr2option($attr)
    547             set value [XmlGetSubst $cpath.$attr]
    548             set options($option) $value
    549         }
     544        if { [info exists attr2option($attr)] } {
     545            set option $attr2option($attr)
     546            set value [XmlGetSubst $cpath.$attr]
     547            set options($option) $value
     548        }
    550549    }
    551550    # Coordinates
    552551    set coords [XmlGetSubst $cpath.coords]
    553552    if {$coords eq ""} {
    554         set coords "0 0 1 1"
     553        set coords "0 0 1 1"
    555554    }
    556555    foreach { x1 y1 x2 y2 } [ScreenCoords $coords] break
     
    561560
    562561#
    563 # ParsePicture -- 
     562# ParsePicture --
    564563#
    565564itcl::body Rappture::DrawingEntry::ParsePicture { cpath cname } {
    566565    array set attr2option {
    567         "anchor"        "-anchor"
     566        "anchor"        "-anchor"
    568567    }
    569568
    570569    # Set default options first and then let tool.xml override them.
    571570    array set options {
    572         -anchor nw
     571        -anchor nw
    573572    }
    574573    foreach attr [$_xmlobj children $cpath] {
    575         if { [info exists attr2option($attr)] } {
    576             set option $attr2option($attr)
    577             set value [XmlGetSubst $cpath.$attr]
    578             set options($option) $value
    579         }
     574        if { [info exists attr2option($attr)] } {
     575            set option $attr2option($attr)
     576            set value [XmlGetSubst $cpath.$attr]
     577            set options($option) $value
     578        }
    580579    }
    581580    set contents [XmlGetSubst $cpath.contents]
    582581    set img ""
    583582    if { [string compare -length 7 $contents "file://"] == 0 } {
    584         set fileName [string range $contents 7 end]
     583        set fileName [string range $contents 7 end]
    585584        set path $fileName
    586585        # find the file on a search path
     
    595594            }
    596595        }
    597         if { [file exists $path] } {
    598             set img [image create photo -file $path]
    599         } else {
     596        if { [file exists $path] } {
     597            set img [image create photo -file $path]
     598        } else {
    600599            puts stderr "WARNING: can't find picture contents \"$path\""
    601600        }
    602601    } elseif { [string compare -length 7 $contents "http://"] == 0 } {
    603         puts stderr  "don't know how to handle http"
    604         return
     602        puts stderr  "don't know how to handle http"
     603        return
    605604    } else {
    606         set img [image create photo -data $contents]
     605        set img [image create photo -data $contents]
    607606    }
    608607    if {$img eq ""} {
    609         return
     608        return
    610609    }
    611610    # Coordinates
    612611    set coords [XmlGetSubst $cpath.coords]
    613612    if { [llength $coords] == 2 } {
    614         foreach { x1 y1 } [ScreenCoords $coords] break
    615         set w [XmlGetSubst $cpath.width]
    616         if { $w == "" || ![string is double $w] || $w <= 0.0 } {
    617             set width [expr [image width $img] / 4]
    618         } else {
    619             set width [expr int([ScreenX $w] - [ScreenX 0])]
    620         }
    621         set h [XmlGetSubst $cpath.height]
    622         if { $h == "" || ![string is double $h] || $h <= 0.0 } {
    623             set height [expr [image height $img] / 4]
    624         } else {
    625             set height [expr int([ScreenY $h] - [ScreenY 0])]
    626         }
    627         if { $width != [image width $img] || $height != [image height $img] } {
    628             set dst [image create photo -width $width -height $height]
    629             blt::winop resample $img $dst box
    630             image delete $img
    631             set img $dst
    632         }
     613        foreach { x1 y1 } [ScreenCoords $coords] break
     614        set w [XmlGetSubst $cpath.width]
     615        if { $w == "" || ![string is double $w] || $w <= 0.0 } {
     616            set width [expr [image width $img] / 4]
     617        } else {
     618            set width [expr int([ScreenX $w] - [ScreenX 0])]
     619        }
     620        set h [XmlGetSubst $cpath.height]
     621        if { $h == "" || ![string is double $h] || $h <= 0.0 } {
     622            set height [expr [image height $img] / 4]
     623        } else {
     624            set height [expr int([ScreenY $h] - [ScreenY 0])]
     625        }
     626        if { $width != [image width $img] || $height != [image height $img] } {
     627            set dst [image create photo -width $width -height $height]
     628            blt::winop resample $img $dst box
     629            image delete $img
     630            set img $dst
     631        }
    633632    } elseif { [llength $coords] == 4 } {
    634         foreach { x1 y1 x2 y2 } [ScreenCoords $coords] break
    635         if { $x1 > $x2 } {
    636             set tmp $x1
    637             set x1 $x2
    638             set x2 $tmp
    639         }
    640         if { $y1 > $y2 } {
    641             set tmp $x1
    642             set x1 $x2
    643             set x2 $tmp
    644         }
    645         set width [expr {int($x2 - $x1 + 1)}]
    646         set height [expr {int($y2 - $y1 + 1)}]
    647         if { $width != [image width $img] || $height != [image height $img] } {
    648             set dst [image create photo -width $width -height $height]
    649             blt::winop resample $img $dst box
    650             image delete $img
    651             set img $dst
    652         }
     633        foreach { x1 y1 x2 y2 } [ScreenCoords $coords] break
     634        if { $x1 > $x2 } {
     635            set tmp $x1
     636            set x1 $x2
     637            set x2 $tmp
     638        }
     639        if { $y1 > $y2 } {
     640            set tmp $x1
     641            set x1 $x2
     642            set x2 $tmp
     643        }
     644        set width [expr {int($x2 - $x1 + 1)}]
     645        set height [expr {int($y2 - $y1 + 1)}]
     646        if { $width != [image width $img] || $height != [image height $img] } {
     647            set dst [image create photo -width $width -height $height]
     648            blt::winop resample $img $dst box
     649            image delete $img
     650            set img $dst
     651        }
    653652    } else {
    654         set width [expr [image width $img] / 4]
    655         set height [expr [image height $img] / 4]
    656         set dst [image create photo -width $width -height $height]
    657         blt::winop resample $img $dst box
    658         image delete $img
    659         set img $dst
    660         set x1 0
    661         set y1 0
     653        set width [expr [image width $img] / 4]
     654        set height [expr [image height $img] / 4]
     655         set dst [image create photo -width $width -height $height]
     656        blt::winop resample $img $dst box
     657        image delete $img
     658        set img $dst
     659        set x1 0
     660        set y1 0
    662661    }
    663662    set options(-tags) $cname
     
    672671itcl::body Rappture::DrawingEntry::ParsePolygon { cpath cname } {
    673672    array set attr2option {
    674         "outline"       "-outline"
    675         "color"         "-fill"
    676         "fill"          "-fill"
    677         "linewidth"     "-width"
     673        "outline"       "-outline"
     674        "color"         "-fill"
     675        "fill"          "-fill"
     676        "linewidth"     "-width"
    678677    }
    679678    # Set default options first and then let tool.xml override them.
    680679    array set options {
    681         -width          1
    682         -fill           blue
    683         -outline        black
     680        -width          1
     681        -fill           blue
     682        -outline        black
    684683    }
    685684
     
    687686    set coords [XmlGetSubst $cpath.coords]
    688687    if {$coords eq ""} {
    689         set coords "0 0"
     688        set coords "0 0"
    690689    }
    691690    set coords [ScreenCoords $coords]
     
    693692    set list {}
    694693    foreach attr [$_xmlobj children $cpath] {
    695         if { [info exists attr2option($attr)] } {
    696             set option $attr2option($attr)
    697             set value [XmlGetSubst $cpath.$attr]
    698             set options($option) $value
    699         }
     694        if { [info exists attr2option($attr)] } {
     695            set option $attr2option($attr)
     696            set value [XmlGetSubst $cpath.$attr]
     697            set options($option) $value
     698        }
    700699    }
    701700    set options(-tags) $cname
     
    706705
    707706#
    708 # ParseRectangle -- 
     707# ParseRectangle --
    709708#
    710709itcl::body Rappture::DrawingEntry::ParseRectangle { cpath cname } {
    711710    array set attr2option {
    712         "outline"       "-outline"
    713         "fill"          "-fill"
    714         "linewidth"     "-width"
     711        "outline"       "-outline"
     712        "fill"          "-fill"
     713        "linewidth"     "-width"
    715714    }
    716715
    717716    # Set default options first and then let tool.xml override them.
    718717    array set options {
    719         -fill blue
    720         -width 1
    721         -outline black
     718        -fill blue
     719        -width 1
     720        -outline black
    722721    }
    723722    foreach attr [$_xmlobj children $cpath] {
    724         if { [info exists attr2option($attr)] } {
    725             set option $attr2option($attr)
    726             set value [XmlGetSubst $cpath.$attr]
    727             set options($option) $value
    728         }
     723        if { [info exists attr2option($attr)] } {
     724            set option $attr2option($attr)
     725            set value [XmlGetSubst $cpath.$attr]
     726            set options($option) $value
     727        }
    729728    }
    730729    # Coordinates
    731730    set coords [XmlGetSubst $cpath.coords]
    732731    if {$coords eq ""} {
    733         set coords "0 0 1 1"
    734     }
    735     foreach { x1 y1 x2 y2 } [ScreenCoords $coords] break 
     732        set coords "0 0 1 1"
     733    }
     734    foreach { x1 y1 x2 y2 } [ScreenCoords $coords] break
    736735    set id [$itk_component(drawing) create rectangle $x1 $y1 $x2 $y2]
    737736    set _cname2id($cname) $id
     
    740739
    741740#
    742 # ParseText -- 
     741# ParseText --
    743742#
    744743itcl::body Rappture::DrawingEntry::ParseText { cpath cname } {
    745744    array set attr2option {
    746         "font"          "-font"
    747         "color"         "-foreground"
    748         "valuecolor"    "-valueforeground"
    749         "fill"          "-background"
    750         "text"          "-text"
    751         "anchor"        "-anchor"
     745        "font"          "-font"
     746        "color"         "-foreground"
     747        "valuecolor"    "-valueforeground"
     748        "fill"          "-background"
     749        "text"          "-text"
     750        "anchor"        "-anchor"
    752751    }
    753752
    754753    # Set default options first and then let tool.xml override them.
    755754    array set options {
    756         -font {Arial -14}
    757         -valuefont {Arial -14}
    758         -valueforeground blue3
    759         -text {}
    760         -fill {}
    761         -anchor c
     755        -font {Arial -14}
     756        -valuefont {Arial -14}
     757        -valueforeground blue3
     758        -text {}
     759        -fill {}
     760        -anchor c
    762761    }
    763762    foreach attr [$_xmlobj children $cpath] {
    764         if { [info exists attr2option($attr)] } {
    765             set option $attr2option($attr)
    766             if { $attr == "text" } {
    767                 set value [XmlGet $cpath.$attr]
    768             } else {
    769                 set value [XmlGetSubst $cpath.$attr]
    770             }
    771             set options($option) $value
    772         }
     763        if { [info exists attr2option($attr)] } {
     764            set option $attr2option($attr)
     765            if { $attr == "text" } {
     766                set value [XmlGet $cpath.$attr]
     767            } else {
     768                set value [XmlGetSubst $cpath.$attr]
     769            }
     770            set options($option) $value
     771        }
    773772    }
    774773    # Coords
     
    788787
    789788    if {$hotspot eq "inline"} {
    790         set options(-showicons) 1
     789        set options(-showicons) 1
    791790    }
    792791    set c $itk_component(drawing)
     
    800799
    801800    if {$hotspot eq "inline"} {
    802         $c bind $id <Enter> \
    803             [itcl::code $this Hotspot activate $cname $id %x %y]
    804         $c bind $id <Motion> \
    805             [itcl::code $this Hotspot activate $cname $id %x %y]
    806         $c bind $id <Leave> \
    807             [itcl::code $this Hotspot deactivate $cname $id]
    808         $c bind $id <ButtonRelease-1> \
    809             [itcl::code $this Hotspot invoke $cname $id %x %y]
     801        $c bind $id <Enter> \
     802            [itcl::code $this Hotspot activate $cname $id %x %y]
     803        $c bind $id <Motion> \
     804            [itcl::code $this Hotspot activate $cname $id %x %y]
     805        $c bind $id <Leave> \
     806            [itcl::code $this Hotspot deactivate $cname $id]
     807        $c bind $id <ButtonRelease-1> \
     808            [itcl::code $this Hotspot invoke $cname $id %x %y]
    810809    }
    811810}
     
    823822
    824823    switch -- $option {
    825         activate {
     824        activate {
    826825            if {$varName ne ""} {
    827                 set active [$c itemcget $item -activevalue]
    828                 if {$varName ne $active} {
    829                     $c itemconfigure $item -activevalue $varName
     826                set active [$c itemcget $item -activevalue]
     827                if {$varName ne $active} {
     828                    $c itemconfigure $item -activevalue $varName
    830829                }
    831                 $itk_component(drawing) configure -cursor center_ptr 
     830                $itk_component(drawing) configure -cursor center_ptr
    832831
    833832                # put up a tooltip for this item
     
    842841                }
    843842            } else {
    844                 $c itemconfigure $item -activevalue ""
     843                $c itemconfigure $item -activevalue ""
    845844                $itk_component(drawing) configure -cursor ""
    846845                Rappture::Tooltip::tooltip cancel
    847846            }
    848         }
    849         deactivate {
    850             $c itemconfigure $item -activevalue ""
     847        }
     848        deactivate {
     849            $c itemconfigure $item -activevalue ""
    851850            $itk_component(drawing) configure -cursor ""
    852851            Rappture::Tooltip::tooltip cancel
    853         }
    854         invoke {
    855             if {$varName ne ""} {
    856                 set x [expr {($x0+$x1)/2}]
    857                 Invoke $_name2path($varName) $x $y0
    858             }
    859         }
     852        }
     853        invoke {
     854            if {$varName ne ""} {
     855                set x [expr {($x0+$x1)/2}]
     856                Invoke $_name2path($varName) $x $y0
     857            }
     858        }
    860859        default {
    861860            error "bad option \"$option\": should be activate, deactivate, invoke"
     
    876875    set list {}
    877876    foreach {x y} $coords {
    878         lappend list [ScreenX $x] [ScreenY $y]
     877        lappend list [ScreenX $x] [ScreenY $y]
    879878    }
    880879    return $list
     
    882881
    883882itcl::body Rappture::DrawingEntry::AdjustDrawingArea { xAspect yAspect } {
    884     set _drawingWidth $_canvasWidth 
     883    set _drawingWidth $_canvasWidth
    885884    set _drawingHeight $_canvasHeight
    886885    if { $xAspect <= 0 || $yAspect <= 0 } {
    887         return
     886        return
    888887    }
    889888    set current [expr double($_canvasWidth) / double($_canvasHeight)]
    890889    set wanted [expr double($xAspect) / double($yAspect)]
    891890    if { $current > $wanted } {
    892         set sw [ expr int($_canvasWidth * $wanted)]
    893         if { $sw < 1 } {
    894             set sw 1
    895         }
    896         set _xOffset [expr $_canvasWidth - $sw]
    897         set _drawingWidth $sw
     891        set sw [ expr int($_canvasWidth * $wanted)]
     892        if { $sw < 1 } {
     893            set sw 1
     894        }
     895        set _xOffset [expr $_canvasWidth - $sw]
     896        set _drawingWidth $sw
    898897    } else {
    899         set sh [expr int($_canvasHeight / $wanted)]
    900         if { $sh < 1 }  {
    901             set sh 1
    902         }
    903         set _xOffset [expr $_canvasHeight - $sh]
    904         set _drawingHeight $sh
     898        set sh [expr int($_canvasHeight / $wanted)]
     899        if { $sh < 1 }  {
     900            set sh 1
     901        }
     902        set _xOffset [expr $_canvasHeight - $sh]
     903        set _drawingHeight $sh
    905904    }
    906905}
     
    910909#       <!-- background color of the drawing canvas (default white) -->
    911910#       <color>black</color>
    912 #       <!-- coordinate system:  x0 y0 ?at screenx screeny? x1 y1 
    913 #                               ?at screenx screeny?
     911#       <!-- coordinate system:  x0 y0 ?at screenx screeny? x1 y1
     912#                                ?at screenx screeny?
    914913#            The screenx/screeny values are optional, so you can also say
    915 #          something like "-.1 0 1.1 1" as you had in your example.
    916 #          This lets you put the origin at a specific point on screen,
    917 #          and also define the directions of the axes.  We still compute
    918 #          the overall bounding box.  In the example below, the bounding
    919 #          box goes from -1,1 in the upper-left corner to 1,-1 in the
    920 #          lower right.
     914#            something like "-.1 0 1.1 1" as you had in your example.
     915#            This lets you put the origin at a specific point on screen,
     916#            and also define the directions of the axes.  We still compute
     917#            the overall bounding box.  In the example below, the bounding
     918#            box goes from -1,1 in the upper-left corner to 1,-1 in the
     919#            lower right.
    921920#       -->
    922921#       <coordinates>0 0 at 50% 50% 1 1 at 100% 100%</coordinates>
     
    924923#       <!-- aspect ratio:  scales coordinate system so that pixels may not
    925924#            be square.  A coordinate system like the one above implies a
    926 #          square drawing area, since x and y both go from -1 to 1.  But
    927 #          if you set the aspect to 2:1, you'll get something twice as
    928 #          wide as it is tall.  This effectively says that x goes from
    929 #          -1 to 1 in a certain distance, but y goes from -1 to 1 in half
    930 #          that screen distance.  Default is whatever aspect is defined
    931 #          by the coordinates.  If x goes 0-3 and y goes 0-1, then the
    932 #          drawing (without any other aspect ratio) would be 3x wide and
    933 #          1x tall.  The aspect ratio could be used to force it to be
    934 #          square instead by setting "1 1" instead.  In that case, x goes
    935 #          0-3 over the width, and y goes 0-1 over the same screen distance
    936 #          along the height.
     925#            square drawing area, since x and y both go from -1 to 1.  But
     926#            if you set the aspect to 2:1, you'll get something twice as
     927#            wide as it is tall.  This effectively says that x goes from
     928#            -1 to 1 in a certain distance, but y goes from -1 to 1 in half
     929#            that screen distance.  Default is whatever aspect is defined
     930#            by the coordinates.  If x goes 0-3 and y goes 0-1, then the
     931#            drawing (without any other aspect ratio) would be 3x wide and
     932#            1x tall.  The aspect ratio could be used to force it to be
     933#            square instead by setting "1 1" instead.  In that case, x goes
     934#            0-3 over the width, and y goes 0-1 over the same screen distance
     935#            along the height.
    937936#       -->
    938937#       <aspect>2 1</aspect>
     
    10251024itcl::body Rappture::DrawingEntry::ParseBackground {} {
    10261025    foreach elem [$_xmlobj children $_path.background] {
    1027         switch -- $elem {
    1028             "color" {
    1029                 #  Background color of the drawing canvas (default white)
    1030                 set value [XmlGet $_path.background.$elem]
    1031                 $itk_component(drawing) configure -background $value
    1032             }
    1033             "aspect" {
    1034                 set value [XmlGet $_path.background.$elem]
    1035                 foreach { xAspect yAspect } $value break
    1036                 AdjustDrawingArea $xAspect $yAspect
    1037             }
    1038             "coords" - "coordinates" {
    1039                 set value [XmlGet $_path.background.$elem]
    1040                 ParseScreenCoordinates $value
    1041             }
    1042             "width" {
    1043                 set width [XmlGet $_path.background.$elem]
    1044                 $itk_component(drawing) configure -width $width
    1045             }
    1046             "height" {
    1047                 set height [XmlGet $_path.background.$elem]
    1048                 $itk_component(drawing) configure -height $height
    1049             }
     1026        switch -- $elem {
     1027            "color" {
     1028                #  Background color of the drawing canvas (default white)
     1029                set value [XmlGet $_path.background.$elem]
     1030                $itk_component(drawing) configure -background $value
     1031            }
     1032            "aspect" {
     1033                set value [XmlGet $_path.background.$elem]
     1034                foreach { xAspect yAspect } $value break
     1035                AdjustDrawingArea $xAspect $yAspect
     1036            }
     1037            "coords" - "coordinates" {
     1038                set value [XmlGet $_path.background.$elem]
     1039                ParseScreenCoordinates $value
     1040            }
     1041            "width" {
     1042                set width [XmlGet $_path.background.$elem]
     1043                $itk_component(drawing) configure -width $width
     1044            }
     1045            "height" {
     1046                set height [XmlGet $_path.background.$elem]
     1047                $itk_component(drawing) configure -height $height
     1048            }
    10501049            default {
    10511050                puts stderr "WARNING: don't understand \"$elem\" in $_path"
    10521051            }
    1053         }
    1054     }
    1055 }
    1056 
    1057 #
    1058 # Invoke -- 
     1052        }
     1053    }
     1054}
     1055
     1056#
     1057# Invoke --
    10591058#
    10601059itcl::body Rappture::DrawingEntry::Invoke {cpath x y} {
     
    10761075
    10771076    # Activate the popup and call for the output.
    1078     set rootx [winfo rootx $itk_component(drawing)] 
     1077    set rootx [winfo rootx $itk_component(drawing)]
    10791078    set rooty [winfo rooty $itk_component(drawing)]
    10801079
     
    10851084
    10861085#
    1087 # Activate -- 
     1086# Activate --
    10881087#
    10891088itcl::body Rappture::DrawingEntry::Activate { cname } {
    1090     $itk_component(drawing) configure -cursor center_ptr 
     1089    $itk_component(drawing) configure -cursor center_ptr
    10911090    $itk_component(drawing) itemconfigure $_cname2id($cname) \
    1092         -image [Rappture::icon hotspot_active]
    1093 }
    1094 
    1095 #
    1096 # Deactivate -- 
     1091        -image [Rappture::icon hotspot_active]
     1092}
     1093
     1094#
     1095# Deactivate --
    10971096#
    10981097itcl::body Rappture::DrawingEntry::Deactivate { cname } {
    10991098    $itk_component(drawing) configure -cursor ""
    11001099    $itk_component(drawing) itemconfigure $_cname2id($cname) \
    1101         -image [Rappture::icon hotspot_normal]
     1100        -image [Rappture::icon hotspot_normal]
    11021101}
    11031102
     
    11141113    # Redraw if there's a new library object.
    11151114    if { [llength $args] > 0 } {
    1116         set libobj [lindex $args 0]
    1117         if { $libobj != "" } {
     1115        set libobj [lindex $args 0]
     1116        if { $libobj != "" } {
    11181117            $_dispatcher event -idle !redraw
    1119         }
     1118        }
    11201119    }
    11211120    return ""
     
    11251124    # Load parser with the variables representing the substitution
    11261125    foreach name [array names _name2path] {
    1127         set path $_name2path($name)
    1128         set w [$_owner widgetfor $path]
    1129         if {$w ne ""} {
    1130             set value [$w value]
    1131         } else {
    1132             set value ""
    1133         }
     1126        set path $_name2path($name)
     1127        set w [$_owner widgetfor $path]
     1128        if {$w ne ""} {
     1129            set value [$w value]
     1130        } else {
     1131            set value ""
     1132        }
    11341133        if {$_name2map($name) ne ""} {
    11351134            set value [string map $_name2map($name) $value]
    11361135        }
    1137         $_parser eval [list set $name $value]
     1136        $_parser eval [list set $name $value]
    11381137    }
    11391138}
     
    11471146    set value [$_xmlobj get $path]
    11481147    if {$_parser == ""} {
    1149         return [string trim $value]
     1148        return [string trim $value]
    11501149    }
    11511150    return [string trim [$_parser eval [list subst -nocommands $value]]]
  • trunk/gui/scripts/dropdown.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: dropdown - base class for drop-down panels
  • trunk/gui/scripts/dropdownchecks.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: dropdownchecks - drop-down list of checkbox items
     
    2626    inherit Rappture::Dropdown
    2727
    28     itk_option define -font font Font "" 
    29     itk_option define -foreground foreground Foreground "" 
     28    itk_option define -font font Font ""
     29    itk_option define -foreground foreground Foreground ""
    3030
    3131    constructor {args} { # defined below }
  • trunk/gui/scripts/dropdownlist.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: dropdownlist - drop-down list of items
  • trunk/gui/scripts/editor.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: editor - pop-up editor for little bits of text
     
    5959    protected variable _loc   ;# array of editor location parameters
    6060}
    61                                                                                
     61
    6262itk::usual Editor {
    6363    keep -cursor -font
     
    286286    if {$h+$_loc(y) >= [winfo screenheight $e]} {
    287287        set h [expr {[winfo screenheight $e]-$_loc(y)}]
    288     }                                       
     288    }
    289289    # Temporary fix to prevent Opps. Don't deal with negative dimensions.
    290290    if { $w <= 0 || $h <= 0 } {
  • trunk/gui/scripts/energyLevels.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: EnergyLevels - visualizer for discrete energy levels
  • trunk/gui/scripts/field.tcl

    r5646 r5659  
    2222#
    2323# 1D Datasets
    24 #       1D              A field contained in a structure
     24#       1D              A field contained in a structure
    2525# 2D Datasets
    26 #       vtk             (range of z-axis is zero).
    27 #       unirect2d       (deprecated)
    28 #       cloud           (x,y point coordinates) (deprecated)
    29 #       mesh
     26#       vtk             (range of z-axis is zero).
     27#       unirect2d       (deprecated)
     28#       cloud           (x,y point coordinates) (deprecated)
     29#       mesh
    3030# 3D Datasets
    31 #       vtk
    32 #       unirect3d       (deprecated)
    33 #       cloud           (x,y,z coordinates) (deprecated)
    34 #       mesh
    35 #       dx              (FIXME: make dx-to-vtk converter work)
    36 #       ucd             (AVS ucd format)
     31#       vtk
     32#       unirect3d       (deprecated)
     33#       cloud           (x,y,z coordinates) (deprecated)
     34#       mesh
     35#       dx              (FIXME: make dx-to-vtk converter work)
     36#       ucd             (AVS ucd format)
    3737#
    3838# Viewers:
    39 #       Format     Dim  Description                     Viewer          Server
    40 #       1D          1   structure field                 DeviceViewer1D  N/A
    41 #       vtk         2   vtk file data.                  contour         vtkvis
    42 #       vtk         3   vtk file data.                  isosurface      vtkvis
    43 #       mesh        2   points-on-mesh                  heightmap       vtkvis
    44 #       mesh        3   points-on-mesh                  isosurface      vtkvis
    45 #       dx          3   DX                              volume          nanovis
    46 #       unirect2d   2   unirect2d + extents > 1 flow    flow            nanovis
    47 #       unirect3d   3   unirect3d + extents > 1 flow    flow            nanovis
     39#       Format     Dim  Description                   Viewer          Server
     40#       1D          1   structure field               DeviceViewer1D  N/A
     41#       vtk         2   vtk file data.                contour         vtkvis
     42#       vtk         3   vtk file data.                isosurface      vtkvis
     43#       mesh        2   points-on-mesh                heightmap       vtkvis
     44#       mesh        3   points-on-mesh                isosurface      vtkvis
     45#       dx          3   DX                            volume          nanovis
     46#       unirect2d   2   unirect2d + extents > 1 flow  flow            nanovis
     47#       unirect3d   3   unirect3d + extents > 1 flow  flow            nanovis
    4848#
    4949# With <views>, can specify which viewer for specific datasets.  So it's OK
     
    811811            set _viewer $viewer
    812812        }
    813         if { $_viewer == "" } { 
     813        if { $_viewer == "" } {
    814814            if { $_comp2size($cname) > 1 && ! $haveFlow } {
    815815                set _viewer "glyphs"
  • trunk/gui/scripts/fieldresult.tcl

    r5097 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: fieldresult - plot a field in a ResultSet
     
    8888                itk_component add renderer {
    8989                    Rappture::VtkHeightmapViewer $itk_interior.ren $servers \
    90                         -mode $flags(-mode)
     90                        -mode $flags(-mode)
    9191                }
    9292            }
     
    108108            "vtkimage" {
    109109                itk_component add renderer {
    110                     Rappture::VtkImageViewer $itk_interior.ren $servers 
     110                    Rappture::VtkImageViewer $itk_interior.ren $servers
    111111                }
    112112            }
     
    124124                puts stderr "unknown render mode \"$flags(-mode)\""
    125125            }
    126         }               
     126        }
    127127        pack $itk_component(renderer) -expand yes -fill both
    128128
     
    156156# ----------------------------------------------------------------------
    157157itcl::body Rappture::FieldResult::add {dataobj {settings ""}} {
    158     if { ![info exists itk_component(renderer)] } { 
     158    if { ![info exists itk_component(renderer)] } {
    159159        puts stderr "add: no renderer created."
    160160        return
     
    170170# ----------------------------------------------------------------------
    171171itcl::body Rappture::FieldResult::get {} {
    172     if { ![info exists itk_component(renderer)] } { 
     172    if { ![info exists itk_component(renderer)] } {
    173173        puts stderr "get: no renderer created."
    174174        return
     
    199199# ----------------------------------------------------------------------
    200200itcl::body Rappture::FieldResult::scale {args} {
    201     if { ![info exists itk_component(renderer)] } { 
     201    if { ![info exists itk_component(renderer)] } {
    202202        puts stderr "scale: no renderer created."
    203203        return
     
    217217# ----------------------------------------------------------------------
    218218itcl::body Rappture::FieldResult::download {option args} {
    219     if { ![info exists itk_component(renderer)] } { 
     219    if { ![info exists itk_component(renderer)] } {
    220220        puts stderr "download: no renderer created."
    221221        return
     
    225225
    226226itcl::body Rappture::FieldResult::snap { w h } {
    227     if { ![info exists itk_component(renderer)] } { 
     227    if { ![info exists itk_component(renderer)] } {
    228228        puts stderr "snap: no renderer created."
    229229        return
  • trunk/gui/scripts/filechoiceentry.tcl

    r4004 r5659  
    1 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: FileChoiceEntry - widget for entering a choice of strings
     
    1818
    1919    itk_option define -state state State "normal"
    20    
     20
    2121    private variable _rebuildPending 0
    2222
    23     constructor {owner path args} { 
    24         # defined below 
    25     }
    26     destructor { 
    27         # defined below 
     23    constructor {owner path args} {
     24        # defined below
     25    }
     26    destructor {
     27        # defined below
    2828    }
    2929    public method value {args}
     
    7272
    7373    # First time, parse the <pattern> elements to generate notify callbacks
    74     # for each template found. 
     74    # for each template found.
    7575    foreach cname [$_owner xml children -type pattern $_path] {
    7676        set glob [string trim [$_owner xml get $_path.$cname]]
     
    307307}
    308308
    309 # 
     309#
    310310# Glob --
    311311#
    312 #       Matches a single pattern for files. This differs from the 
     312#       Matches a single pattern for files. This differs from the
    313313#       Tcl glob by
    314314#
  • trunk/gui/scripts/filelistentry.tcl

    r3964 r5659  
    1 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: FileListEntry - widget for entering a choice of strings
     
    1515
    1616itk::usual BltTreeView {
    17     keep -foreground -cursor 
     17    keep -foreground -cursor
    1818}
    1919itk::usual BltScrollset {
     
    2525
    2626    itk_option define -state state State "normal"
    27    
     27
    2828    private variable _rebuildPending 0
    2929    private variable _tree ""
     
    3232    private variable _icon ""
    3333
    34     constructor {owner path args} { 
    35         # defined below 
    36     }
    37     destructor { 
    38         # defined below 
     34    constructor {owner path args} {
     35        # defined below
     36    }
     37    destructor {
     38        # defined below
    3939    }
    4040    public method value {args}
     
    4242    public method label {}
    4343    public method tooltip {}
    44    
     44
    4545    protected method Rebuild {}
    4646    protected method NewValue { args }
     
    9898
    9999    blt::table $itk_interior \
    100         0,0 $itk_component(scrollset) -fill both 
     100        0,0 $itk_component(scrollset) -fill both
    101101    bind $itk_component(tree) <<Value>> [itcl::code $this NewValue]
    102102
    103103    # Standard ButtonPress-1
    104     $itk_component(tree) bind Entry <ButtonPress-1> {   
     104    $itk_component(tree) bind Entry <ButtonPress-1> {
    105105        Rappture::FileListEntry::SetSelectionAnchor %W current yes set
    106106        set blt::TreeView::_private(scroll) 1
    107107    }
    108108    # Standard B1-Motion
    109     $itk_component(tree) bind Entry <B1-Motion> { 
     109    $itk_component(tree) bind Entry <B1-Motion> {
    110110        set blt::TreeView::_private(x) %x
    111111        set blt::TreeView::_private(y) %y
     
    116116    $itk_component(tree) button bind all <ButtonRelease-1> {
    117117        set index [%W nearest %x %y blt::TreeView::_private(who)]
    118         if { [%W index current] == $index && 
     118        if { [%W index current] == $index &&
    119119             $blt::TreeView::_private(who) == "button" } {
    120120            %W see -anchor nw current
     
    123123    }
    124124    # Shift-ButtonPress-1
    125     $itk_component(tree) bind Entry <Shift-ButtonPress-1> {     
     125    $itk_component(tree) bind Entry <Shift-ButtonPress-1> {
    126126        Rappture::FileListEntry::SetSelectionAnchor %W current yes set
    127127        set blt::TreeView::_private(scroll) 1
    128128    }
    129129    # Shift-B1-Motion
    130     $itk_component(tree) bind Entry <Shift-B1-Motion> { 
     130    $itk_component(tree) bind Entry <Shift-B1-Motion> {
    131131        set blt::TreeView::_private(x) %x
    132132        set blt::TreeView::_private(y) %y
     
    139139    }
    140140    # Shift-ButtonRelease-1
    141     $itk_component(tree) bind Entry <Shift-ButtonRelease-1> { 
     141    $itk_component(tree) bind Entry <Shift-ButtonRelease-1> {
    142142        if { [%W cget -selectmode] == "multiple" } {
    143143            %W selection anchor current
     
    147147        set blt::TreeView::_private(scroll) 0
    148148    }
    149     $itk_component(tree) bind Entry <Control-ButtonPress-1> {   
     149    $itk_component(tree) bind Entry <Control-ButtonPress-1> {
    150150        Rappture::FileListEntry::SetSelectionAnchor %W current no toggle
    151151        set blt::TreeView::_private(scroll) 1
    152152    }
    153     $itk_component(tree) bind Entry <Control-B1-Motion> { 
     153    $itk_component(tree) bind Entry <Control-B1-Motion> {
    154154        set blt::TreeView::_private(x) %x
    155155        set blt::TreeView::_private(y) %y
     
    161161        }
    162162    }
    163     $itk_component(tree) bind Entry <Control-ButtonRelease-1> { 
     163    $itk_component(tree) bind Entry <Control-ButtonRelease-1> {
    164164        if { [%W cget -selectmode] == "multiple" } {
    165165            %W selection anchor current
     
    170170    }
    171171    # First time, parse the <pattern> elements to generate notify callbacks
    172     # for each template found. 
     172    # for each template found.
    173173    foreach cname [$_owner xml children -type pattern $_path] {
    174174        set glob [string trim [$_owner xml get $_path.$cname]]
     
    224224            return
    225225        }
    226         foreach id [$itk_component(tree) curselection] { 
    227             set path [$_tree get $id "path" ""] 
     226        foreach id [$itk_component(tree) curselection] {
     227            set path [$_tree get $id "path" ""]
    228228            set path2id($path) $id
    229229        }
     
    237237    #
    238238    set list {}
    239     foreach id [$itk_component(tree) curselection] { 
    240         set path [$_tree get $id "path" ""] 
     239    foreach id [$itk_component(tree) curselection] {
     240        set path [$_tree get $id "path" ""]
    241241        if { $path != "" } {
    242242            lappend list $path
     
    330330    eval $_tree delete [$_tree tag nodes unused]
    331331    $itk_component(tree) configure -width $max
    332     catch { 
     332    catch {
    333333        if { ![$itk_component(tree) selection present] } {
    334334            $itk_component(tree) selection set [$_tree firstchild root]
    335335        }
    336     } 
     336    }
    337337}
    338338
     
    423423}
    424424
    425 # 
     425#
    426426# Glob --
    427427#
    428 #       Matches a single pattern for files. This differs from the 
     428#       Matches a single pattern for files. This differs from the
    429429#       Tcl glob by
    430430#
  • trunk/gui/scripts/filexfer.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: filexfer - support for file transfer with user's desktop
     
    324324        set job(output) ""
    325325        set job(error) ""
    326        
     326
    327327        # Make sure we normalize the file name here.  Don't count
    328         # on filexfer command understanding tildes.
    329         set file [file normalize $file]
     328        # on filexfer command understanding tildes.
     329        set file [file normalize $file]
    330330
    331331        set status [catch {blt::bgexec ::Rappture::filexfer::job(control) \
  • trunk/gui/scripts/flowdial.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Flowdial - selector, like the dial on a flow
     
    132132itcl::body Rappture::Flowdial::current {value} {
    133133    if {"" == $value} {
    134         return 
     134        return
    135135    }
    136136    _current [ms2rel $value]
     
    149149    if { $relval < 0.0 } {
    150150        set relval 0.0
    151     } 
     151    }
    152152    if { $relval > 1.0 } {
    153153        set relval 1.0
    154     }                                       
     154    }
    155155    set _current $relval
    156156    after cancel [itcl::code $this _redraw]
  • trunk/gui/scripts/flowhints.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: flowhints - represents a uniform rectangular 2-D mesh.
     
    1817package require BLT
    1918
    20 namespace eval Rappture { 
     19namespace eval Rappture {
    2120    # empty
    2221}
    2322
    2423itcl::class Rappture::FlowHints {
    25     constructor {field cname units} { 
    26         # defined below 
    27     }
    28     destructor { 
    29         # defined below 
     24    constructor {field cname units} {
     25        # defined below
     26    }
     27    destructor {
     28        # defined below
    3029    }
    3130
     
    5352    if {[$field element $cname.flow] == ""} {
    5453        puts stderr "no flow entry in $cname"
    55         return 
     54        return
    5655    }
    5756    array set _hints {
     
    135134                        "linewidth"   { GetSize $b linewidth data(linewidth) }
    136135                        "label"       { set data(label) $value }
    137                         "corner*" { 
     136                        "corner*" {
    138137                            incr count
    139138                            GetCorner $b $child data(corner$count)
     
    154153itcl::body Rappture::FlowHints::ConvertUnits { value } {
    155154    set cmd Rappture::Units::convert
    156     set n  [scan $value "%g%s" number suffix] 
     155    set n  [scan $value "%g%s" number suffix]
    157156    if { $n == 2 } {
    158157        if { $suffix == "%" } {
  • trunk/gui/scripts/flowspeed.tcl

    r3454 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: spinint - spinner for integer values
  • trunk/gui/scripts/gauge.tcl

    r5085 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: gauge - compact readout for real values
     
    6767    }
    6868}
    69                                                                                
     69
    7070itk::usual Gauge {
    7171    keep -cursor -font -foreground -background
     
    212212        # the value is bound by any min/max value constraints.
    213213        #
    214         # Keep track of the inputted units so we can give a 
     214        # Keep track of the inputted units so we can give a
    215215        # response about min and max values in familiar units.
    216216        #
  • trunk/gui/scripts/getopts.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: getopts - simple argument parser
  • trunk/gui/scripts/grab.tcl

    r4663 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: grab - improved version of the Tk grab command
  • trunk/gui/scripts/groupentry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: GroupEntry - widget containing a group of controls
  • trunk/gui/scripts/histogram.tcl

    r5592 r5659  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: histogram - extracts data from an XML description of a field
     
    257256            xdesc   xaxis.description
    258257            xunits  xaxis.units
    259             xorient xaxis.orientation
     258            xorient xaxis.orientation
    260259            xscale  xaxis.scale
    261260            xmin    xaxis.min
  • trunk/gui/scripts/histogramresult.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: HistogramResult - X/Y plot in a ResultSet
     
    8079    itk_option define -autocolors autoColors AutoColors ""
    8180
    82     constructor {args} { 
    83         # defined below 
    84     }
    85     destructor { 
    86         # defined below 
     81    constructor {args} {
     82        # defined below
     83    }
     84    destructor {
     85        # defined below
    8786    }
    8887    public method add {dataobj {settings ""}}
     
    9089    public method delete {args}
    9190    public method scale {args}
    92     public method parameters {title args} { 
    93         # do nothing 
     91    public method parameters {title args} {
     92        # do nothing
    9493    }
    9594    public method download {option args}
     
    101100    protected method Axis {option args}
    102101    protected method GetAxes {dataobj}
    103     protected method GetLineMarkerOptions { style } 
    104     protected method GetTextMarkerOptions { style } 
     102    protected method GetLineMarkerOptions { style }
     103    protected method GetTextMarkerOptions { style }
    105104    protected method EnterMarker { g name x y text }
    106105    protected method LeaveMarker { g name }
     
    127126    private variable _xlabels
    128127}
    129                                                                                
     128
    130129itk::usual HistogramResult {
    131130    keep -background -foreground -cursor -font
     
    169168    itk_component add plot {
    170169        blt::barchart $f.plot \
    171             -highlightthickness 0 -plotpadx 0 -plotpady 4 
     170            -highlightthickness 0 -plotpadx 0 -plotpady 4
    172171    } {
    173172        keep -foreground -cursor -font
     
    354353            lappend top $obj
    355354        } else {
    356             lappend bottom $obj 
     355            lappend bottom $obj
    357356        }
    358357    }
     
    539538                            set xv [$dataobj mesh $comp]
    540539                            set yv [$dataobj values $comp]
    541                             if { [$xv length] > 0 && [$yv length] > 0 } {
    542                                 foreach x [$xv range 0 end] y [$yv range 0 end] {
    543                                     append csvdata \
    544                                         [format "%20.15g, %20.15g\n" $x $y]
    545                                 }
    546                             }
     540                            if { [$xv length] > 0 && [$yv length] > 0 } {
     541                                foreach x [$xv range 0 end] y [$yv range 0 end] {
     542                                    append csvdata \
     543                                        [format "%20.15g, %20.15g\n" $x $y]
     544                                }
     545                            }
    547546                            set first 0
    548547                        }
     
    559558                        # Create the print dialog widget and add it to the
    560559                        # the balloon popup.
    561                         Rappture::XyPrint $inner.print 
     560                        Rappture::XyPrint $inner.print
    562561                        $popup configure \
    563                             -deactivatecommand [list $inner.print reset] 
     562                            -deactivatecommand [list $inner.print reset]
    564563                        blt::table $inner 0,0 $inner.print -fill both
    565564                    }
     
    571570                    set output [$inner.print print $itk_component(plot) \
    572571                                    $toolName $plotName]
    573                     $popup deactivate 
     572                    $popup deactivate
    574573                    return $output
    575574                }
     
    596595    eval $g marker delete [$g marker names]
    597596    foreach axis [$g axis names] {
    598         $g axis configure $axis -hide yes 
     597        $g axis configure $axis -hide yes
    599598    }
    600599    # Presumably you want at least an X-axis and Y-axis displayed.
     
    602601    $g yaxis configure -hide no
    603602    array unset _label2axis
    604    
     603
    605604    #
    606605    # Scan through all objects and create a list of all axes.
     
    627626                        -checklimits no
    628627                    set _label2axis($ax-$label) $axis
    629                    
     628
    630629                    # if this axis has a description, add it as a tooltip
    631630                    set desc [string trim [$dataobj hints ${ax}desc]]
     
    635634        }
    636635    }
    637    
     636
    638637    #
    639638    # All of the extra axes get mapped to the x2/y2 (top/right)
     
    643642    foreach ax {x y} {
    644643        lappend all $ax
    645        
     644
    646645        set extra ""
    647646        for {set i 2} {$i <= $anum($ax)} {incr i} {
     
    713712            # Compute default bar width for histogram elements.
    714713            if { [$zv length] == [$xv length] } {
    715                 if { [$xv length] > 0 && [$yv length] > 0 } {
    716                     set xvalues [$xv range 0 end]
    717                     set yvalues [$yv range 0 end]
    718                     set zvalues [$zv range 0 end]
    719                     foreach x $xvalues y $yvalues z $zvalues {
    720                         set elem "elem[incr count]"
    721                         set _elem2dataobj($elem) $dataobj
    722                         $g element create $elem -x $x -y $y -barwidth $z \
    723                             -label $label -foreground $color \
    724                             -mapx $mapx -mapy $mapy
    725                     }
    726                 }
     714                if { [$xv length] > 0 && [$yv length] > 0 } {
     715                    set xvalues [$xv range 0 end]
     716                    set yvalues [$yv range 0 end]
     717                    set zvalues [$zv range 0 end]
     718                    foreach x $xvalues y $yvalues z $zvalues {
     719                        set elem "elem[incr count]"
     720                        set _elem2dataobj($elem) $dataobj
     721                        $g element create $elem -x $x -y $y -barwidth $z \
     722                            -label $label -foreground $color \
     723                            -mapx $mapx -mapy $mapy
     724                    }
     725                }
    727726            } else {
    728727                set r [blt::vector expr {max($xv) - min($xv)}]
    729                 set length [$xv length]
    730                 if { $length > 1 } {
    731                     set z [expr {$r / ([$xv length]-1) * 0.8}]
    732                 } else {
    733                     set z 1
    734                 }
     728                set length [$xv length]
     729                if { $length > 1 } {
     730                    set z [expr {$r / ([$xv length]-1) * 0.8}]
     731                } else {
     732                    set z 1
     733                }
    735734                set elem "elem[incr count]"
    736735                set _elem2dataobj($elem) $dataobj
     
    738737                    -label $label -foreground $color \
    739738                    -mapx $mapx -mapy $mapy
    740             } 
     739            }
    741740            set index 0
    742741            foreach label [$dataobj xlabels $comp] {
     
    754753        set xmax Inf
    755754        set ymax Inf
    756         # 
    757         # Create text/line markers for each *axis.marker specified. 
    758         # 
     755        #
     756        # Create text/line markers for each *axis.marker specified.
     757        #
    759758        foreach m [$dataobj xmarkers] {
    760759            foreach {at label style} $m break
     
    807806        set command ""
    808807    }
    809     $g axis configure x -command $command -stepsize $stepsize 
     808    $g axis configure x -command $command -stepsize $stepsize
    810809    set xorient [$dataobj hints xorient]
    811810    if { $xorient == "horizontal" } {
    812         set invert 0
     811        set invert 0
    813812    } elseif { $xorient == "vertical" } {
    814         set invert 1
     813        set invert 1
    815814    }
    816815    $g configure -invertxy $invert
     
    856855    set g $itk_component(plot)
    857856    set elem ""
    858  
     857
    859858    # Peek inside of Blt_ZoomStack package to see if we're currently in the
    860859    # middle of a zoom selection.
     
    10491048            }
    10501049        }
    1051        
     1050
    10521051        set ally [$g y2axis use]
    10531052        if {[llength $ally] > 0} {
     
    15831582
    15841583itcl::body Rappture::HistogramResult::LeaveMarker { g name } {
    1585     if { [info exists _markers($name)] } { 
     1584    if { [info exists _markers($name)] } {
    15861585        set id $_markers($name)
    15871586        $g marker delete $id
     
    15971596    # Ignore values that aren't close to the integer value
    15981597    if { $d < 0.00000001 } {
    1599         if { [info exists _xlabels($index)] } {
    1600             return $_xlabels($index)
    1601         }
     1598        if { [info exists _xlabels($index)] } {
     1599            return $_xlabels($index)
     1600        }
    16021601    }
    16031602    return " "
  • trunk/gui/scripts/htmlviewer.tcl

    r3642 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: htmlviewer - easy way to display HTML text
     
    305305        if {"" != $node} {
    306306            set bbox [$itk_component(html) bbox $node]
    307             if { [llength $bbox] == 4 } {
    308                 set realht [expr {[lindex $bbox 3]-[lindex $bbox 1]}]
    309             }
     307            if { [llength $bbox] == 4 } {
     308                set realht [expr {[lindex $bbox 3]-[lindex $bbox 1]}]
     309            }
    310310        }
    311311        if {$itk_option(-maxlines) > 0} {
  • trunk/gui/scripts/icons.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: icons - utility for loading icons from a library
     
    289289                set data(im-$n-colors) [gif_get_block $gifImageData pos $ctsize]
    290290            }
    291    
     291
    292292            set data(im-$n-data) ""
    293293            gif_put_byte data(im-$n-data) \
  • trunk/gui/scripts/image.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: image - represents a picture image
  • trunk/gui/scripts/imageentry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: ImageEntry - widget for displaying images
  • trunk/gui/scripts/imageresult.tcl

    r5044 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: imageresult - picture image in a ResultSet
     
    4848    private variable _image         ;# image buffers used for scaling
    4949}
    50                                                                                
     50
    5151itk::usual ImageResult {
    5252    keep -background -foreground -cursor -font
     
    131131
    132132    itk_component add image {
    133         label $main.image -image $_image(final) -anchor c 
     133        label $main.image -image $_image(final) -anchor c
    134134    } {
    135135        keep -background -foreground -cursor -font
  • trunk/gui/scripts/integerentry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: IntegerEntry - widget for entering integer values
     
    9494    #
    9595    set str [string trim [$_owner xml get $path.default]]
    96     if {"" != $str != ""} { 
    97         $itk_component(spinner) value $str 
     96    if {"" != $str != ""} {
     97        $itk_component(spinner) value $str
    9898    }
    9999}
  • trunk/gui/scripts/loader.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: loader - widget for loading examples and old runs
     
    3737    protected method _log {}
    3838
    39     private method SetDefaultValue { value } 
     39    private method SetDefaultValue { value }
    4040
    4141    private variable _owner ""    ;# thing managing this control
     
    245245    #
    246246    set str [string trim [$_owner xml get $path.default]]
    247     if { $str != "" } { 
     247    if { $str != "" } {
    248248        bind $itk_component(hull) <Map> [itcl::code $this SetDefaultValue $str]
    249249    }
     
    329329#       after the entire application is assembled, otherwise the default
    330330#       values set up by the loader will be overwritten by the various widgets
    331 #       themselves when they try to set their default values. 
     331#       themselves when they try to set their default values.
    332332#
    333333#       This is called from a  <Map> event to the loader (combobox).  This
  • trunk/gui/scripts/logger.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: logger - log user activities within the Rappture program
  • trunk/gui/scripts/main.tcl

    r4961 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22#!/bin/sh
    33# ----------------------------------------------------------------------
     
    343343    set arrangement [$win.pager cget -arrangement]
    344344    if { $type == "" } {
    345         if { $arrangement != "side-by-side" } { 
     345        if { $arrangement != "side-by-side" } {
    346346           set type auto
    347347        }
    348348    }
    349     if { $arrangement != "side-by-side" && 
     349    if { $arrangement != "side-by-side" &&
    350350            ($type == "manual" || $type == "manual-resim" ||
    351              $type == "auto" || $style == "wizard") } {
     351             $type == "auto" || $style == "wizard") } {
    352352        # in "auto" mode, we don't need a simulate button
    353353        $f.analyze configure -simcontrol off
  • trunk/gui/scripts/mainwin.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: mainwin - main application window for Rappture
     
    8989    private variable _bgparser ""  ;# parser for bgscript
    9090}
    91                                                                                
     91
    9292itk::usual MainWin {
    9393    keep -background -cursor foreground -font
  • trunk/gui/scripts/map.tcl

    r5647 r5659  
    258258                        set haveX 1
    259259                    } elseif {$key == "z"} {
    260                         set haveZ 1
     260                        set haveZ 1
    261261                    } elseif {$key == "srs"} {
    262262                        set haveSRS 1
  • trunk/gui/scripts/mesh.tcl

    r5635 r5659  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: mesh - represents a structured mesh for a device
     
    178177    # <vtk> described mesh
    179178    # <element> +  <node> definitions
    180     # <grid>            rectangular mesh
     179    # <grid>            rectangular mesh
    181180    # <unstructured>    homogeneous cell type mesh.
    182181
  • trunk/gui/scripts/meshresult.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: meshresult - mesh plot in a ResultSet
     
    5656    private variable _ymax ""      ;# autoscale max for y-axis
    5757}
    58                                                                                
     58
    5959itk::usual MeshResult {
    6060    keep -background -foreground -cursor -font
     
    315315    eval $g marker delete [$g marker names]
    316316    $g axis configure x -min "" -max "" -loose yes -checklimits no \
    317         -descending yes 
     317        -descending yes
    318318    $g axis configure y -min "" -max "" -loose yes -checklimits no
    319319
  • trunk/gui/scripts/note.tcl

    r3513 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: Note - widget for displaying HTML notes
     
    7271    set w [string trim [$_owner xml get $_path.width]]
    7372    if { $w != "" } {
    74         $itk_component(html) configure -width $w
     73        $itk_component(html) configure -width $w
    7574    }
    7675    set h [string trim [$_owner xml get $_path.height]]
    7776    if { $h != "" } {
    78         $itk_component(html) configure -height $h
    79     }   
     77        $itk_component(html) configure -height $h
     78    }
    8079}
    8180
  • trunk/gui/scripts/notebook.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: notebook - series of pages, but only one packed at a time
     
    4242    private variable _current ""    ;# page currently shown
    4343}
    44                                                                                
     44
    4545itk::usual Notebook {
    4646    keep -background -cursor
  • trunk/gui/scripts/numberentry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: NumberEntry - widget for entering numeric values
     
    4848    set _owner $owner
    4949    set _path $path
    50    
     50
    5151    #
    5252    # Figure out what sort of control to create
     
    5858        lappend presets $value $label
    5959    }
    60    
     60
    6161    set class Rappture::Gauge
    6262    set units [string trim [$_owner xml get $path.units]]
     
    6767        }
    6868    }
    69    
     69
    7070    #
    7171    # Create the widget and configure it properly based on other
     
    7777    pack $itk_component(gauge) -expand yes -fill both
    7878    bind $itk_component(gauge) <<Value>> [itcl::code $this _newValue]
    79    
     79
    8080    set min [string trim [$_owner xml get $path.min]]
    81     if {$min ne ""} { 
    82         $itk_component(gauge) configure -minvalue $min 
    83     }
    84    
     81    if {$min ne ""} {
     82        $itk_component(gauge) configure -minvalue $min
     83    }
     84
    8585    set max [string trim [$_owner xml get $path.max]]
    86     if {$max ne ""} { 
    87         $itk_component(gauge) configure -maxvalue $max 
     86    if {$max ne ""} {
     87        $itk_component(gauge) configure -maxvalue $max
    8888    }
    8989
     
    119119    #
    120120    set str [string trim [$_owner xml get $path.default]]
    121     if {$str ne ""} { 
    122         $itk_component(gauge) value $str 
     121    if {$str ne ""} {
     122        $itk_component(gauge) value $str
    123123    }
    124124}
  • trunk/gui/scripts/numberresult.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: numberresult - plot of numbers in a ResultSet
     
    7473    itk_option define -autocolors autoColors AutoColors ""
    7574
    76     constructor {args} { 
    77         # defined below 
    78     }
    79     destructor { 
    80         # defined below 
     75    constructor {args} {
     76        # defined below
     77    }
     78    destructor {
     79        # defined below
    8180    }
    8281    public method add {dataobj {settings ""}}
     
    578577                    set xtitle [$itk_component(plot) xaxis cget -title]
    579578                    set ytitle [$itk_component(plot) yaxis cget -title]
    580                    
     579
    581580                    set desc ""
    582581                    set dataobj [lindex [get] end]
    583                    
     582
    584583                    # the "Simulation" axis shows all values
    585584                    # -- no need for assumptions
     
    602601                        append csvdata "[string repeat - 60]\n"
    603602                    }
    604                    
     603
    605604                    append csvdata "$xtitle, $ytitle\n"
    606605                    foreach xval [lsort -real [array names _xval2label]] {
     
    629628                        # Create the print dialog widget and add it to the
    630629                        # the balloon popup.
    631                         Rappture::XyPrint $inner.print 
     630                        Rappture::XyPrint $inner.print
    632631                        $popup configure \
    633                             -deactivatecommand [list $inner.print reset] 
     632                            -deactivatecommand [list $inner.print reset]
    634633                        blt::table $inner 0,0 $inner.print -fill both
    635634                    }
     
    641640                    set output [$inner.print print $itk_component(plot) \
    642641                                    $toolName $plotName]
    643                     $popup deactivate 
     642                    $popup deactivate
    644643                    return $output
    645644                }
  • trunk/gui/scripts/page.tcl

    r3642 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: page - single page of widgets
     
    2727    private variable _owner ""       ;# thing managing this page
    2828}
    29                                                                                
     29
    3030itk::usual Page {
    3131}
  • trunk/gui/scripts/pager.tcl

    r3642 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: pager - notebook for displaying pages of widgets
     
    5656    public method current {args}
    5757
    58     public method busy { bool } 
     58    public method busy { bool }
    5959
    6060    protected method _layout {}
     
    6868    private variable _current ""     ;# page currently shown
    6969}
    70                                                                                
     70
    7171itk::usual Pager {
    7272}
     
    642642#
    643643#       If true (this indicates a simulation is occurring), the widget
    644 #       should prevent the user from 
    645 #               1) clicking an item previous in the breadcrumbs, and 
     644#       should prevent the user from
     645#               1) clicking an item previous in the breadcrumbs, and
    646646#               2) using the "back" button.
    647647#
    648648itcl::body Rappture::Pager::busy { bool } {
    649649    if { $bool } {
    650         blt::busy hold $itk_component(breadcrumbs) 
     650        blt::busy hold $itk_component(breadcrumbs)
    651651        $itk_component(back) configure -state disabled
    652     } else { 
    653         blt::busy release $itk_component(breadcrumbs) 
     652    } else {
     653        blt::busy release $itk_component(breadcrumbs)
    654654        $itk_component(back) configure -state normal
    655655    }
  • trunk/gui/scripts/panes.tcl

    r5056 r5659  
    121121    }
    122122    if {$itk_option(-orientation) eq "vertical"} {
    123         pack $itk_component(${sash}ridge) -fill x 
     123        pack $itk_component(${sash}ridge) -fill x
    124124        $itk_component($sash) configure -cursor sb_v_double_arrow
    125125        $itk_component(${sash}ridge) configure -cursor sb_v_double_arrow
     
    416416                set y [expr {$y + $sh}]
    417417            }
    418            
     418
    419419            set ph [expr {$h*$f}]
    420420            place $itk_component($p) -y $y -relx 0.5 -anchor n \
     
    455455                set x [expr {$x + $sw}]
    456456            }
    457            
     457
    458458            set pw [expr {$w*$f}]
    459459            place $itk_component($p) -x $x -rely 0.5 -anchor w \
     
    461461            set x [expr {$x + $pw}]
    462462        }
    463     }   
     463    }
    464464}
    465465
  • trunk/gui/scripts/periodicelement.tcl

    r3454 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    3 # ----------------------------------------------------------------------
    4 #  COMPONENT: PeriodicElement - entry widget with a drop-down periodic
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
     2# ----------------------------------------------------------------------
     3#  COMPONENT: PeriodicElement - entry widget with a drop-down periodic
    54#             table.
    65#
     
    5857    private variable _lastValue ""
    5958}
    60                                                                                
     59
    6160itk::usual PeriodicElement {
    6261    keep -cursor -font
     
    160159        after 10 \
    161160            [list catch [list event generate $itk_component(hull) <<Value>>]]
    162     } 
     161    }
    163162    return $name
    164163}
  • trunk/gui/scripts/periodicelemententry.tcl

    r3647 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: PeriodicElementEntry - widget for entering a choice of strings
     
    7070    if { [llength $active] > 0 } {
    7171        $itk_component(element) element active $active
    72     }           
     72    }
    7373    if { $defval != "" } {
    7474        $itk_component(element) value $defval
     
    116116    #
    117117    set how [string trim [$_owner xml get $_path.returnvalue]]
    118     switch -- $how { 
     118    switch -- $how {
    119119        weight - number - name - symbol - all {
    120120            set how "-$how"
  • trunk/gui/scripts/periodictable.tcl

    r3454 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: periodictable - drop-down list of items
     
    4747    private common _colors
    4848    array set _colors {
    49         actinoid-activebackground                       \#cd679a 
    50         actinoid-activeforeground                       white 
    51         actinoid-disabledbackground                     \#ff99cc 
     49        actinoid-activebackground                       \#cd679a
     50        actinoid-activeforeground                       white
     51        actinoid-disabledbackground                     \#ff99cc
    5252        actinoid-disabledforeground                     \#D97DAB
    53         actinoid-background                             \#ff99cc 
    54         actinoid-foreground                             black 
    55         alkali-metal-activebackground                   \#cd3434 
    56         alkali-metal-activeforeground                   white 
    57         alkali-metal-disabledbackground                 \#ff6666 
     53        actinoid-background                             \#ff99cc
     54        actinoid-foreground                             black
     55        alkali-metal-activebackground                   \#cd3434
     56        alkali-metal-activeforeground                   white
     57        alkali-metal-disabledbackground                 \#ff6666
    5858        alkali-metal-disabledforeground                 \#D04747
    59         alkali-metal-background                         \#ff6666 
    60         alkali-metal-foreground                         black 
    61         alkaline-earth-metal-activebackground           \#cdac7b 
    62         alkaline-earth-metal-activeforeground           white 
    63         alkaline-earth-metal-disabledbackground         \#ffdead 
     59        alkali-metal-background                         \#ff6666
     60        alkali-metal-foreground                         black
     61        alkaline-earth-metal-activebackground           \#cdac7b
     62        alkaline-earth-metal-activeforeground           white
     63        alkaline-earth-metal-disabledbackground         \#ffdead
    6464        alkaline-earth-metal-disabledforeground         \#C19A64
    65         alkaline-earth-metal-background                 \#ffdead 
    66         alkaline-earth-metal-foreground                 black 
    67         halogen-activebackground                        \#cdcd67 
    68         halogen-activeforeground                        white 
    69         halogen-disabledbackground                      \#ffff99 
     65        alkaline-earth-metal-background                 \#ffdead
     66        alkaline-earth-metal-foreground                 black
     67        halogen-activebackground                        \#cdcd67
     68        halogen-activeforeground                        white
     69        halogen-disabledbackground                      \#ffff99
    7070        halogen-disabledforeground                      \#D5D562
    71         halogen-background                              \#ffff99 
    72         halogen-foreground                              black 
     71        halogen-background                              \#ffff99
     72        halogen-foreground                              black
    7373        lanthanoid-activebackground                     \#cd8dcd
    7474        lanthanoid-activeforeground                     white
    7575        lanthanoid-disabledbackground                   \#ffbfff
    7676        lanthanoid-disabledforeground                   \#D884D8
    77         lanthanoid-background                           \#ffbfff 
     77        lanthanoid-background                           \#ffbfff
    7878        lanthanoid-foreground                           black
    79         metalloid-activebackground                      \#9a9a67 
    80         metalloid-activeforeground                      white 
    81         metalloid-disabledbackground                    \#cccc99 
     79        metalloid-activebackground                      \#9a9a67
     80        metalloid-activeforeground                      white
     81        metalloid-disabledbackground                    \#cccc99
    8282        metalloid-disabledforeground                    \#92922C
    8383        metalloid-background                            \#cccc99
    84         metalloid-foreground                            black 
    85         noble-gas-activebackground                      \#8ecdcd 
    86         noble-gas-activeforeground                      white 
    87         noble-gas-disabledbackground                    \#c0ffff 
     84        metalloid-foreground                            black
     85        noble-gas-activebackground                      \#8ecdcd
     86        noble-gas-activeforeground                      white
     87        noble-gas-disabledbackground                    \#c0ffff
    8888        noble-gas-disabledforeground                    \#7FC1C1
    89         noble-gas-background                            \#c0ffff 
    90         noble-gas-foreground                            black 
    91         other-non-metal-activebackground                \#6ecd6e 
    92         other-non-metal-activeforeground                white 
    93         other-non-metal-disabledbackground              \#a0ffa0 
     89        noble-gas-background                            \#c0ffff
     90        noble-gas-foreground                            black
     91        other-non-metal-activebackground                \#6ecd6e
     92        other-non-metal-activeforeground                white
     93        other-non-metal-disabledbackground              \#a0ffa0
    9494        other-non-metal-disabledforeground              \#6ACD6A
    95         other-non-metal-background                      \#a0ffa0 
    96         other-non-metal-foreground                      black 
    97         post-transition-metal-activebackground          \#9a9a9a       
    98         post-transition-metal-activeforeground          white 
    99         post-transition-metal-disabledbackground        \#cccccc 
     95        other-non-metal-background                      \#a0ffa0
     96        other-non-metal-foreground                      black
     97        post-transition-metal-activebackground          \#9a9a9a
     98        post-transition-metal-activeforeground          white
     99        post-transition-metal-disabledbackground        \#cccccc
    100100        post-transition-metal-disabledforeground        \#999999
    101         post-transition-metal-background                \#cccccc 
    102         post-transition-metal-foreground                black 
    103         transition-metal-activebackground               \#cd8e8e 
    104         transition-metal-activeforeground               white 
    105         transition-metal-disabledbackground             \#ffc0c0 
     101        post-transition-metal-background                \#cccccc
     102        post-transition-metal-foreground                black
     103        transition-metal-activebackground               \#cd8e8e
     104        transition-metal-activeforeground               white
     105        transition-metal-disabledbackground             \#ffc0c0
    106106        transition-metal-disabledforeground             \#C77E7E
    107         transition-metal-background                     \#ffc0c0 
    108         transition-metal-foreground                     black 
    109         unknown-activebackground                        \#cdcdcd 
    110         unknown-activeforeground                        white 
    111         unknown-disabledbackground                      \#ffffff 
     107        transition-metal-background                     \#ffc0c0
     108        transition-metal-foreground                     black
     109        unknown-activebackground                        \#cdcdcd
     110        unknown-activeforeground                        white
     111        unknown-disabledbackground                      \#ffffff
    112112        unknown-disabledforeground                      \#B9B9B9
    113         unknown-background                              \#ffffff 
    114         unknown-foreground                              black 
     113        unknown-background                              \#ffffff
     114        unknown-foreground                              black
    115115    }
    116116    private common _tableData {
     
    122122        Carbon          6  C  12.011    2 14    other-non-metal
    123123        Nitrogen        7  N  14.007    2 15    other-non-metal
    124         Oxygen          8  O  15.999    2 16    other-non-metal 
     124        Oxygen          8  O  15.999    2 16    other-non-metal
    125125        Fluorine        9  F  18.998    2 17    halogen
    126126        Neon            10 Ne 20.180    2 18    noble-gas
    127        
     127
    128128        Sodium          11 Na 22.990    3 1     alkali-metal
    129129        Magnesium       12 Mg 24.305    3 2     alkaline-earth-metal
    130130        Aluminium       13 Al 26.982    3 13    post-transition-metal
    131131        Silicon         14 Si 28.086    3 14    metalloid
    132         Phosphorus      15 P  30.974    3 15    other-non-metal 
     132        Phosphorus      15 P  30.974    3 15    other-non-metal
    133133        Sulfur          16 S  32.066(6) 3 16    other-non-metal
    134134        Chlorine        17 Cl 35.453    3 17    halogen
    135135        Argon           18 Ar 39.948(1) 3 18    noble-gas
    136        
     136
    137137        Potassium       19 K  39.098    4 1     alkali-metal
    138138        Calcium         20 Ca 40.078(4) 4 2     alkaline-earth-metal
     
    150150        Germanium       32 Ge 72.61(2)  4 14    metalloid
    151151        Arsenic         33 As 74.922    4 15    metalloid
    152         Selenium        34 Se 78.96(3)  4 16    other-non-metal 
     152        Selenium        34 Se 78.96(3)  4 16    other-non-metal
    153153        Bromine         35 Br 79.904(1) 4 17    halogen
    154154        Krypton         36 Kr 83.80(1)  4 18    noble-gas
    155        
     155
    156156        Rubidium        37 Rb 85.468    5 1     alkali-metal
    157157        Strontium       38 Sr 87.62(1)  5 2     alkaline-earth-metal
     
    172172        Iodine          53 I  126.904   5 17    halogen
    173173        Xenon           54 Xe 131.29(2) 5 18    noble-gas
    174        
     174
    175175        Cesium          55 Cs 132.905   6 1     alkali-metal
    176176        Barium          56 Ba 137.327(7) 6 2    alkaline-earth-metal
     
    191191        Astatine        85 At [209.987] 6 17    halogen
    192192        Radon           86 Rn [222.018] 6 18    noble-gas
    193        
     193
    194194        Francium        87 Fr [223.020] 7 1     alkali-metal
    195195        Radium          88 Ra [226.0254] 7 2    alkaline-earth-metal
     
    210210        Ununseptium     117 Uus ? 7 17          unknown
    211211        Ununoctium      118 Uuo [294] 7 18      unknown
    212        
     212
    213213        Lanthanum       57 La 138.905 8 3       lanthanoid
    214214        Cerium          58 Ce 140.116(1) 8 4    lanthanoid
     
    226226        Ytterbium       70 Yb 173.04(3) 8 16    lanthanoid
    227227        Lutetium        71 Lu 174.967(1) 8 17   lanthanoid
    228        
     228
    229229        Actinium        89 Ac [227.027] 9 3     actinoid
    230230        Thorium         90 Th 232.038   9 4     actinoid
     
    253253    array set _types {
    254254        actinoid {
    255             Actinides Actinium Americium Berkelium Californium Curium 
    256             Einsteinium Fermium Mendelevium Neptunium Plutonium Protactinium 
    257             Thorium Uranium Lawrencium Nobelium 
     255            Actinides Actinium Americium Berkelium Californium Curium
     256            Einsteinium Fermium Mendelevium Neptunium Plutonium Protactinium
     257            Thorium Uranium Lawrencium Nobelium
    258258        }
    259259        alkali-metal {
    260             Cesium Francium Lithium Potassium Rubidium Sodium           
     260            Cesium Francium Lithium Potassium Rubidium Sodium
    261261        }
    262262        alkaline-earth-metal {
    263             Barium Beryllium Calcium Magnesium Radium Strontium 
     263            Barium Beryllium Calcium Magnesium Radium Strontium
    264264        }
    265265        halogen {
    266             Astatine Bromine Chlorine Fluorine Iodine           
     266            Astatine Bromine Chlorine Fluorine Iodine
    267267        }
    268268        lanthanoid {
    269             Cerium Erbium Europium Gadolinium Holmium Lanthanides Lanthanum     
    270             Lutetium Neodymium Praseodymium Promethium Samarium Terbium 
    271             Thulium Ytterbium Dysprosium       
     269            Cerium Erbium Europium Gadolinium Holmium Lanthanides Lanthanum
     270            Lutetium Neodymium Praseodymium Promethium Samarium Terbium
     271            Thulium Ytterbium Dysprosium
    272272        }
    273273        metalloid {
    274             Arsenic Boron Germanium Polonium Silicon Tellurium Antimony 
     274            Arsenic Boron Germanium Polonium Silicon Tellurium Antimony
    275275        }
    276276        noble-gas {
    277             Argon Helium Krypton Neon Radon Xenon 
     277            Argon Helium Krypton Neon Radon Xenon
    278278        }
    279279        other-non-metal {
    280             Carbon Hydrogen Nitrogen Sulfur Oxygen Phosphorus Selenium 
     280            Carbon Hydrogen Nitrogen Sulfur Oxygen Phosphorus Selenium
    281281        }
    282282        post-transition-metal {
    283             Aluminium Bismuth Gallium Indium Lead Thallium Tin Ununhexium 
    284             Ununpentium Ununquadium Ununtrium   
     283            Aluminium Bismuth Gallium Indium Lead Thallium Tin Ununhexium
     284            Ununpentium Ununquadium Ununtrium
    285285        }
    286286        transition-metal {
    287             Chromium Cobalt Copper Dubnium Gold Hafnium Hassium Iridium         
    288             Iron Manganese Meitnerium Mercury Molybdenum Nickel Niobium         
    289             Osmium Palladium Rhenium Rhodium Roentgenium Ruthenium 
    290             Rutherfordium Scandium Seaborgium Silver Tantalum Technetium 
    291             Titanium Tungsten Ununbium Vanadium Yttrium Zinc Zirconium 
    292             Bohrium Cadmium Darmstadtium Platinum       
     287            Chromium Cobalt Copper Dubnium Gold Hafnium Hassium Iridium
     288            Iron Manganese Meitnerium Mercury Molybdenum Nickel Niobium
     289            Osmium Palladium Rhenium Rhodium Roentgenium Ruthenium
     290            Rutherfordium Scandium Seaborgium Silver Tantalum Technetium
     291            Titanium Tungsten Ununbium Vanadium Yttrium Zinc Zirconium
     292            Bohrium Cadmium Darmstadtium Platinum
    293293        }
    294294        unknown {
    295             Ununoctium 
    296             Ununseptium 
    297         }
    298     }
    299 }
    300    
     295            Ununoctium
     296            Ununseptium
     297        }
     298    }
     299}
     300
    301301itk::usual PeriodicTable {
    302     keep -background -outline -cursor 
     302    keep -background -outline -cursor
    303303}
    304304
     
    346346    set btags [linsert $btags [expr {$i+1}] RappturePeriodicTable-$this]
    347347    bindtags $itk_component(table) $btags
    348    
     348
    349349    eval itk_initialize $args
    350350    Redraw
     
    352352
    353353#
    354 # active <list of elements> 
    355 #
    356 #       Enables zero or more elements in the periodic table so that 
     354# active <list of elements>
     355#
     356#       Enables zero or more elements in the periodic table so that
    357357#       they can be selected.  All elements are first disabled.  Each
    358358#       argument can one of the following forms:
    359359#       1. element name.
    360 #       2. element symbol. 
     360#       2. element symbol.
    361361#       3. element number.
    362 #       4. type of element.  The argument is expanded into all 
     362#       4. type of element.  The argument is expanded into all
    363363#          elements of that type.
    364364#
    365365itcl::body Rappture::PeriodicTable::active { list } {
    366366    set c $itk_component(table)
    367     foreach elem [array names _table] { 
     367    foreach elem [array names _table] {
    368368        set _state($elem) "disabled"
    369369        $c bind $elem <Enter> {}
     
    396396
    397397#
    398 # inactive <list of elements> 
    399 #
    400 #       Disables zero or more elements in the periodic table so that 
     398# inactive <list of elements>
     399#
     400#       Disables zero or more elements in the periodic table so that
    401401#       they can't be selected.  All elements are first enabled.  Each
    402402#       argument can one of the following forms:
    403403#       1. element name.
    404 #       2. element symbol. 
     404#       2. element symbol.
    405405#       3. element number.
    406 #       4. type of element.  The argument is expanded into all 
     406#       4. type of element.  The argument is expanded into all
    407407#          elements of that type.
    408408#
    409409itcl::body Rappture::PeriodicTable::inactive { list } {
    410410    set c $itk_component(table)
    411     foreach elem [array names _table] { 
     411    foreach elem [array names _table] {
    412412        set _state($elem) "normal"
    413413        $c bind $elem <Enter> \
     
    469469    set elem [FindElement $name]
    470470    if { $elem == "" || $_state($elem) == "disabled" } {
    471         if { $elem != "" } {
    472             puts stderr "element $elem is disabled"
    473         }
     471        if { $elem != "" } {
     472            puts stderr "element $elem is disabled"
     473        }
    474474        return ""
    475475    }
     
    481481        -weight { set value $info(weight) }
    482482        -number { set value $info(number) }
    483         -all { 
    484             foreach key { symbol name number weight } { 
    485                 lappend value $key $info($key) 
     483        -all {
     484            foreach key { symbol name number weight } {
     485                lappend value $key $info($key)
    486486            }
    487487        }
     
    491491
    492492# ----------------------------------------------------------------------
    493 # USAGE: select <name> 
     493# USAGE: select <name>
    494494#
    495495# Used to manipulate the selection in the table.
     
    513513# ----------------------------------------------------------------------
    514514itcl::body Rappture::PeriodicTable::FindElement { what } {
    515     foreach name [array names _table] { 
     515    foreach name [array names _table] {
    516516        array unset info
    517517        array set info $_table($name)
    518         if { $what eq $info(name) || $what eq $info(number) || 
     518        if { $what eq $info(name) || $what eq $info(number) ||
    519519             $what eq $info(symbol) } {
    520             return $info(name)
     520            return $info(name)
    521521        }
    522522    }
     
    624624            set fg $_colors($type-disabledforeground)
    625625            set bg $_colors($type-disabledbackground)
    626         } else { 
     626        } else {
    627627            set fg $_colors($type-foreground)
    628628            set bg $_colors($type-background)
     
    640640        }
    641641        $c create rectangle $x1 $y1 $x2 $y2 -outline "" -fill "" \
    642             -tags $info(name) 
     642            -tags $info(name)
    643643        if { $_state($name) == "normal" } {
    644644        $c bind $info(name) <Enter> \
  • trunk/gui/scripts/postern.tcl

    r3454 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: postern - a back door for debugging
  • trunk/gui/scripts/progress.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: progress - progress meter for long-running apps
  • trunk/gui/scripts/pushbutton.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    4 
    5 
    63#  COMPONENT: PushButton - widget for entering a choice of strings
    74#
     
    3229    itk_option define -offbackground offBackground OffBackground "grey85"
    3330
    34     constructor {args} { 
    35         # defined below 
     31    constructor {args} {
     32        # defined below
    3633    }
    37     destructor { 
    38         # defined below 
     34    destructor {
     35        # defined below
    3936    }
    4037
     
    6360itk::usual PushButton {
    6461    keep -cursor -font
    65     keep -foreground -background 
     62    keep -foreground -background
    6663}
    6764
     
    7168itcl::body Rappture::PushButton::constructor {args} {
    7269    itk_component add button {
    73         label $itk_interior.button -borderwidth 1 -relief sunken 
     70        label $itk_interior.button -borderwidth 1 -relief sunken
    7471    } {
    7572        usual
  • trunk/gui/scripts/radiodial.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Radiodial - selector, like the dial on a car radio
     
    6565    public method current {args}
    6666    public method color {value}
    67                                                                                
     67
    6868    protected method _setCurrent {val}
    6969    protected method _redraw {}
     
    8686    private variable _vwidth 0        ;# width allocated for values
    8787}
    88                                                                                
     88
    8989itk::usual Radiodial {
    9090    keep -background -foreground -cursor -font
     
    250250
    251251        # Don't use expr (?:) because it evaluates the resulting string.
    252         # For example, it changes -0.020 to -0.02. 
     252        # For example, it changes -0.020 to -0.02.
    253253        if { $n >= 0 } {
    254254            set rawval [lindex $_values $n]
  • trunk/gui/scripts/resultselector.tcl

    r4672 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: ResultSelector - controls for a ResultSet
     
    7474    private common _cntlInfo         ;# maps column name => control info
    7575}
    76                                                                                
     76
    7777itk::usual ResultSelector {
    7878    keep -background -foreground -cursor -font
     
    898898        set xmlobj [lindex [$_resultset find $format $tuple] 0]
    899899
    900         if {$xmlobj eq "" && $changed ne ""} {
    901             #
    902             # No data for these settings.  Try leaving the next
    903             # column open, then the next, and so forth, until
    904             # we find some data.
    905             #
    906             # allcols:  foo bar baz qux
    907             #               ^^^changed
    908             #
    909             # search:   baz qux foo
    910             #
    911             set val $_cntlInfo($this-$changed-value)
    912             set allcols [lrange [$_resultset diff names] 2 end]
    913             set i [lsearch -exact $allcols $changed]
    914             set search [concat \
    915                 [lrange $allcols [expr {$i+1}] end] \
    916                 [lrange $allcols 0 [expr {$i-1}]] \
    917             ]
    918             set nsearch [llength $search]
    919 
    920             for {set i 0} {$i < $nsearch} {incr i} {
    921                 set format $changed
    922                 set tuple [list $val]
    923                 for {set j [expr {$i+1}]} {$j < $nsearch} {incr j} {
    924                     set col [lindex $search $j]
    925                     lappend format $col
    926                     lappend tuple $_cntlInfo($this-$col-value)
    927                 }
    928                 set xmlobj [lindex [$_resultset find $format $tuple] 0]
    929                 if {$xmlobj ne ""} {
    930                     break
    931                 }
    932             }
    933         }
     900        if {$xmlobj eq "" && $changed ne ""} {
     901            #
     902            # No data for these settings.  Try leaving the next
     903            # column open, then the next, and so forth, until
     904            # we find some data.
     905            #
     906            # allcols:  foo bar baz qux
     907            #               ^^^changed
     908            #
     909            # search:   baz qux foo
     910            #
     911            set val $_cntlInfo($this-$changed-value)
     912            set allcols [lrange [$_resultset diff names] 2 end]
     913            set i [lsearch -exact $allcols $changed]
     914            set search [concat \
     915                [lrange $allcols [expr {$i+1}] end] \
     916                [lrange $allcols 0 [expr {$i-1}]] \
     917            ]
     918            set nsearch [llength $search]
     919
     920            for {set i 0} {$i < $nsearch} {incr i} {
     921                set format $changed
     922                set tuple [list $val]
     923                for {set j [expr {$i+1}]} {$j < $nsearch} {incr j} {
     924                    set col [lindex $search $j]
     925                    lappend format $col
     926                    lappend tuple $_cntlInfo($this-$col-value)
     927                }
     928                set xmlobj [lindex [$_resultset find $format $tuple] 0]
     929                if {$xmlobj ne ""} {
     930                    break
     931                }
     932            }
     933        }
    934934    }
    935935
  • trunk/gui/scripts/resultset.tcl

    r3770 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: ResultSet - set of XML objects for simulated results
     
    4040    private variable _notify         ;# info used for notify command
    4141}
    42                                                                                
     42
    4343# ----------------------------------------------------------------------
    4444# CONSTRUCTOR
  • trunk/gui/scripts/resultviewer.tcl

    r4261 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: ResultViewer - plots a collection of related results
     
    2525    itk_option define -simulatecommand simulateCommand SimulateCommand ""
    2626
    27     constructor {args} { 
    28         # defined below
    29     }
    30     destructor { 
    31         # defined below
     27    constructor {args} {
     28        # defined below
     29    }
     30    destructor {
     31        # defined below
    3232    }
    3333    public method add {index xmlobj path}
     
    320320                }
    321321                default {
    322                     set mode [$dataobj viewer]
     322                    set mode [$dataobj viewer]
    323323                    if {![info exists _mode2widget($mode)]} {
    324324                        set w $itk_interior.$mode
  • trunk/gui/scripts/scroller.tcl

    r3642 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: scroller - adds scrollbars to any standard Tk widget
  • trunk/gui/scripts/sequence.tcl

    r3662 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: sequence - represents a sequence of output results
     
    188187    # FIXME:  This is a bandaid on what appears to be a timing problem.
    189188    # This "dataobjs" method is now called before any sequence frames
    190     # have been added. 
     189    # have been added.
    191190    if { ![info exists _dataobjs($i)] } {
    192         return ""
     191        return ""
    193192    }
    194193
     
    207206    # FIXME:  This is a bandaid on what appears to be a timing problem.
    208207    # This "label" method is now called before any sequence frames
    209     # have been added. 
     208    # have been added.
    210209    if { ![info exists _labels($i)] } {
    211         return ""
     210        return ""
    212211    }
    213212
  • trunk/gui/scripts/sequencedial.tcl

    r3656 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Sequencedial - selector, like the dial on a car radio
     
    6565    public method current {args}
    6666    public method color {value}
    67                                                                                
     67
    6868    protected method _setCurrent {val}
    6969    protected method _redraw {}
     
    7676    protected method _doInteract {}
    7777
    78     private method EventuallyRedraw {} 
     78    private method EventuallyRedraw {}
    7979    private variable _redrawPending 0
    8080    private variable _afterId -1
     
    8989    private variable _vwidth 0        ;# width allocated for values
    9090}
    91                                                                                
     91
    9292itk::usual SequenceDial {
    9393    keep -background -foreground -cursor -font
     
    155155itcl::body Rappture::SequenceDial::EventuallyRedraw {} {
    156156    if { !$_redrawPending } {
    157         set _afterId [after 150 [itcl::code $this _redraw]]
    158         event generate $itk_component(hull) <<Value>>
     157        set _afterId [after 150 [itcl::code $this _redraw]]
     158        event generate $itk_component(hull) <<Value>>
    159159        set _resizePending 1
    160160    }
     
    258258
    259259        # Don't use expr (?:) because it evaluates the resulting string.
    260         # For example, it changes -0.020 to -0.02. 
     260        # For example, it changes -0.020 to -0.02.
    261261        if { $n >= 0 } {
    262262            set rawval [lindex $_values $n]
     
    266266        _setCurrent $rawval
    267267
    268         EventuallyRedraw
     268        EventuallyRedraw
    269269        event generate $itk_component(hull) <<Value>>
    270270
  • trunk/gui/scripts/sequenceresult.tcl

    r4170 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: sequenceresult - series of results forming an animation
     
    2928    inherit itk::Widget
    3029
    31     constructor {args} { 
    32         # defined below 
    33     }
    34     destructor { 
    35         # defined below 
     30    constructor {args} {
     31        # defined below
     32    }
     33    destructor {
     34        # defined below
    3635    }
    3736    public method add {dataobj {settings ""}}
     
    3938    public method delete {args}
    4039    public method scale {args}
    41     public method parameters {title args} { 
    42         # do nothing 
     40    public method parameters {title args} {
     41        # do nothing
    4342    }
    4443    public method download {option args}
     
    365364        -command [itcl::code $this pause -user]
    366365
    367     global readyForNextFrame 
     366    global readyForNextFrame
    368367    set readyForNextFrame 1;            # By default, always ready
    369368    # Schedule the first frame
     
    387386        set _afterId ""
    388387    }
    389     global readyForNextFrame 
     388    global readyForNextFrame
    390389    set readyForNextFrame 1;            # By default, always ready
    391                                        
     390
    392391    # Check if the play button still exists. We may be in the process
    393392    # of destroying the widget.
     
    492491                    }
    493492                }
    494                 set mode [$dataobj viewer]
     493                set mode [$dataobj viewer]
    495494                Rappture::FieldResult $w -mode $mode
    496495                pack $w -expand yes -fill both
     
    518517    #
    519518    $itk_component(indexLabel) configure -text [$_topmost hints indexlabel]
    520    
     519
    521520    $w delete
    522521    $itk_component(dial) clear
     
    546545# ----------------------------------------------------------------------
    547546itcl::body Rappture::SequenceResult::_playFrame {} {
    548     global readyForNextFrame 
     547    global readyForNextFrame
    549548    if { $readyForNextFrame } {
    550549        set _pos [expr {$_pos+1}]
    551550        set last [expr {[llength $_indices]-1}]
    552        
     551
    553552        if {$_pos > $last} {
    554553            if {$_play(loop)} {
  • trunk/gui/scripts/service.tcl

    r3513 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: service - represents a tool embedded within another tool
     
    100100                      lappend _show($dir) $obj
    101101                      set _obj2path($obj) $spath
    102                      
     102
    103103                      if {$dir == "input"} {
    104104                          puts "link: $tpath => $spath"
  • trunk/gui/scripts/sidebarframe.tcl

    r5028 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: SidebarFrame - pop-out controls for visualization widgets
     
    199199
    200200    #
    201     # Tabs used to select sidebar panels. 
    202     #
    203     # Note:  Bugs in BLT 2.4 tabset/VNC server crashes the server 
     201    # Tabs used to select sidebar panels.
     202    #
     203    # Note:  Bugs in BLT 2.4 tabset/VNC server crashes the server
    204204    #        when -outerpad is set to 0.
    205205    #
     
    593593    set x2 [expr {$w - $sbarw}]
    594594    if { $resizeframe } {
    595         set framew $x1
     595        set framew $x1
    596596    } else {
    597         set framew [expr $w - $ctrlw - $sashw]
     597        set framew [expr $w - $ctrlw - $sashw]
    598598    }
    599599    place $itk_component(frame) -x 0 -y 0 -anchor nw -width $framew -height $h
    600600    place $itk_component(sashbg) -x $x1 -y 0 -anchor nw -width $sashw -height $h
    601601    place $itk_component(sidebar) -x $x2 -y 0 -anchor nw \
    602         -width $sbarw -height $h
     602        -width $sbarw -height $h
    603603}
    604604
  • trunk/gui/scripts/spectrum.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: spectrum - maps a range of real values onto a color
     
    4141    private variable _specw0 0      ;# wavelength for minimum
    4242}
    43                                                                                
     43
    4444# ----------------------------------------------------------------------
    4545# CONSTRUCTOR
     
    8080            set val1 [lindex $args 2]
    8181            set color1 [string trimright [lindex $args 3] "nm"]
    82            
     82
    8383            if {"" != $units} {
    8484                set val0 [Rappture::Units::convert $val0 \
  • trunk/gui/scripts/spinint.tcl

    r3654 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: spinint - spinner for integer values
  • trunk/gui/scripts/switch.tcl

    r3642 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: switch - on/off switch
    44#
    5 #  This widget is used to control a (boolean) on/off value. 
     5#  This widget is used to control a (boolean) on/off value.
    66# It is just a wrapper around a button.
    77# ======================================================================
     
    4848    }
    4949    pack $itk_component(button) -side left -expand yes -fill both
    50     eval itk_initialize $args 
     50    eval itk_initialize $args
    5151}
    5252
     
    9090#
    9191#        Use internally to convert the toggled button into the
    92 #        proper boolean format.  Yes, right now it's hardcoded to 
     92#        proper boolean format.  Yes, right now it's hardcoded to
    9393#        yes/no.  But in the future it could be some other text.
    9494#
  • trunk/gui/scripts/table.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: table - extracts data from an XML description of a table
  • trunk/gui/scripts/tempgauge.tcl

    r3642 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: tempgauge - gauge for temperature values
  • trunk/gui/scripts/textentry.tcl

    r4961 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: textentry - general-purpose text entry widget
     
    3838    itk_option define -height height Height 0
    3939
    40     constructor {owner path args} { 
    41         # defined below
     40    constructor {owner path args} {
     41        # defined below
    4242    }
    4343
     
    8888    set icon  [string trim [$_owner xml get $path.about.icon]]
    8989    if {[string length $icon] > 0} {
    90         set _icon [image create photo -data $icon] 
    91     } 
     90        set _icon [image create photo -data $icon]
     91    }
    9292    if {[string length $hints] > 0} {
    9393        itk_component add hints {
     
    104104
    105105    # Trimming for now.  May need a <verbatim> flag to indicate to leave
    106     # the string alone. 
     106    # the string alone.
    107107    set str [string trim [$_owner xml get $path.default]]
    108108    if {"" != $str} {
  • trunk/gui/scripts/textresult.tcl

    r3799 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: TextResult - Log output for ResultSet
     
    2626    inherit itk::Widget
    2727
    28     constructor {args} { 
    29         # defined below 
     28    constructor {args} {
     29        # defined below
    3030    }
    3131    public method add {dataobj {settings ""}}
     
    3333    public method delete {args}
    3434    public method scale {args}
    35     public method parameters {title args} { 
    36         # do nothing 
     35    public method parameters {title args} {
     36        # do nothing
    3737    }
    3838    public method download {option args}
     
    4040    public method select {option args}
    4141    public method find {option}
    42     public method popup {option args} 
     42    public method popup {option args}
    4343
    4444    private variable _dataobj ""  ;# data object currently being displayed
    4545    private variable _raised      ;# maps all data objects => -raise param
    4646}
    47                                                                                
     47
    4848itk::usual TextResult {
    4949    keep -background -foreground -cursor -font
     
    360360        none {
    361361            if { [$itk_component(text) tag ranges "sel"] != "" } {
    362                 selection clear 
     362                selection clear
    363363            }
    364364        }
  • trunk/gui/scripts/tool.tcl

    r4970 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: tool - represents an entire tool
  • trunk/gui/scripts/tooltip.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: tooltip - help information that pops up beneath a widget
  • trunk/gui/scripts/tuples.tcl

    r4248 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: tuples - represents a series of tuples for arbitrary data
     
    3535    private common _counter 0      ;# for auto-generated column names
    3636}
    37                                                                                
     37
    3838# ----------------------------------------------------------------------
    3939# CONSTRUCTOR
     
    177177    # make some room to insert these tuples
    178178    set need [llength $args]
    179     for {set i [expr {$max-1}]} {$i >= $pos} {incr i -1} { 
     179    for {set i [expr {$max-1}]} {$i >= $pos} {incr i -1} {
    180180        set _tuples([expr {$i+$need}]) $_tuples($i)
    181181    }
  • trunk/gui/scripts/tweener.tcl

    r4209 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: tweener - used for animating smooth movements
     
    3737    private variable _afterid ""   ;# pending after event
    3838}
    39                                                                                
     39
    4040# ----------------------------------------------------------------------
    4141# DESTRUCTOR
     
    7474itcl::body Rappture::Tweener::stop {} {
    7575    if {"" != $_afterid} {
    76         after cancel $_afterid
     76        after cancel $_afterid
    7777        set _afterid ""
    7878    }
  • trunk/gui/scripts/unirect2d.tcl

    r5611 r5659  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: unirect2d - represents a uniform rectangular 2-D mesh.
  • trunk/gui/scripts/unirect3d.tcl

    r5611 r5659  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  COMPONENT: unirect3d - represents a uniform rectangular 3-D mesh.
  • trunk/gui/scripts/units.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: units - mechanism for converting numbers with units
  • trunk/gui/scripts/utils.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: utils - miscellaneous utilities
  • trunk/gui/scripts/valueresult.tcl

    r3813 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: ValueResult - Log output for ResultSet
     
    3939    private variable _dobj2desc   ;# maps data object => description
    4040}
    41                                                                                
     41
    4242itk::usual ValueResult {
    4343    keep -background -foreground -cursor -font
  • trunk/gui/scripts/videochooser.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: videochooser - list videos
  • trunk/gui/scripts/videochooserinfo.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: videochooserinfo - video info
  • trunk/gui/scripts/videodial.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Videodial - selector, like the dial on a flow
  • trunk/gui/scripts/videodial1.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Videodial1 - selector, like the dial on a flow
  • trunk/gui/scripts/videodial2.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: Videodial2 - selector, like the dial on a flow
  • trunk/gui/scripts/videodistance.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: videodistance - specify a distance in a video canvas
  • trunk/gui/scripts/videoparticle.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: videoparticle - mark a particle on a video frame
  • trunk/gui/scripts/videopreview.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: videopreview - previewing movies
  • trunk/gui/scripts/videoscreen.tcl

    r3441 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: video - viewing movies
  • trunk/gui/scripts/videospeed.tcl

    r3330 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: spinint - spinner for integer values
  • trunk/gui/scripts/visviewer.tcl

    r5145 r5659  
    11# -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
    32# ----------------------------------------------------------------------
    43#  VisViewer -
  • trunk/gui/scripts/vtkglyphviewer.tcl

    r5511 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: vtkglyphviewer - Vtk 3D glyphs object viewer
     
    5757    public method get {args}
    5858    public method isconnected {}
    59     public method parameters {title args} { 
    60         # do nothing 
     59    public method parameters {title args} {
     60        # do nothing
    6161    }
    6262    public method scale {args}
     
    6868    private method BuildColormap { name }
    6969    private method BuildCutplaneTab {}
    70     private method BuildDownloadPopup { widget command } 
     70    private method BuildDownloadPopup { widget command }
    7171    private method BuildGlyphTab {}
    7272    private method DrawLegend {}
     
    7777    private method DoResize {}
    7878    private method DoRotate {}
    79     private method EnterLegend { x y } 
    80     private method EventuallyResize { w h } 
    81     private method EventuallyRotate { q } 
    82     private method EventuallyRequestLegend {} 
    83     private method EventuallySetCutplane { axis args } 
    84     private method GetImage { args } 
    85     private method GetVtkData { args } 
     79    private method EnterLegend { x y }
     80    private method EventuallyResize { w h }
     81    private method EventuallyRotate { q }
     82    private method EventuallyRequestLegend {}
     83    private method EventuallySetCutplane { axis args }
     84    private method GetImage { args }
     85    private method GetVtkData { args }
    8686    private method InitSettings { args  }
    87     private method IsValidObject { dataobj } 
     87    private method IsValidObject { dataobj }
    8888    private method LeaveLegend {}
    89     private method MotionLegend { x y } 
     89    private method MotionLegend { x y }
    9090    private method Pan {option x y}
    9191    private method PanCamera {}
    9292    private method Pick {x y}
    93     private method QuaternionToView { q } { 
     93    private method QuaternionToView { q } {
    9494        foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
    9595    }
     
    101101    private method Rotate {option x y}
    102102    private method SetLegendTip { x y }
    103     private method SetObjectStyle { dataobj comp } 
    104     private method Slice {option args} 
     103    private method SetObjectStyle { dataobj comp }
     104    private method Slice {option args}
    105105    private method SetCurrentColormap { color }
    106106    private method SetOrientation { side }
    107     private method ViewToQuaternion {} { 
     107    private method ViewToQuaternion {} {
    108108        return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
    109109    }
     
    114114    private variable _dlist ""     ;    # list of data objects
    115115    private variable _obj2ovride   ;    # maps dataobj => style override
    116     private variable _datasets     ;    # contains all the dataobj-component 
     116    private variable _datasets     ;    # contains all the dataobj-component
    117117                                   ;    # datasets in the server
    118118    private variable _colormaps    ;    # contains all the colormaps
     
    143143    private variable _field      ""
    144144    private variable _colorMode "vmag"; #  Mode of colormap (vmag or scalar)
    145     private variable _fieldNames {} 
    146     private variable _fields 
     145    private variable _fieldNames {}
     146    private variable _fields
    147147    private variable _curFldName ""
    148148    private variable _curFldLabel ""
     
    265265    itk_component add fieldmenu {
    266266        menu $itk_component(plotarea).menu -bg black -fg white -relief flat \
    267             -tearoff no 
     267            -tearoff no
    268268    } {
    269269        usual
     
    285285
    286286    set _map(id) [$c create image 0 0 -anchor nw -image $_image(plot)]
    287     set _map(cwidth) -1 
    288     set _map(cheight) -1 
     287    set _map(cwidth) -1
     288    set _map(cheight) -1
    289289    set _map(zoom) 1.0
    290290    set _map(original) ""
     
    333333            -offimage [Rappture::icon volume-off] \
    334334            -variable [itcl::scope _settings(-glyphvisible)] \
    335             -command [itcl::code $this AdjustSetting -glyphvisible] 
     335            -command [itcl::code $this AdjustSetting -glyphvisible]
    336336    }
    337337    $itk_component(glyphs) select
     
    346346            -offimage [Rappture::icon cutbutton] \
    347347            -variable [itcl::scope _settings(-cutplanevisible)] \
    348             -command [itcl::code $this AdjustSetting -cutplanevisible] 
     348            -command [itcl::code $this AdjustSetting -cutplanevisible]
    349349    }
    350350    Rappture::Tooltip::for $itk_component(cutplane) \
     
    365365    set _image(legend) [image create photo]
    366366    itk_component add legend {
    367         canvas $itk_component(plotarea).legend -width 50 -highlightthickness 0 
     367        canvas $itk_component(plotarea).legend -width 50 -highlightthickness 0
    368368    } {
    369369        usual
     
    372372    }
    373373
    374     # Hack around the Tk panewindow.  The problem is that the requested 
     374    # Hack around the Tk panewindow.  The problem is that the requested
    375375    # size of the 3d view isn't set until an image is retrieved from
    376376    # the server.  So the panewindow uses the tiny size.
     
    378378    pack forget $itk_component(view)
    379379    blt::table $itk_component(plotarea) \
    380         0,0 $itk_component(view) -fill both -reqwidth $w 
     380        0,0 $itk_component(view) -fill both -reqwidth $w
    381381    blt::table configure $itk_component(plotarea) c1 -resize none
    382382
     
    436436    eval itk_initialize $args
    437437
    438     EnableWaitDialog 900 
     438    EnableWaitDialog 900
    439439    Connect
    440440}
     
    465465
    466466itcl::body Rappture::VtkGlyphViewer::DoRotate {} {
    467     SendCmd "camera orient [ViewToQuaternion]" 
     467    SendCmd "camera orient [ViewToQuaternion]"
    468468    set _rotatePending 0
    469469}
     
    492492    if { !$_rotatePending } {
    493493        set _rotatePending 1
    494         global rotate_delay 
     494        global rotate_delay
    495495        $_dispatcher event -after $rotate_delay !rotate
    496496    }
     
    598598                    continue
    599599                }
    600                 if {[info exists _obj2ovride($dataobj-raise)] && 
     600                if {[info exists _obj2ovride($dataobj-raise)] &&
    601601                    $_obj2ovride($dataobj-raise)} {
    602602                    set dlist [linsert $dlist 0 $dataobj]
     
    626626            }
    627627            return $dlist
    628         }           
     628        }
    629629        -image {
    630630            if {[llength $args] != 2} {
     
    831831    $_dispatcher cancel !legend
    832832    # disconnected -- no more data sitting on server
    833     array unset _datasets 
    834     array unset _data 
    835     array unset _colormaps 
     833    array unset _datasets
     834    array unset _data
     835    array unset _colormaps
    836836}
    837837
     
    861861        set time [clock seconds]
    862862        set date [clock format $time]
    863         #puts stderr "$date: received image [image width $_image(plot)]x[image height $_image(plot)] image>"       
     863        #puts stderr "$date: received image [image width $_image(plot)]x[image height $_image(plot)] image>"
    864864        if { $_start > 0 } {
    865865            set finish [clock clicks -milliseconds]
     
    933933    # Turn on buffering of commands to the server.  We don't want to
    934934    # be preempted by a server disconnect/reconnect (which automatically
    935     # generates a new call to Rebuild).   
     935    # generates a new call to Rebuild).
    936936    StartBufferingCommands
    937937
     
    970970            if { ![info exists _datasets($tag)] } {
    971971                set bytes [$dataobj vtkdata $comp]
    972                 if 0 { 
     972                if 0 {
    973973                    set f [open "/tmp/glyph.vtk" "w"]
    974974                    fconfigure $f -translation binary -encoding binary
     
    995995            }
    996996            if { [info exists _obj2ovride($dataobj-raise)] } {
    997                 # Setting dataset visible enables outline 
     997                # Setting dataset visible enables outline
    998998                # and glyphs
    999999                SendCmd "dataset visible 1 $tag"
     
    10421042        #-cutplanexposition -cutplaneyposition -cutplanezposition \
    10431043            -cutplanexvisible -cutplaneyvisible -cutplanezvisible \
    1044             -cutplanepreinterp 
     1044            -cutplanepreinterp
    10451045
    10461046        Zoom reset
     
    10781078itcl::body Rappture::VtkGlyphViewer::CurrentDatasets {args} {
    10791079    set flag [lindex $args 0]
    1080     switch -- $flag { 
     1080    switch -- $flag {
    10811081        "-all" {
    10821082            if { [llength $args] > 1 } {
     
    10971097                set dlist [get -visible]
    10981098            }
    1099         }           
     1099        }
    11001100        default {
    11011101            set dlist $args
     
    12161216    foreach tag [CurrentDatasets -visible] {
    12171217        SendCmd "dataset getscalar pixel $x $y $tag"
    1218     } 
     1218    }
    12191219}
    12201220
     
    15141514#
    15151515#    Request a new legend from the server.  The size of the legend
    1516 #    is determined from the height of the canvas. 
     1516#    is determined from the height of the canvas.
    15171517#
    15181518# This should be called when
     
    15281528    set w 12
    15291529    set lineht [font metrics $font -linespace]
    1530     # color ramp height = (canvas height) - (min and max value lines) - 2 
     1530    # color ramp height = (canvas height) - (min and max value lines) - 2
    15311531    set h [expr {$_height - 2 * ($lineht + 2)}]
    15321532
     
    15461546    # If there's a title too, substract one more line
    15471547    if { $title != "" } {
    1548         incr h -$lineht 
     1548        incr h -$lineht
    15491549    }
    15501550    if { $h < 1 } {
     
    16011601        -font "Arial 9"
    16021602
    1603     label $inner.gshape_l -text "Glyph shape" -font "Arial 9" 
     1603    label $inner.gshape_l -text "Glyph shape" -font "Arial 9"
    16041604    itk_component add gshape {
    16051605        Rappture::Combobox $inner.gshape -width 10 -editable no
     
    16211621    bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting -glyphshape]
    16221622
    1623     label $inner.scaleMode_l -text "Scale by" -font "Arial 9" 
     1623    label $inner.scaleMode_l -text "Scale by" -font "Arial 9"
    16241624    itk_component add scaleMode {
    16251625        Rappture::Combobox $inner.scaleMode -width 10 -editable no
     
    16781678        -font "Arial 9"
    16791679
    1680     label $inner.background_l -text "Background" -font "Arial 9" 
     1680    label $inner.background_l -text "Background" -font "Arial 9"
    16811681    itk_component add background {
    16821682        Rappture::Combobox $inner.background -width 10 -editable no
     
    16851685        "black"              "black"            \
    16861686        "white"              "white"            \
    1687         "grey"               "grey"             
     1687        "grey"               "grey"
    16881688
    16891689    $itk_component(background) value $_settings(-background)
     
    17191719
    17201720    itk_component add field_l {
    1721         label $inner.field_l -text "Color By" -font "Arial 9" 
     1721        label $inner.field_l -text "Color By" -font "Arial 9"
    17221722    } {
    17231723        ignore -font
     
    17291729        [itcl::code $this AdjustSetting -field]
    17301730
    1731     label $inner.colormap_l -text "Colormap" -font "Arial 9" 
     1731    label $inner.colormap_l -text "Colormap" -font "Arial 9"
    17321732    itk_component add colormap {
    17331733        Rappture::Combobox $inner.colormap -width 10 -editable no
     
    17861786        -command [itcl::code $this AdjustSetting -axislabels] \
    17871787        -font "Arial 9"
    1788     label $inner.grid_l -text "Grid" -font "Arial 9" 
     1788    label $inner.grid_l -text "Grid" -font "Arial 9"
    17891789    checkbutton $inner.xgrid \
    17901790        -text "X" \
     
    18081808        -font "Arial 9"
    18091809
    1810     label $inner.mode_l -text "Mode" -font "Arial 9" 
     1810    label $inner.mode_l -text "Mode" -font "Arial 9"
    18111811
    18121812    itk_component add axisMode {
     
    18171817        "closest_triad"   "closest" \
    18181818        "furthest_triad"  "farthest" \
    1819         "outer_edges"     "outer"         
     1819        "outer_edges"     "outer"
    18201820    $itk_component(axisMode) value $_settings(-axismode)
    18211821    bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode]
     
    18911891
    18921892    set fg [option get $itk_component(hull) font Font]
    1893    
     1893
    18941894    set inner [$itk_component(main) insert end \
    18951895        -title "Cutplane Settings" \
    1896         -icon [Rappture::icon cutbutton]] 
     1896        -icon [Rappture::icon cutbutton]]
    18971897
    18981898    $inner configure -borderwidth 4
     
    20442044
    20452045#
    2046 #  camera -- 
     2046#  camera --
    20472047#
    20482048itcl::body Rappture::VtkGlyphViewer::camera {option args} {
    2049     switch -- $option { 
     2049    switch -- $option {
    20502050        "show" {
    20512051            puts [array get _view]
     
    20952095
    20962096itcl::body Rappture::VtkGlyphViewer::GetImage { args } {
    2097     if { [image width $_image(download)] > 0 && 
     2097    if { [image width $_image(download)] > 0 &&
    20982098         [image height $_image(download)] > 0 } {
    20992099        set bytes [$_image(download) data -format "jpeg -quality 100"]
     
    21082108        -title "[Rappture::filexfer::label downloadWord] as..."
    21092109    set inner [$popup component inner]
    2110     label $inner.summary -text "" -anchor w 
     2110    label $inner.summary -text "" -anchor w
    21112111    radiobutton $inner.vtk_button -text "VTK data file" \
    21122112        -variable [itcl::scope _downloadPopup(format)] \
    21132113        -font "Arial 9 " \
    2114         -value vtk 
     2114        -value vtk
    21152115    Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file."
    21162116    radiobutton $inner.image_button -text "Image File" \
    21172117        -variable [itcl::scope _downloadPopup(format)] \
    21182118        -font "Arial 9 " \
    2119         -value image 
     2119        -value image
    21202120    Rappture::Tooltip::for $inner.image_button \
    21212121        "Save as digital image."
     
    21382138        2,0 $inner.image_button -anchor w -cspan 2 -padx { 4 0 } \
    21392139        4,1 $inner.cancel -width .9i -fill y \
    2140         4,0 $inner.ok -padx 2 -width .9i -fill y 
     2140        4,0 $inner.ok -padx 2 -width .9i -fill y
    21412141    blt::table configure $inner r3 -height 4
    21422142    blt::table configure $inner r4 -pady 4
     
    23182318    set font "Arial 8"
    23192319    set lineht [font metrics $font -linespace]
    2320    
     2320
    23212321    set ih [image height $_image(legend)]
    23222322    set iy [expr $y - ($lineht + 2)]
     
    23462346    }
    23472347    set color [eval format "\#%02x%02x%02x" $pixel]
    2348     $_image(swatch) put black  -to 0 0 23 23 
    2349     $_image(swatch) put $color -to 1 1 22 22 
     2348    $_image(swatch) put black  -to 0 0 23 23
     2349    $_image(swatch) put $color -to 1 1 22 22
    23502350    .rappturetooltip configure -icon $_image(swatch)
    23512351
     
    23582358        set value 0.0
    23592359    }
    2360     set tx [expr $x + 15] 
     2360    set tx [expr $x + 15]
    23612361    set ty [expr $y - 5]
    23622362    Rappture::Tooltip::text $c [format "$title %g" $value]
    2363     Rappture::Tooltip::tooltip show $c +$tx,+$ty   
     2363    Rappture::Tooltip::tooltip show $c +$tx,+$ty
    23642364}
    23652365
     
    23952395
    23962396#
    2397 # ReceiveLegend -- 
     2397# ReceiveLegend --
    23982398#
    23992399#    Invoked automatically whenever the "legend" command comes in from
     
    24042404    #puts stderr "ReceiveLegend colormap=$colormap title=$title range=$min,$max size=$size"
    24052405    set _title $title
    2406     regsub {\(mag\)} $title "" _title 
     2406    regsub {\(mag\)} $title "" _title
    24072407    if { [IsConnected] } {
    24082408        set bytes [ReceiveBytes $size]
     
    24312431    set font "Arial 8"
    24322432    set lineht [font metrics $font -linespace]
    2433    
     2433
    24342434    if { [string match "component*" $fname] } {
    24352435        set title ""
     
    24482448        $c delete legend
    24492449        return
    2450     } 
     2450    }
    24512451    if { [$c find withtag "legend"] == "" } {
    2452         set y 2 
     2452        set y 2
    24532453        # If there's a legend title, create a text item for the title.
    24542454        $c create text $x $y \
    24552455            -anchor ne \
    24562456            -fill $itk_option(-plotforeground) -tags "title legend" \
    2457             -font $font 
     2457            -font $font
    24582458        if { $title != "" } {
    24592459            incr y $lineht
     
    25202520# ----------------------------------------------------------------------
    25212521itcl::body Rappture::VtkGlyphViewer::Combo {option} {
    2522     set c $itk_component(view) 
     2522    set c $itk_component(view)
    25232523    switch -- $option {
    25242524        post {
     
    25352535        }
    25362536        deactivate {
    2537             $c itemconfigure title -fill $itk_option(-plotforeground) 
     2537            $c itemconfigure title -fill $itk_option(-plotforeground)
    25382538        }
    25392539        invoke {
     
    25532553    # Keep track of the colormaps that we build.
    25542554    if { ![info exists _colormaps($name)] } {
    2555         BuildColormap $name 
     2555        BuildColormap $name
    25562556        set _colormaps($name) 1
    25572557    }
     
    25742574}
    25752575
    2576 itcl::body Rappture::VtkGlyphViewer::SetOrientation { side } { 
     2576itcl::body Rappture::VtkGlyphViewer::SetOrientation { side } {
    25772577    array set positions {
    25782578        front "1 0 0 0"
  • trunk/gui/scripts/vtkmeshviewer.tcl

    r5347 r5659  
    563563                set amax $max
    564564            }
    565             set _limits($axis) [list $amin $amax]           
     565            set _limits($axis) [list $amin $amax]
    566566        }
    567567    }
  • trunk/gui/scripts/xylegend.tcl

    r4938 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: xylegend - X/Y plot legend.
     
    7271    destructor {}
    7372
    74     public method reset { list } 
    75 
    76     private method Add { elem label {flags ""}} 
    77     private method Average {} 
    78     private method BuildPopup { popup } 
     73    public method reset { list }
     74
     75    private method Add { elem label {flags ""}}
     76    private method Average {}
     77    private method BuildPopup { popup }
    7978    private method Check {}
    80     private method Delete { args } 
    81     private method Difference {} 
     79    private method Delete { args }
     80    private method Difference {}
    8281    private method Editor { option args }
    83     private method GetData { elem what } 
    84     private method Hide { args } 
    85     private method Lower { args } 
    86     private method Raise { args } 
    87     private method Recolor {} 
     82    private method GetData { elem what }
     83    private method Hide { args }
     84    private method Lower { args }
     85    private method Raise { args }
     86    private method Recolor {}
    8887    private method PopupMenu { x y }
    89     private method Rename {} 
     88    private method Rename {}
    9089    private method SelectAll {}
    91     private method Show { args } 
    92     private method Toggle { args } 
    93     private method UnmapHidden {} 
    94 }
    95                                                                                
     90    private method Show { args }
     91    private method Toggle { args }
     92    private method UnmapHidden {}
     93}
     94
    9695itk::usual XyLegend {
    97     keep -background -foreground -cursor 
     96    keep -background -foreground -cursor
    9897}
    9998
    10099itk::usual TreeView {
    101     keep -background -foreground -cursor 
     100    keep -background -foreground -cursor
    102101}
    103102
     
    127126            -tree $_tree \
    128127            -font "Arial 9" \
    129             -flat yes -separator / 
     128            -flat yes -separator /
    130129    }
    131130    $itk_component(scrollbars) contents $itk_component(legend)
     
    168167            -activebackground grey90
    169168    }
    170     grid $controls.hide       -column 0 -row 0 -sticky w 
     169    grid $controls.hide       -column 0 -row 0 -sticky w
    171170    grid $controls.show       -column 0 -row 1 -sticky w
    172171    grid $controls.toggle     -column 0 -row 2 -sticky w
     
    387386    }
    388387    if { [llength $delnodes] > 0 } {
    389         eval $_tree delete $delnodes 
     388        eval $_tree delete $delnodes
    390389    }
    391390    $itk_component(legend) selection clearall
     
    395394itcl::body Rappture::XyLegend::Check {} {
    396395    set nodes [$itk_component(legend) curselection]
    397     foreach n { hide show toggle raise lower 
     396    foreach n { hide show toggle raise lower
    398397        rename average difference delete recolor } {
    399398        $itk_component(controls).$n configure -state disabled
     
    467466
    468467    # Step 2. Now for each curve, generate a cubic spline of that curve
    469     #         and interpolate to get the corresponding y-values for each 
     468    #         and interpolate to get the corresponding y-values for each
    470469    #         abscissa.  Normally the abscissa are the same, so we're
    471470    #         interpolation the knots.
     
    482481
    483482        # Sum the interpolated y-coordinate values.
    484         $sum expr "$sum + $ycoords" 
     483        $sum expr "$sum + $ycoords"
    485484    }
    486485    blt::vector destroy $x $y
     
    497496    }
    498497    set labels [lsort -dictionary $labels]
    499     set name "avg$count" 
     498    set name "avg$count"
    500499    set label "Avg. [join $labels ,]"
    501500
     
    524523    set elem1 [$_tree label [lindex $nodes 0]]
    525524    set elem2 [$_tree label [lindex $nodes 1]]
    526     if { [info exists _diffelements($elem1)] && 
     525    if { [info exists _diffelements($elem1)] &&
    527526         [info exists _diffelements($elem2)] } {
    528527        array unset _diffelements;      # Toggle the difference.
    529         return;                         
     528        return;
    530529    }
    531530    array unset _diffelements
     
    536535    $x append [GetData $elem1 -x]
    537536    $y append [GetData $elem1 -y]
    538     $x sort -reverse $y 
     537    $x sort -reverse $y
    539538    $x append [GetData $elem2 -x]
    540539    $y append [GetData $elem2 -y]
     
    558557    foreach node [$_tree children 0] {
    559558        $itk_component(legend) selection set $node
    560     } 
     559    }
    561560}
    562561
     
    589588            set info(text) $label
    590589            set info(x) [expr $l + [winfo rootx $itk_component(legend)]]
    591             set info(y) [expr $r + [winfo rooty $itk_component(legend)]] 
     590            set info(y) [expr $r + [winfo rooty $itk_component(legend)]]
    592591            set info(w) $w
    593592            set info(h) $h
  • trunk/gui/scripts/xyprint.tcl

    r4944 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*-
    2 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    32# ----------------------------------------------------------------------
    43#  COMPONENT: xyprint - Print X-Y plot.
     
    3029    destructor {}
    3130
    32     private variable _graph "";         # Original graph. 
     31    private variable _graph "";         # Original graph.
    3332    private variable _clone "";         # Cloned graph.
    3433    private variable _preview "";       # Preview image.
     
    4140    public method reset {}
    4241
    43     private method CopyOptions { cmd orig clone {exclude {}}} 
     42    private method CopyOptions { cmd orig clone {exclude {}}}
    4443    private method CloneGraph { orig }
    4544
     
    5352    private method GetAxis {}
    5453    private method GetElement { args }
    55     private method RegeneratePreview {} 
    56     private method InitClone {} 
    57     private method Pixels2Inches { pixels } 
    58     private method Inches2Pixels { inches {defValue ""}} 
    59     private method Color2RGB { color } 
    60 
    61     private method ApplyGeneralSettings {} 
    62     private method ApplyLegendSettings {} 
    63     private method ApplyAxisSettings {} 
    64     private method ApplyElementSettings {} 
    65     private method ApplyLayoutSettings {} 
    66     private method InitializeSettings {} 
    67     private method CreateSettings { toolName plotName } 
    68     private method RestoreSettings { toolName plotName } 
    69     private method SaveSettings { toolName plotName } 
     54    private method RegeneratePreview {}
     55    private method InitClone {}
     56    private method Pixels2Inches { pixels }
     57    private method Inches2Pixels { inches {defValue ""}}
     58    private method Color2RGB { color }
     59
     60    private method ApplyGeneralSettings {}
     61    private method ApplyLegendSettings {}
     62    private method ApplyAxisSettings {}
     63    private method ApplyElementSettings {}
     64    private method ApplyLayoutSettings {}
     65    private method InitializeSettings {}
     66    private method CreateSettings { toolName plotName }
     67    private method RestoreSettings { toolName plotName }
     68    private method SaveSettings { toolName plotName }
    7069    private method DestroySettings {}
    71     private method ResetSettings { } 
     70    private method ResetSettings { }
    7271    private method GetOutput {}
    7372    private method SetWaitVariable { state }
    74     private method SetLayoutOption { option } 
    75     private method GetAxisType { axis } 
    76     private method restore { toolName plotName data } 
     73    private method SetLayoutOption { option }
     74    private method GetAxisType { axis }
     75    private method restore { toolName plotName data }
    7776
    7877    # Same dialog may be used for different graphs
     
    8887    $_dispatcher register !rebuild
    8988    $_dispatcher dispatch $this !rebuild "[itcl::code $this Rebuild]; list"
    90    
     89
    9190    set w [winfo pixels . 2.5i]
    9291    set h [winfo pixels . 2i]
     
    127126        0,1 $itk_component(tabs) -fill both -cspan 2 \
    128127        1,2 $itk_component(cancel) -padx 2 -pady 2 -width .9i -fill y \
    129         1,1 $itk_component(ok) -padx 2 -pady 2 -width .9i -fill y 
     128        1,1 $itk_component(ok) -padx 2 -pady 2 -width .9i -fill y
    130129    blt::table $inner \
    131         0,0 $itk_component(preview) -fill both -padx 10 -pady 10 
     130        0,0 $itk_component(preview) -fill both -padx 10 -pady 10
    132131
    133132    #blt::table configure $itk_interior c1 c2 -resize none
     
    167166    CloneGraph $graph
    168167    InitClone
    169     RestoreSettings $toolName $plotName 
     168    RestoreSettings $toolName $plotName
    170169    InitializeSettings
    171170    SetWaitVariable 0
    172171    tkwait variable [itcl::scope _wait($this)]
    173     SaveSettings $toolName $plotName 
     172    SaveSettings $toolName $plotName
    174173    set output ""
    175174    if { $_wait($this) } {
    176175        set output [GetOutput]
    177176    }
    178     DestroySettings 
     177    DestroySettings
    179178    return $output
    180179}
     
    212211        -center yes \
    213212        -width $w -height $h
    214    
     213
    215214    set psdata [$_clone postscript output]
    216215
    217216    if 0 {
    218         set f [open "junk.raw" "w"] 
     217        set f [open "junk.raw" "w"]
    219218        puts -nonewline $f $psdata
    220219        close $f
    221220    }
    222     if { $format == "eps" } { 
     221    if { $format == "eps" } {
    223222        return [list .$format $psdata]
    224223    }
    225224
    226225    set cmd ""
    227     # | eps2eps << $psdata 
     226    # | eps2eps << $psdata
    228227    lappend cmd "|" "/usr/bin/gs" \
    229228        "-q" "-sDEVICE=epswrite" "-sstdout=%stderr" \
     
    231230        "-dDEVICEWIDTH=250000" "-dDEVICEHEIGHT=250000" "-" "<<" "$psdata"
    232231    if { $format == "pdf" } {
    233         # | eps2eps << $psdata | ps2pdf 
     232        # | eps2eps << $psdata | ps2pdf
    234233        lappend cmd "|" "/usr/bin/gs" \
    235234            "-q" "-sDEVICE=pdfwrite" "-sstdout=%stderr" \
     
    243242        close $f
    244243    } err ] != 0 } {
    245         global errorInfo 
     244        global errorInfo
    246245        puts stderr "failed to generate file: $err\n$errorInfo"
    247246        return ""
    248247    }
    249248    if 0 {
    250         set f [open "junk.$format" "w"] 
     249        set f [open "junk.$format" "w"]
    251250        fconfigure $f -translation binary -encoding binary
    252251        puts -nonewline $f $output
     
    320319    # Element component
    321320    foreach elem [$orig element names] {
    322         set oper [$orig element type $elem] 
     321        set oper [$orig element type $elem]
    323322        $_clone $oper create $elem
    324         CopyOptions [list $oper configure $elem] $orig $_clone -data 
     323        CopyOptions [list $oper configure $elem] $orig $_clone -data
    325324        if { [$_clone $oper cget $elem -hide] } {
    326             $_clone $oper configure $elem -label "" 
     325            $_clone $oper configure $elem -label ""
    327326        }
    328327    }
     
    346345
    347346itcl::body Rappture::XyPrint::InitClone {} {
    348    
     347
    349348    $_clone configure -width 3.4i -height 3.4i -background white \
    350349        -borderwidth 0 \
     
    353352        -topmargin 0 \
    354353        -bottommargin 0
    355    
     354
    356355    # Kill the title and create a border around the plot
    357356    $_clone configure \
     
    373372        -hide yes -borderwidth 0 -background white -relief solid \
    374373        -anchor nw -activeborderwidth 0
    375     # 
     374    #
    376375    set _settings($this-axis-ticks-fontfamily) helvetica
    377376    set _settings($this-axis-ticks-fontsize)   10
     
    412411        incr count
    413412        if { [$_clone element cget $elem -linewidth] > 1 } {
    414             $_clone element configure $elem -linewidth 1 -pixels 3 
     413            $_clone element configure $elem -linewidth 1 -pixels 3
    415414        }
    416415    }
    417416    if { $count == 0 } {
    418         # There are no "line" elements in the graph. 
     417        # There are no "line" elements in the graph.
    419418        # Remove the symbol and dashes controls.
    420419        set page $itk_component(legend_page)
    421420        # May have already been forgotten.
    422         catch { 
     421        catch {
    423422            blt::table forget $page.symbol_l
    424423            blt::table forget $page.symbol
    425424            blt::table forget $page.dashes_l
    426             blt::table forget $page.dashes 
     425            blt::table forget $page.dashes
    427426        }
    428427    }
     
    430429
    431430itcl::body Rappture::XyPrint::SetOption { opt } {
    432     set new $_settings($this$opt) 
     431    set new $_settings($this$opt)
    433432    set old [$_clone cget $opt]
    434433    set code [catch [list $_clone configure $opt $new] err]
     
    443442
    444443itcl::body Rappture::XyPrint::SetComponentOption { comp opt } {
    445     set new $_settings($this-$comp$opt) 
     444    set new $_settings($this-$comp$opt)
    446445    set old [$_clone $comp cget $opt]
    447446    set code [catch [list $_clone $comp configure $opt $new] err]
     
    456455
    457456itcl::body Rappture::XyPrint::SetNamedComponentOption { comp name opt } {
    458     set new $_settings($this-$comp$opt) 
     457    set new $_settings($this-$comp$opt)
    459458    set old [$_clone $comp cget $name $opt]
    460459    set code [catch [list $_clone $comp configure $name $opt $new] err]
     
    469468
    470469itcl::body Rappture::XyPrint::RegeneratePreview {} {
    471     update 
     470    update
    472471    set img [image create photo]
    473472    set w [Inches2Pixels $_settings($this-layout-width) 3.4]
     
    483482    set maxheight $rh
    484483    if { $maxwidth > $cw } {
    485         set maxwidth $cw 
     484        set maxwidth $cw
    486485    }
    487486    if { $maxheight > $ch } {
    488         set maxheight $ch 
     487        set maxheight $ch
    489488    }
    490489    set sx [expr double($maxwidth)/$w]
     
    494493    set pw [expr int(round($s * $w))]
    495494    set ph [expr int(round($s * $h))]
    496     $_preview configure -width $pw -height $ph 
     495    $_preview configure -width $pw -height $ph
    497496    blt::winop resample $img $_preview box
    498497    image delete $img
     
    592591itcl::body Rappture::XyPrint::BuildLayoutTab {} {
    593592    itk_component add layout_page {
    594         frame $itk_component(tabs).layout_page 
     593        frame $itk_component(tabs).layout_page
    595594    }
    596595    set page $itk_component(layout_page)
     
    598597        -text "Layout" -padx 2 -pady 2 -window $page -fill both
    599598
    600     label $page.width_l -text "width" 
     599    label $page.width_l -text "width"
    601600    entry $page.width -width 6 \
    602601        -textvariable [itcl::scope _settings($this-layout-width)]
     
    605604        "Set the width (inches) of the output image. Must be a positive number."
    606605
    607     label $page.height_l -text "height" 
     606    label $page.height_l -text "height"
    608607    entry $page.height -width 6 \
    609608        -textvariable [itcl::scope _settings($this-layout-height)]
     
    612611        "Set the height (inches) of the output image. Must be a positive number"
    613612
    614     label $page.margin_l -text "Margins" 
     613    label $page.margin_l -text "Margins"
    615614
    616615    label $page.left_l -text "left"
     
    621620        "Set the size (inches) of the left margin. If zero, the size is automatically determined."
    622621
    623     label $page.right_l -text "right" 
     622    label $page.right_l -text "right"
    624623    entry $page.right -width 6 \
    625624        -textvariable [itcl::scope _settings($this-layout-rightmargin)]
     
    660659        0,2 $page.map -fill both -rspan 7 -padx 2
    661660
    662     blt::table configure $page c0 r* -resize none 
     661    blt::table configure $page c0 r* -resize none
    663662    blt::table configure $page c1 r2 -resize both
    664663}
     
    667666itcl::body Rappture::XyPrint::BuildGeneralTab {} {
    668667    itk_component add graph_page {
    669         frame $itk_component(tabs).graph_page 
     668        frame $itk_component(tabs).graph_page
    670669    }
    671670    set page $itk_component(graph_page)
     
    680679        "eps" "EPS Encapsulated PostScript"  \
    681680        "jpg" "JPEG Joint Photographic Experts Group Format" \
    682         "png" "PNG Portable Network Graphics Format"         
     681        "png" "PNG Portable Network Graphics Format"
    683682
    684683    bind $page.format <<Value>> [itcl::code $this ApplyGeneralSettings]
     
    686685        "Set the format of the image."
    687686
    688     label $page.style_l -text "style" 
     687    label $page.style_l -text "style"
    689688    Rappture::Combobox $page.style -width 20 -editable no
    690689    $page.style choices insert end \
    691690        "ieee" "IEEE Journal"  \
    692         "gekco" "G Klimeck" 
     691        "gekco" "G Klimeck"
    693692    bind $page.style <<Value>> [itcl::code $this ApplyGeneralSettings]
    694693    Rappture::Tooltip::for $page.format \
     
    696695
    697696    checkbutton $page.remember -text "remember settings" \
    698         -variable [itcl::scope _settings($this-general-remember)] 
     697        -variable [itcl::scope _settings($this-general-remember)]
    699698    Rappture::Tooltip::for $page.remember \
    700699        "Remember the settings. They will be override the default settings."
     
    712711        3,1 $page.style -fill x -cspan 2 \
    713712        5,0 $page.remember -cspan 2 -anchor w \
    714         5,2 $page.revert -anchor e 
     713        5,2 $page.revert -anchor e
    715714    blt::table configure $page r* -resize none  -pady { 0 2 }
    716715    blt::table configure $page r4 -resize both
    717716
    718717}
    719    
     718
    720719itcl::body Rappture::XyPrint::ApplyLegendSettings {} {
    721720    set page $itk_component(legend_page)
     
    736735itcl::body Rappture::XyPrint::BuildLegendTab {} {
    737736    itk_component add legend_page {
    738         frame $itk_component(tabs).legend_page 
     737        frame $itk_component(tabs).legend_page
    739738    }
    740739    set page $itk_component(legend_page)
     
    745744        -offvalue 1 -onvalue 0 \
    746745        -variable [itcl::scope _settings($this-legend-hide)]  \
    747         -command [itcl::code $this ApplyLegendSettings] 
     746        -command [itcl::code $this ApplyLegendSettings]
    748747    Rappture::Tooltip::for $page.show \
    749748        "Display the legend."
     
    756755        "bottommargin" "bottom margin"  \
    757756        "topmargin" "top margin"  \
    758         "plotarea" "inside plot" 
     757        "plotarea" "inside plot"
    759758    bind $page.position <<Value>> [itcl::code $this ApplyLegendSettings]
    760759    Rappture::Tooltip::for $page.position \
     
    771770        "c" "center"  \
    772771        "e" "east"  \
    773         "w" "west" 
     772        "w" "west"
    774773    bind $page.anchor <<Value>> [itcl::code $this ApplyLegendSettings]
    775774    Rappture::Tooltip::for $page.anchor \
     
    788787            -orient horizontal -width 12 \
    789788            -command [itcl::code $this GetElement]
    790     } 
     789    }
    791790    Rappture::Tooltip::for $page.slider \
    792791        "Select the current entry."
    793792
    794     label $page.label_l -text "label" 
     793    label $page.label_l -text "label"
    795794    entry $page.label \
    796795        -background white \
     
    800799        "Set the label of the current entry in the legend."
    801800
    802     label $page.color_l -text "color " 
     801    label $page.color_l -text "color "
    803802    Rappture::Combobox $page.color -width 15 -editable no
    804803    $page.color choices insert end \
     
    820819        "#0000ff" "blue1" \
    821820        "#ff0000" "red1" \
    822         "#00ff00" "green1" 
     821        "#00ff00" "green1"
    823822    bind $page.color <<Value>> [itcl::code $this ApplyElementSettings]
    824823    Rappture::Tooltip::for $page.color \
    825824        "Set the color of the current entry."
    826825
    827     label $page.dashes_l -text "line style" 
     826    label $page.dashes_l -text "line style"
    828827    Rappture::Combobox $page.dashes -width 15 -editable no
    829828    $page.dashes choices insert end \
     
    837836        "Set the line style of the current entry."
    838837
    839     label $page.symbol_l -text "symbol" 
     838    label $page.symbol_l -text "symbol"
    840839    Rappture::Combobox $page.symbol -editable no
    841840    $page.symbol choices insert end \
     
    860859        "new*century*schoolbook"  "new century schoolbook" \
    861860        "symbol"  "symbol" \
    862         "times"  "times"         
     861        "times"  "times"
    863862    bind $page.fontfamily <<Value>> [itcl::code $this ApplyLegendSettings]
    864863    Rappture::Tooltip::for $page.fontfamily \
     
    875874        "17" "17" \
    876875        "18" "18" \
    877         "20" "20" 
     876        "20" "20"
    878877    bind  $page.fontsize <<Value>> [itcl::code $this ApplyLegendSettings]
    879878    Rappture::Tooltip::for $page.fontsize \
     
    928927itcl::body Rappture::XyPrint::BuildAxisTab {} {
    929928    itk_component add axis_page {
    930         frame $itk_component(tabs).axis_page 
     929        frame $itk_component(tabs).axis_page
    931930    }
    932931    set page $itk_component(axis_page)
    933932    $itk_component(tabs) insert end "axis" \
    934933        -text "Axis" -padx 2 -pady 2 -window $page -fill both
    935    
    936     label $page.axis_l -text "axis" 
     934
     935    label $page.axis_l -text "axis"
    937936    itk_component add axis_combo {
    938937        Rappture::Combobox $page.axis -width 20 -editable no
    939     } 
     938    }
    940939    bind $itk_component(axis_combo) <<Value>> [itcl::code $this GetAxis]
    941940    Rappture::Tooltip::for $page.axis \
    942941        "Select the current axis."
    943942
    944     label $page.title_l -text "title" 
     943    label $page.title_l -text "title"
    945944    entry $page.title \
    946945        -textvariable [itcl::scope _settings($this-axis-title)]
     
    985984        "Set major ticks outside of the limits for the current axis."
    986985
    987     label $page.plotpad_l -text "pad" 
     986    label $page.plotpad_l -text "pad"
    988987    entry $page.plotpad -width 6 \
    989988        -textvariable [itcl::scope _settings($this-axis-plotpad)]
     
    10121011        "new*century*schoolbook"  "new century schoolbook" \
    10131012        "symbol"  "symbol" \
    1014         "times"  "times"         
     1013        "times"  "times"
    10151014    bind $page.tickfontfamily <<Value>> [itcl::code $this ApplyAxisSettings]
    10161015    Rappture::Tooltip::for $page.tickfontfamily \
     
    10271026        "17" "17" \
    10281027        "18" "18" \
    1029         "20" "20" 
     1028        "20" "20"
    10301029    bind $page.tickfontsize <<Value>> [itcl::code $this ApplyAxisSettings]
    10311030    Rappture::Tooltip::for $page.tickfontsize \
     
    10571056        "new*century*schoolbook"  "new century schoolbook" \
    10581057        "symbol"  "symbol" \
    1059         "times"  "times"         
     1058        "times"  "times"
    10601059    bind $page.titlefontfamily <<Value>> [itcl::code $this ApplyAxisSettings]
    10611060    Rappture::Tooltip::for $page.titlefontfamily \
     
    10721071        "17" "17" \
    10731072        "18" "18" \
    1074         "20" "20" 
     1073        "20" "20"
    10751074    bind $page.titlefontsize <<Value>> [itcl::code $this ApplyAxisSettings]
    10761075    Rappture::Tooltip::for $page.titlefontsize \
     
    11221121        8,1 $page.zero -cspan 2 -anchor w \
    11231122        8,3 $page.plotpad_l -anchor e \
    1124         8,4 $page.plotpad -fill both -cspan 3 
     1123        8,4 $page.plotpad -fill both -cspan 3
    11251124
    11261125    blt::table configure $page  c0 c4 c5 c6 c7 c8 -resize none
     
    11351134    set _settings($this-legend-position)  [$page.position current]
    11361135    set _settings($this-legend-anchor)    [$page.anchor current]
    1137    
     1136
    11381137    foreach option { -hide -position -anchor -borderwidth } {
    11391138        SetComponentOption legend $option
     
    12121211
    12131212itcl::body Rappture::XyPrint::ApplyLayoutSettings {} {
    1214     foreach opt { -width -height -leftmargin -rightmargin -topmargin 
     1213    foreach opt { -width -height -leftmargin -rightmargin -topmargin
    12151214        -bottommargin } {
    12161215        set old [$_clone cget $opt]
     
    12551254
    12561255    set names [$_clone element show]
    1257     $itk_component(element_slider) configure -from 1 -to [llength $names] 
     1256    $itk_component(element_slider) configure -from 1 -to [llength $names]
    12581257    set state [expr  { ([llength $names] < 2) ? "disabled" : "normal" } ]
    12591258    $page.slider configure -state $state
     
    12791278    # Axis settings
    12801279    set page $itk_component(axis_page)
    1281     set names [lsort [$_clone axis names]] 
     1280    set names [lsort [$_clone axis names]]
    12821281    $itk_component(axis_combo) choices delete 0 end
    12831282    foreach axis $names {
     
    13031302    set axis [lindex $axisnames 0]
    13041303    $itk_component(axis_combo) value $axis
    1305     GetAxis 
     1304    GetAxis
    13061305    RegeneratePreview
    13071306}
     
    13161315    if { ![file readable $_settingsFile] } {
    13171316        return;                         # No file or not readable
    1318     } 
     1317    }
    13191318    if { [file exists $_oldSettingsFile] } {
    13201319        file delete $_oldSettingsFile
     
    13471346itcl::body Rappture::XyPrint::ResetSettings {} {
    13481347    set graph $_graph
    1349     DestroySettings 
     1348    DestroySettings
    13501349    set _graph $graph
    13511350    CloneGraph $graph
     
    13811380    # General settings
    13821381    set length [string length "${this}-"]
    1383     append out "    array set settings {\n" 
     1382    append out "    array set settings {\n"
    13841383    foreach item [array names _settings ${this}-*] {
    13851384        set field [string range $item $length end]
     
    13901389        append out "        [list $field] [list $value]\n"
    13911390    }
    1392     append out "    }\n" 
     1391    append out "    }\n"
    13931392    # Legend font
    13941393    lappend legendfont $_settings($this-legend-fontfamily)
     
    14091408
    14101409    # Layout settings
    1411     append out "    preview configure" 
    1412     foreach opt { -width -height -leftmargin -rightmargin -topmargin 
     1410    append out "    preview configure"
     1411    foreach opt { -width -height -leftmargin -rightmargin -topmargin
    14131412        -bottommargin -plotpadx -plotpady } {
    14141413        set value [$_clone cget $opt]
     
    14181417
    14191418    # Legend settings
    1420     append out "    preview legend configure" 
    1421     foreach opt { -position -anchor -borderwidth -hide } { 
     1419    append out "    preview legend configure"
     1420    foreach opt { -position -anchor -borderwidth -hide } {
    14221421        set value [$_clone legend cget $opt]
    14231422        append out " $opt [list $value]"
     
    14351434        append out "        preview element configure $label"
    14361435        if { [$_clone element type $elem] != "bar" } {
    1437             set options { -symbol -color -dashes -label } 
     1436            set options { -symbol -color -dashes -label }
    14381437        } else {
    1439             set options { -color -label } 
    1440         }
    1441         foreach opt $options { 
     1438            set options { -color -label }
     1439        }
     1440        foreach opt $options {
    14421441            set value [$_clone element cget $elem $opt]
    14431442            append out " $opt [list $value]"
     
    14451444        append out "    \}\n"
    14461445    }
    1447    
     1446
    14481447    # Axis settings
    14491448    foreach axis [$_clone axis names] {
     
    14631462        append out "        preview marker configure ${axis}-zero -hide $hide\n"
    14641463        append out "    \}\n"
    1465     }   
    1466 
    1467     append out "    preview grid configure" 
     1464    }
     1465
     1466    append out "    preview grid configure"
    14681467    append out " -hide \"[$_clone grid cget -hide]\""
    14691468    append out " -mapx \"[$_clone grid cget -mapx]\""
  • trunk/gui/scripts/xyresult.tcl

    r4938 r5659  
    1 # -*- mode: tcl; indent-tabs-mode: nil -*- 
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    22# ----------------------------------------------------------------------
    33#  COMPONENT: xyresult - X/Y plot in a ResultSet
     
    8989    private variable _nextElement 0
    9090
    91     constructor {args} { 
    92         # defined below 
    93     }
    94     destructor { 
    95         # defined below 
     91    constructor {args} {
     92        # defined below
     93    }
     94    destructor {
     95        # defined below
    9696    }
    9797    public method add {dataobj {settings ""}}
     
    9999    public method delete {args}
    100100    public method scale {args}
    101     public method parameters {title args} { 
    102         # do nothing 
     101    public method parameters {title args} {
     102        # do nothing
    103103    }
    104104    public method download {option args}
     
    111111    protected method Axis {option args}
    112112    protected method GetAxes {dataobj}
    113     protected method GetLineMarkerOptions { style } 
    114     protected method GetTextMarkerOptions { style } 
     113    protected method GetLineMarkerOptions { style }
     114    protected method GetTextMarkerOptions { style }
    115115    protected method EnterMarker { g name x y text }
    116116    protected method LeaveMarker { g name }
     
    127127    private method SetAxisRangeState { axis }
    128128}
    129                                                                                
     129
    130130itk::usual XyResult {
    131131    keep -background -foreground -cursor -font
     
    173173    itk_component add plot {
    174174        blt::graph $f.plot \
    175             -highlightthickness 0 -plotpadx 0 -plotpady 4 
     175            -highlightthickness 0 -plotpadx 0 -plotpady 4
    176176    } {
    177177        keep -background -foreground -cursor -font
     
    252252#            set _nextColorIndex 0
    253253#        }
    254         set color [lindex $itk_option(-autocolors) $_nextColorIndex]
    255         if { "" == $color} { 
    256             set color black 
     254        set color [lindex $itk_option(-autocolors) $_nextColorIndex]
     255        if { "" == $color} {
     256            set color black
    257257        }
    258258        # Set up for next auto color
     
    275275    }
    276276    set type [$dataobj hints type]
    277    
     277
    278278    set elem ""
    279279    foreach cname [$dataobj components] {
    280280        set tag $dataobj-$cname
    281         set elem $_comp2elem($tag) 
     281        set elem $_comp2elem($tag)
    282282        switch -- $type {
    283283            "bar" {
    284284                $g bar configure $elem -foreground $color -background $color \
    285                     -hide no 
    286             } 
     285                    -hide no
     286            }
    287287            "scatter" {
    288                 $g line configure $elem -color $color -hide no 
     288                $g line configure $elem -color $color -hide no
    289289            }
    290290            default {
    291291                $g line configure $elem -color $color -hide no \
    292                     -linewidth $linewidth 
     292                    -linewidth $linewidth
    293293            }
    294294        }
     
    317317            lappend top $obj
    318318        } else {
    319             lappend bottom $obj 
     319            lappend bottom $obj
    320320        }
    321321    }
     
    349349    # Hide all elements specified by their dataobjs
    350350    foreach elem $elemlist {
    351         $g element configure $elem -hide yes 
    352         set i [lsearch $_viewable $elem] 
     351        $g element configure $elem -hide yes
     352        set i [lsearch $_viewable $elem]
    353353        if { $i >= 0 } {
    354354            set _viewable [lreplace $_viewable $i $i]
     
    368368itcl::body Rappture::XyResult::scale {args} {
    369369    set _dlist $args
    370     BuildGraph $args 
     370    BuildGraph $args
    371371}
    372372
     
    469469                        # Create the print dialog widget and add it to the
    470470                        # balloon popup.
    471                         Rappture::XyPrint $inner.print 
     471                        Rappture::XyPrint $inner.print
    472472                        $popup configure \
    473                             -deactivatecommand [list $inner.print reset] 
     473                            -deactivatecommand [list $inner.print reset]
    474474                        blt::table $inner 0,0 $inner.print -fill both
    475475                    }
     
    481481                    set output [$inner.print print $itk_component(plot) \
    482482                                    $toolName $plotName]
    483                     $popup deactivate 
     483                    $popup deactivate
    484484                    return $output
    485485                }
     
    605605            $g element configure $elem -label $elabel
    606606        }
    607     }       
     607    }
    608608    $itk_component(legend) reset $_viewable
    609609}
     
    635635    set g $itk_component(plot)
    636636    set elem ""
    637  
     637
    638638    # Peek inside of Blt_ZoomStack package to see if we're currently in the
    639639    # middle of a zoom selection.
     
    684684            set x [$g axis transform $mapx $info(x)]
    685685            set y [$g axis transform $mapy $info(y)]
    686                
     686
    687687            if {[info exists _elem2comp($elem)]} {
    688688                foreach {dataobj cname} [split $_elem2comp($elem) -] break
     
    803803            }
    804804        }
    805        
     805
    806806        set ally [$g y2axis use]
    807807        if {[llength $ally] > 0} {
     
    10841084
    10851085itcl::body Rappture::XyResult::LeaveMarker { g name } {
    1086     if { [info exists _markers($name)] } { 
     1086    if { [info exists _markers($name)] } {
    10871087        set id $_markers($name)
    10881088        $g marker delete $id
     
    10951095#
    10961096#       Configures the graph axis with the designated setting using
    1097 #       the currently stored value.  User-configurable axis settings 
     1097#       the currently stored value.  User-configurable axis settings
    10981098#       are stored in the _axisPopup variable or in the widgets. This
    10991099#       routine syncs the graph with that setting.
     
    11681168#
    11691169#       Sets the state of widgets controlling the axis range based
    1170 #       upon whether the automatic or manual setting.  If the 
     1170#       upon whether the automatic or manual setting.  If the
    11711171#       axis is configure to be automatic, the manual setting widgets
    11721172#       are disabled.  And vesa-versa the automatic setting widgets
     
    11791179    if { $_axisPopup(auto) } {
    11801180        foreach {min max} [$g axis limits $axis] break
    1181         $inner.minl configure -state disabled 
    1182         $inner.min configure -state disabled 
    1183         $inner.maxl configure -state disabled 
    1184         $inner.max configure -state disabled 
     1181        $inner.minl configure -state disabled
     1182        $inner.min configure -state disabled
     1183        $inner.maxl configure -state disabled
     1184        $inner.max configure -state disabled
    11851185        $inner.loose configure -state normal
    11861186        $inner.tight configure -state normal
    11871187    } else {
    11881188        foreach {min max} [$g axis limits $axis] break
    1189         $inner.minl configure -state normal 
    1190         $inner.min configure -state normal 
     1189        $inner.minl configure -state normal
     1190        $inner.min configure -state normal
    11911191        set _axisPopup(min) [$g axis cget $axis -min]
    1192         $inner.maxl configure -state normal 
    1193         $inner.max configure -state normal 
     1192        $inner.maxl configure -state normal
     1193        $inner.max configure -state normal
    11941194        set _axisPopup(max) [$g axis cget $axis -max]
    11951195        $inner.loose configure -state disabled
     
    12011201# BuildAxisPopup --
    12021202#
    1203 #       Creates the popup balloon dialog for axes. This routine is 
    1204 #       called only once the first time the user clicks to bring up 
    1205 #       an axis dialog.  It is reused for all other axes. 
     1203#       Creates the popup balloon dialog for axes. This routine is
     1204#       called only once the first time the user clicks to bring up
     1205#       an axis dialog.  It is reused for all other axes.
    12061206#
    12071207itcl::body Rappture::XyResult::BuildAxisPopup { popup } {
     
    12911291        6,2 $inner.tight -anchor w \
    12921292        6,3 $inner.loose -anchor w \
    1293        
     1293
    12941294
    12951295    blt::table configure $inner r2 -pady 4
     
    13011301# ShowAxisPopup --
    13021302#
    1303 #       Displays the axis dialog for an axis.  It initializes the 
     1303#       Displays the axis dialog for an axis.  It initializes the
    13041304#       _axisInfo variables for that axis if necessary.
    13051305#
    13061306itcl::body Rappture::XyResult::ShowAxisPopup { axis } {
    13071307    set g $itk_component(plot)
    1308     set popup $itk_component(hull).axes 
     1308    set popup $itk_component(hull).axes
    13091309
    13101310    if { ![winfo exists $popup] } {
     
    13381338        set amax $_limits(${label}-max)
    13391339    }
    1340     set auto 1 
     1340    set auto 1
    13411341    if { $amin != "" || $amax != "" } {
    13421342        set auto 0
     
    14131413#
    14141414#       Callback routine for the axis format procedure.  It formats the
    1415 #       axis tick label according to the selected format.  This routine 
     1415#       axis tick label according to the selected format.  This routine
    14161416#       is also used to format tooltip values.
    14171417#
    14181418itcl::body Rappture::XyResult::GetFormattedValue { axis g value } {
    1419     if { [$g axis cget $axis -logscale] || 
     1419    if { [$g axis cget $axis -logscale] ||
    14201420         ![info exists _axisPopup($axis-format)] } {
    14211421        set fmt "%.6g"
     
    14351435#       are created, are hidden.  This allows the graph to account
    14361436#       for all datasets, even those not currently being displayed.
    1437 #       
     1437#
    14381438itcl::body Rappture::XyResult::BuildGraph { dlist } {
    14391439    set g $itk_component(plot)
    1440    
     1440
    14411441    foreach label [array names _label2axis] {
    14421442        set axis $_label2axis($label)
     
    14571457    # Beyond that, we must create new axes "x3", "x4", etc.
    14581458    # We do the same for y.
    1459    
     1459
    14601460    set anum(x) 0
    14611461    set anum(y) 0
     
    14701470            set max [$dataobj hints ${axis}max]
    14711471            set tag ${label}-min
    1472             if { $min != "" && ( ![info exists _limits($tag)] || 
     1472            if { $min != "" && ( ![info exists _limits($tag)] ||
    14731473                                   $_limits($tag) > $min ) } {
    14741474                set _limits($tag) $min
    14751475            }
    14761476            set tag ${label}-max
    1477             if { $max != "" && (![info exists _limits($tag)] || 
     1477            if { $max != "" && (![info exists _limits($tag)] ||
    14781478                                  $_limits($tag) < $max) } {
    14791479                set _limits($tag) $max
     
    14951495                    -checklimits no -showticks yes
    14961496                set _label2axis($label) $axisName
    1497                
     1497
    14981498                # If this axis has a description, add it as a tooltip
    14991499                set desc [string trim [$dataobj hints ${axis}desc]]
     
    15011501            }
    15021502        }
    1503     } 
     1503    }
    15041504    # Next, set the axes based on what we've found.
    15051505    foreach label [array names _label2axis] {
    1506         set logscale [info exists _limits(${label}-log)] 
     1506        set logscale [info exists _limits(${label}-log)]
    15071507        set amin ""
    15081508        if { [info exists _limits(${label}-min)] } {
     
    15311531            [list ::Rappture::Tooltip::tooltip cancel]
    15321532    }
    1533    
     1533
    15341534    foreach dataobj $dlist {
    15351535        SetElements $dataobj
     
    15461546#       are created, are hidden.  This allows the graph to account
    15471547#       for all datasets, even those not currently being displayed.
    1548 #       
     1548#
    15491549itcl::body Rappture::XyResult::SetElements { dataobj {settings ""} } {
    15501550    set g $itk_component(plot)
     
    16221622                        -hide yes \
    16231623                        -xerror $xev -yerror $yev
    1624                 } 
    1625                 "scatter" {               
     1624                }
     1625                "scatter" {
    16261626                    $g line create $elem \
    16271627                        -x $xv -y $yv \
     
    16351635                        -hide yes \
    16361636                        -xerror $xev -yerror $yev
    1637                 } 
     1637                }
    16381638                "bar" {
    16391639                    $g bar create $elem \
     
    16501650            $g element configure $_comp2elem($tag) -mapx $mapx -mapy $mapy
    16511651        }
    1652     } 
    1653 }
     1652    }
     1653}
Note: See TracChangeset for help on using the changeset viewer.