This function returns a compound widget used to enter a parameter, and it returns the base ID of the widget. An interactive ENVI Classic session is required to run this function.

Syntax


Result = WIDGET_PARAM(Base [, AUTO_MANAGE={0 | 1}] [, CEIL=value] [, /CM] [, /COMMA] [, DEFAULT=string] [, DT={1 | 2 | 3 | 4 | 5 | 6 | 9 | 12 | 13 | 14 | 15}] [, FIELD=integer] [, FLOOR=value] [, /INCHES] [, /PERCENT] [, PROMPT=string] [, UNDEFINED=value], UVALUE=value [, XSIZE=value])

Arguments


Base

This is the ID of the base widget.

Keywords


AUTO_MANAGE (optional)

Use this keyword to specify how ENVI Classic auto-manages the widget with AUTO_WID_MNG. The keyword value specifies if the widget must have a defined value. Setting this keyword to a value of 1 requires that the widget has either a default value or a value that you enter. Setting this keyword to 0 does not require a value. Do not use this keyword for user-managed widgets.

CEIL (optional)

Use this keyword to specify a maximum value allowed for input numbers.

COMMA (optional)

Set this keyword to format numbers with commas (example: 3,124,000).

CM (optional)

Set this keyword to allow the widget to annotate the entered parameter with “cm”. You cannot use CM with INCHES or PERCENT.

DEFAULT (optional)

Use this keyword to set the default value for the parameter.

DT (optional)

This keyword indicates the IDL data type of the output data. Set the keyword to one of the following integer values:

  • 1: Byte (8 bits)
  • 2: Integer (16 bits)
  • 3: Long integer (32 bits)
  • 4: Floating-point (32 bits)
  • 5: Double-precision floating-point (64 bits)
  • 6: Complex (2x32 bits)
  • 9: Double-precision complex (2x64 bits)
  • 12: Unsigned integer (16 bits)
  • 13: Unsigned long integer (32 bits)
  • 14: Long 64-bit integer
  • 15: Unsigned long 64-bit integer

FIELD (optional)

Use this keyword to specify the number of decimal places to use when formatting numbers. This keyword has no effect unless DT=4 (floating point) or greater.

FLOOR (optional)

Use this keyword to specify a minimum value allowed for input numbers.

INCHES (optional)

Set this keyword to allow the widget to annotate the entered parameter with " " (the inch symbol). You cannot use INCHES with CM or PERCENT.

PERCENT (optional)

Set this keyword to allow the widget to annotate the entered parameter with “%” (the percent symbol). You cannot use PERCENT with CM or INCHES.

PROMPT (optional)

Use this keyword to specify the prompt string to use for the widget.

UNDEFINED (optional)

Use this keyword to specify the value returned when the parameter is undefined. The default returned value is 10-34.

UVALUE

Use this keyword to assign a “user value” to the widget. This value may be of any data type and organization. The user value exists entirely for your convenience. For widgets managed by the ENVI Classic function AUTO_WID_MNG, UVALUE is a tag name in the returned anonymous structure. For user-managed widgets, you can set and use UVALUE however you wish. You must set UVALUE for all compound widgets.

XSIZE (optional)

Use this keyword to specify the width of the widget, in characters.

Widget Event


When the widget is not auto-managed, widget events set event.result to the value of the input parameter. If the parameter is undefined, then the value of the keyword UNDEFINED is returned.

The data type of event.result is always double-precision. You are responsible for casting the return value to the appropriate data type.

Example


Create a simple compound widget for inputting one floating-point parameter. If the parameter is properly entered, then print the result.

PRO ENVI_WIDGET_PARAM_EX
  compile_opt IDL2
  base = widget_auto_base(title='Parameter test')
  we = widget_param(base, dt=4, field=3, floor=0., $
  default=10., uvalue='param', /auto)
  result = auto_wid_mng(base)
  if (result.accept eq 0) then return
  print, 'Parameter value = ', float(result.param)
END

API Version


4.2