Ignore:
Timestamp:
Mar 27, 2011, 11:32:25 AM (14 years ago)
Author:
mmc
Message:

Added a definition for the "choice" object, along with the "choices" editor
for specifying values.

Numerous fixes to the object system: Cleaned up the palettes for all
objects so they can be used to warn about things like output objects on
the input side. Marked may attributes as "input only" via the new -only
option for attributes. Fixed the label/description checks so that they
occur properly when inherited from the "base" object class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lang/tcl/scripts/objects/number/number.rp

    r2152 r2154  
    1818    help http://rappture.org/wiki/rp_xml_ele_number
    1919
    20     attr default -title "Default Value" -type string:validate=number -path default
     20    attr default -title "Default Value" -type string:validate=number -path default -only input
    2121    attr units -title "Units of Measurement" -type units -path units
    22     attr min -title "Minimum Value" -type string:validate=number -path min
    23     attr max -title "Maximum Value" -type string:validate=number -path max
    24     attr icon -title "Icon" -type image:maxsize=20,rescale=yes -path about.icon
    25     attr color -title "Color" -type color -path color
     22    attr min -title "Minimum Value" -type string:validate=number -path min -only input
     23    attr max -title "Maximum Value" -type string:validate=number -path max -only input
     24    attr icon -title "Icon" -type image:maxsize=20,rescale=yes -path about.icon -only input
     25    attr color -title "Color" -type color -path color -only input
    2626
    2727    check default {
     
    7676               && ![string equal [Rappture::Units::System::for $units] $base]} {
    7777                return [list error "Units for maximum value don't match the expected units for this value"]
     78            }
     79        }
     80    }
     81
     82    check color {
     83        if {$attr(color) ne ""} {
     84            if {$attr(min) eq "" || $attr(max) eq ""} {
     85                return [list warning "The color for this number won't show up unless both minimum and maximum values are set.  The color indicates the current value in the range between the min/max limits."]
    7886            }
    7987        }
Note: See TracChangeset for help on using the changeset viewer.