>  Docs Center  >  ENVI API  >  ENVI Classic Display  >  WIDGET_EDIT

WIDGET_EDIT

WIDGET_EDIT

This function returns a compound widget used to edit multiple values from lists, and it returns the base ID of the widget. An interactive ENVI Classic session is required to run this function.

Syntax


Result = WIDGET_EDIT(Base [, AUTO_MANAGE={0 | 1}] [, CEIL=value] [, DT={1 | 2 | 3 | 4 | 5 | 6 | 9 | 12 | 13 | 14 | 15}] [, FIELD=integer] [, FLOOR=value] [, /FRAME], LIST=string array [, PROMPT=string] [, SELECT_PROMPT=string], UVALUE=value [, VALS=array] [, XSIZE=value] [, YSIZE=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. CEIL is only valid when the VALS keyword is specified.

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. FIELD is only valid when you specify the keyword VALS.

FLOOR (optional)

Use this keyword to specify a minimum value allowed for input numbers. FLOOR is only valid when you specify the keyword VALS.

FRAME (optional)

Set this keyword to draw a frame around the widget.

LIST

Use this keyword to specify a string array of items to edit. If you specify VAL, then LIST is the tag name associated with each value.

PROMPT (optional)

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

SELECT_PROMPT (optional)

Use this keyword to specify a prompt string associated with the item being edited.

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.

VALS (optional)

Use this keyword to provide an array of values to edit. A string identifier should be associated with each value.

XSIZE (optional)

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

YSIZE (optional)

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

Widget Event


When the widget is not auto-managed, widget events set event.result to the edited list or, if VAL is specified, to the array of edited numbers. Input numbers are always returned as double-precision, regardless of the value of the keyword DT. Widget events occur any time an edit takes place.

Example


Create a simple compound widget for editing multiple values from a list. Print the final edited list.

PRO ENVI_WIDGET_EDIT_EX
  compile_opt IDL2
  base = widget_auto_base(title='Edit test')
  list = ['Item A ', 'Item B ', 'Item C ', 'Item D ']
  vals = [10.0, 20.0, 30.0, 40.0]
  we = widget_edit(base, uvalue='edit', list=list, $
  vals=vals, /auto)
  result = auto_wid_mng(base)
  if (result.accept eq 0) then return
  print, 'New Values', result.edit
END

API Version


3.3



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us