Changeset 4938 for trunk


Ignore:
Timestamp:
Jan 18, 2015 12:40:33 PM (6 years ago)
Author:
ldelgass
Message:

merge r4918:4922 from 1.3 branch (recolor)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/gui/scripts/xylegend.tcl

    r3799 r4938  
    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
     
    393396    set nodes [$itk_component(legend) curselection]
    394397    foreach n { hide show toggle raise lower
    395         rename average difference delete } {
     398        rename average difference delete recolor } {
    396399        $itk_component(controls).$n configure -state disabled
    397400    }
     
    411414        }
    412415        1 {
    413             foreach n { hide show toggle rename } {
     416            foreach n { hide show toggle rename recolor } {
    414417                $itk_component(controls).$n configure -state normal
    415418            }
    416419        }
    417420        2 {
    418             foreach n { hide show toggle difference average } {
     421            foreach n { hide show toggle difference average recolor } {
    419422                $itk_component(controls).$n configure -state normal
    420423            }
    421424        }
    422425        default {
    423             foreach n { hide show toggle average } {
     426            foreach n { hide show toggle average recolor } {
    424427                $itk_component(controls).$n configure -state normal
    425428            }
     
    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}
  • trunk/gui/scripts/xyresult.tcl

    r4207 r4938  
    249249    }
    250250    if { $color == "auto" || $color == "autoreset" } {
    251         if { $color == "autoreset" } {
    252             set _nextColorIndex 0
    253         }
     251#        if { $color == "autoreset" } {
     252#            set _nextColorIndex 0
     253#        }
    254254        set color [lindex $itk_option(-autocolors) $_nextColorIndex]
    255255        if { "" == $color} {
     
    10671067        }
    10681068    }
     1069        incr _nextColorIndex
    10691070    if {$_nextColorIndex >= [llength $itk_option(-autocolors)]} {
    10701071        set _nextColorIndex 0
Note: See TracChangeset for help on using the changeset viewer.