Ignore:
Timestamp:
Feb 18, 2013, 2:32:14 PM (12 years ago)
Author:
ldelgass
Message:

sync with trunk

Location:
branches/nanovis2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/nanovis2

  • branches/nanovis2/gui/scripts/combobox.tcl

    r1929 r3305  
    1010# ======================================================================
    1111#  AUTHOR:  Michael McLennan, Purdue University
    12 #  Copyright (c) 2004-2005  Purdue Research Foundation
     12#  Copyright (c) 2004-2012  HUBzero Foundation, LLC
    1313#
    1414#  See the file "license.terms" for information on usage and
     
    3636    itk_option define -disabledbackground disabledBackground DisabledBackground ""
    3737    itk_option define -disabledforeground disabledForeground DisabledForeground ""
     38    itk_option define -interactcommand interactCommand InteractCommand ""
    3839
    3940    constructor {args} { # defined below }
     
    152153itcl::body Rappture::Combobox::translate {value {defValue ""}} {
    153154    foreach {val label} [choices get -both] {
    154         if {$label == $value} {
     155        if {$label eq $value} {
    155156            return $val
    156157        }
     
    181182    set raw [$itk_component(entry) get]
    182183    set value [translate $raw "badValue"]
    183     if { $value != "badValue" } {
     184    if { $value ne "badValue" } {
    184185        return $value
    185186    }
     
    218219            if {$itk_option(-editable) && $itk_option(-state) == "normal"} {
    219220                event generate $itk_component(hull) <<Value>>
     221                if {[string length $itk_option(-interactcommand)] > 0} {
     222                    uplevel #0 $itk_option(-interactcommand)
     223                }
    220224            }
    221225        }
     
    262266        }
    263267        select {
    264             set val [$itk_component(ddlist) current -label]
    265             if {"" != $val} {
    266                 value $val
     268            set newval [$itk_component(ddlist) current -label]
     269            set val [$itk_component(entry) get]
     270            if {$newval ne "" && $newval ne $val} {
     271                value $newval
     272                if {[string length $itk_option(-interactcommand)] > 0} {
     273                    uplevel #0 $itk_option(-interactcommand)
     274                }
    267275            }
    268276        }
Note: See TracChangeset for help on using the changeset viewer.