Changeset 4918 for branches


Ignore:
Timestamp:
Jan 4, 2015, 5:03:11 PM (10 years ago)
Author:
gah
Message:
 
Location:
branches/1.3/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/xylegend.tcl

    r3800 r4918  
    8585    private method Lower { args }
    8686    private method Raise { args }
     87    private method Recolor {}
    8788    private method PopupMenu { x y }
    8889    private method Rename {}
     
    158159        delete ""
    159160        rename ""
     161        recolor ""
    160162    }
    161163    foreach { but icon} $commands {
     
    174176    grid $controls.average    -column 1 -row 1 -sticky w
    175177    grid $controls.rename     -column 1 -row 2 -sticky w
    176     grid $controls.delete     -column 1 -row 3 -sticky w
     178    grid $controls.recolor    -column 1 -row 3 -sticky w
     179    grid $controls.delete     -column 1 -row 4 -sticky w
    177180
    178181    grid columnconfigure $controls 0  -weight 1
     
    613616    }
    614617}
     618
     619itcl::body Rappture::XyLegend::Recolor {} {
     620    set nodes [$itk_component(legend) curselection]
     621    if { $nodes == "" } {
     622        return
     623    }
     624    foreach node $nodes {
     625        set elem [$_tree label $node]
     626        if { $_lastColorIndex == 0 } {
     627            set _lastColorIndex [llength $_autocolors]
     628        }
     629        incr _lastColorIndex -1
     630        set color [lindex $_autocolors $_lastColorIndex]
     631        $_graph element configure $elem -color $color
     632        set im [$itk_component(legend) entry cget $node -icon]
     633        $_graph legend icon $elem $im
     634    }
     635}
  • branches/1.3/gui/scripts/xyresult.tcl

    r4205 r4918  
    250250    if { $color == "auto" || $color == "autoreset" } {
    251251        if { $color == "autoreset" } {
    252             set _nextColorIndex 0
     252puts stderr "autoreset _nextColorIndex=$_nextColorIndex"
     253#            set _nextColorIndex 0
    253254        }
    254255        set color [lindex $itk_option(-autocolors) $_nextColorIndex]
     
    10671068        }
    10681069    }
     1070        incr _nextColorIndex
    10691071    if {$_nextColorIndex >= [llength $itk_option(-autocolors)]} {
    10701072        set _nextColorIndex 0
Note: See TracChangeset for help on using the changeset viewer.