set oldvalue " "
proc att_callback { att description bgv decimals name} {
global oldvalue
set newvalue "[ $att getCurrentValue ]"
if {[string compare $oldvalue $newvalue] != 0} {
set buffer [ GuidoExecServer "GetAttributeData" [subst {attribute = "$newvalue"} ]]
set status [ GuidoGetParamBufferValue $buffer status ]
if {$status >= 0} {
set decimal_value [ GuidoGetParamBufferValue $buffer decimals ]
$description setCurrentValue [ GuidoGetParamBufferValue $buffer description ]
$bgv         setCurrentValue [ GuidoGetParamBufferValue $buffer bgv ]
$name        setCurrentValue $newvalue
if {[string compare [ GuidoGetParamBufferValue $buffer has_decimals ] "Y"] == 0} {
$decimals setInputAllowed true
$decimals setCurrentValue $decimal_value
} else {
$decimals setCurrentValue ""
$decimals setInputAllowed false
}
}
}
set oldvalue "[ $att getCurrentValue ]"
}
proc decimalCallbackInitial {} {
global decimals
$decimals setNullAllowed false
}
GuidoForm frm20515 {
-default_buttons
-help_id 362
-label "Edit Attributes"
-layout borderlayout
-tip "20515_TIP_002"
GuidoScrollPane frm20515_11 {
GuidoTable atts {
-position centre
-instances 1 1 10
-interactive true
GuidoComboBox att {
-display_length 13
-format none
-label "Attribute Name"
-max_length BM_MAX_ATT_NAME_LEN
-no_mlt
-null false
-tip "Enter the name of the attribute to edit"
}
GuidoField name {
-display_length 13
-format none
-label "New Name"
-max_length BM_MAX_ATT_NAME_LEN
-tip "Enter a new name for the attribute.  If this field is left blank, the old name will be retained"
-translate lower
}
GuidoField decimals {
-display_length 5
-format integer
-low_bound 0
-high_bound 9
-label Decimals
-max_length 64
-translate none
-action initial {[decimalCallbackInitial]}
}
GuidoField bgv {
-display_length 15
-format none
-label "Background Value"
-input false
-max_length 64
-tip "20515_TIP_004"
-translate none
}
GuidoField description {
-display_length 30
-format none
-legacy_validation
-label "Description / Expression"
-max_length BM_MAX_ATT_DESC_LENGTH
-translate none
}
}
$att setActionCallback focusGained { [ att_callback $att $description $bgv $decimals $name] }
}
}
