Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Subroutines > AUI > AUI_CONTROL > Control Types

Up/Down Control (INFLD)

Scroll Prev Top Next More

The Up/Down or "Spin" (or "Spinner") control is like a regular numeric edit control, except that it in addition to the normal keyboard method of data entry, there is also a pair of up/down arrows on the right edge which allow the user to increment/decrement the value by a predetermined amount.

ashref_img120

To create an Up/Down control, use the field type ||U along with a numeric type such as #. By default the increment is 1, and the range extends from 0 to 100, with the down arrow increasing the value of the field. You can change the range by specifying a string in the setdef parameter, formatted as follows:

/n1/n2//

or

/n1/n2/n3//

where n1 and n2 are the low and high limits of the range, and n3, if specified, is the increment (the amount of change you get with each arrow/click). Normally, the down arrow increases the value of the field, but if you want to reverse this, reverse the n1 and n2 values in SETDEF so that the high value is first.

If the preloaded value you specify in ENTRY does not fit in the range, it will be changed to the nearest range limit.

Increment values must be positive integers, but the either or both of the range limits may be negative.

Note that the increment value only affect that amount of change when you click on the arrow; it does not prevent numbers that are within the range but not multiples of the increment from being entered. For example, if SETDEF = "/-20/50/10//", the range is from -20 to 50, and the increment is 10. But the user may keyboard in a value such as 13. In that case clicking on the up/down arrows will increment/decrement the field by 10 (i.e. to 3 or 23 in this case).

Up/Down controls revert to the form of a regular edit control when not active.

Note that the Up/Down control is internally separate from the edit control. This is probably of no concern to anyone except that it will show up in a control dump, independent of the associated edit control.

History

2006 September, A-Shell 4.9.967:  Up-Down controls now preserve their Up-Down buttons even when the field is not active. (Previously they reverted to ordinary edit controls when not active.) Note that if you click on one of the Up-Down buttons while the field is not active, it will trigger the click string for the field, but not increment or decrement the field value. (This is deliberate to avoid the possibility that your application may decide not to respond to the click string by enabling the field, thus giving the user the false impression that the field value had actually been updated.) Although this will be a slight annoyance, it is no worse that before (where you had to click the field to activate and display the Up-Down buttons before the field could be changed), and has a somewhat better visual aesthetic.