Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

hiCreateScaleField

hiCreateScaleField(
?name s_fieldName 
[ ?prompt t_prompt ] 
[ ?value x_currentValue ]
[ ?callback g_callback ] 
[ ?isContinuous g_isContinuous ]
[ ?range l_range ]
[ ?defValue x_defaultValue ]
[ ?help g_fieldHelp ] 
[ ?font t_font ] 
[ ?enabled g_enabled ]
[ ?invisible g_invisible ]
[ ?precision x_precision ]
) 
=> r_fieldHandle

Description

Creates a scale field for a form.

A scale field indicates a value from within a range of numerical values and allows the user to input or modify a value from the same range. The field consists of a rectangular region containing a slider indicating the current value. It also includes a label indicating the scale value at any position of the slider.

This field can also have a context menu, that is, a pop-up menu that is displayed when you right-click on the field.

For information on creating tooltips for fields, see Creating Tool Tips for Fields.

Arguments

?name s_fieldName

Handle to this field within a form. To reference it, use:

formHandle->hiFieldSym

?prompt t_prompt

String specifying the prompt for the field. To reference it, use:

formHandle->hiFieldSym->prompt

?value x_currentValue

  

Initial and current value of the scale field which must be within the given range:

formHandle->hiFieldSym->value

?callback g_callback

  

A string, function object, or symbol type callback. Called when the slider is released in a new position or when it moves incrementally along the bar, depending on the value of the g_isContinuous argument. If g_isContinuous is not specified, the callback is executed when the slider is released in the new position.

If the callback is of string type, you can specify one or more SKILL functions or even multiple SKILL statements that should be executed when the value of the field changes.

?isContinuous g_isContinuous

  

t or nil. When g_isContinuous is t, the callback is continuous while the slider is being moved; when g_isContinuous is nil, the callback is executed when the slider is released in the new position. The default value is nil. You can modify g_isContinuous at any time with the following property:

formHandle->hiFieldSym->isContinuous = t|nil

?range l_range

Indicates the upper and lower values the scale field may obtain. The default range is from 0 to 1000, inclusive. To change the range the slider displays, the user may type

form->scalefield->range = newrange

where newrange is a list of two numbers. These numbers can include negative integers.

If the maximum value for the range is not an integer, it is set to 1000. If the minimum value for the range is not an integer or is equal to or greater than the maximum value, it is set to the maximum value minus 1000 (maxValue - 1000).

If the range is changed, currentValue and defaultValue are modified, if necessary, to fall within the new range.

?defValue x_defaultValue

  

Default value of the field (in the correct format). This value is equal to the initial entry in currentValue if defaultValue is not specified. To reference it, use:

formHandle->hiFieldSym->defValue

?help g_fieldHelp

A string or symbol used to reference help. If not specified, s_fieldName is used. This argument is currently not used.

?font t_font

An optional font argument is accepted but is not supported at this time.

?enabled g_enabled

  

Specifies whether the fields in the layout are enabled. The default value is t.

?invisible g_invisible

  

Specifies whether the layout and the fields within are invisible. The default value is nil.

?precision x_precision

  

Integer specifying the number of decimal points to display. The default value of this argument is 2.

Value Returned

r_fieldHandle

Handle to the scale field.

Related Topics

Form and Field Functions

Creating Context Menus for Fields


Return to top
 ⠀
X