Ignore:
Timestamp:
Feb 19, 2015, 8:33:41 AM (9 years ago)
Author:
dkearney
Message:

adding a -validatecommand to gauge.tcl so people can add their own validation
to the widget

using gauge widgets for the min/max fields in the settings tab of the
isosurface viewer instead of entry widgets so we can take advantage of input
validation and tooltip cues. tied the min/max editor values, that are above and
below the legend colormap, to the min/max gauge widgets so they all change at
the same time and read the same values. I think there is still a problem if the
min equals the max value, the legend will still show the same value above and
below the colormap. there may also be a race condition when first setting the
min and max gauge widget values because validation occurs. if the data's min is
greater than the default max of 1 (not sure where this comes from yet) or if
the data max is less than the default min of 0 (not sure where this comes from
either) then an error will be raised.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/uiuc_vtk_viewers/gui/scripts/gauge.tcl

    r5032 r5033  
    4242    itk_option define -sampleheight sampleHeight SampleHeight 0
    4343    itk_option define -log log Log ""
     44    itk_option define -validatecommand validateCommand ValidateCommand ""
    4445
    4546    constructor {args} { # defined below }
     
    290291        }
    291292
     293        #
     294        # If there's a -validatecommand option, then invoke the code
     295        # now to check the new value.
     296        #
     297        if {[string length $itk_option(-validatecommand)] > 0} {
     298            set cmd "uplevel #0 [list $itk_option(-validatecommand) [list $newval]]"
     299            set result [eval $cmd]
     300        }
     301
    292302        if {$onlycheck} {
    293303            return
Note: See TracChangeset for help on using the changeset viewer.