;
; Auto Save File For ./spex_controls.pro
;


; DO NOT REMOVE THIS COMMENT: BEGIN HEADER
;
; Put your comments here
;
; $Id: lib_template.pro,v 1.1 1993/04/02 20:07:05 idl Exp $
;
; Copyright (c) 1993, Research Systems, Inc.  All rights reserved.
;	Unauthorized reproduction prohibited.
; (Of course, if you don't work for RSI, remove these lines or
;  modify to suit.)
;+
; NAME:
;	ROUTINE_NAME
;
; PURPOSE:
;	Tell what your routine does here.  I like to start with the words:
;	"This function (or procedure) ..."
;	Try to use the active, present tense.
;
; CATEGORY:
;	Put a category (or categories) here.  For example:
;	Widgets.
;
; CALLING SEQUENCE:
;	Write the calling sequence here. Include only positional parameters
;	(i.e., NO KEYWORDS). For procedures, use the form:
;
;	ROUTINE_NAME, Parameter1, Parameter2, Foobar
;
;	Note that the routine name is ALL CAPS and arguments have Initial
;	Caps.  For functions, use the form:
; 
;	Result = FUNCTION_NAME(Parameter1, Parameter2, Foobar)
;
;	Always use the "Result = " part to begin. This makes it super-obvious
;	to the clueless user that this routine is a function!
;
; INPUTS:
;	Parm1:	Describe the positional input parameters here. Note again
;		that positional parameters are shown with Initial Caps.
;
; OPTIONAL INPUTS:
;	Parm2:	Describe optional inputs here. If you don't have any, just
;		delete this section.
;	
; KEYWORD PARAMETERS:
;	KEY1:	Document keyword parameters like this. Note that the keyword
;		is shown in ALL CAPS!
;
;	KEY2:	Yet another keyword. Try to use the active, present tense
;		when describing your keywords.  For example, if this keyword
;		is just a set or unset flag, say something like:
;		"Set this keyword to use foobar subfloatation. The default
;		 is foobar superfloatation."
;
; OUTPUTS:
;	Describe any outputs here.  For example, "This function returns the
;	foobar superflimpt version of the input array."  This is where you
;	should also document the return value for functions.
;
; OPTIONAL OUTPUTS:
;	Describe optional outputs here.  If the routine doesn't have any, 
;	just delete this section.
;
; COMMON BLOCKS:
;	BLOCK1:	Describe any common blocks here. If there are no COMMON
;		blocks, just delete this entry.
;
; SIDE EFFECTS:
;	Describe "side effects" here.  There aren't any?  Well, just delete
;	this entry.
;
; RESTRICTIONS:
;	Describe any "restrictions" here.  Delete this section if there are
;	no important restrictions.
;
; PROCEDURE:
;	You can describe the foobar superfloatation method being used here.
;	You might not need this section for your routine.
;
; EXAMPLE:
;	Please provide a simple example here. An example from the PICKFILE
;	documentation is shown below.
;
;	Create a PICKFILE widget that lets users select only files with 
;	the extensions 'pro' and 'dat'.  Use the 'Select File to Read' title 
;	and store the name of the selected file in the variable F.  Enter:
;
;		F = PICKFILE(/READ, FILTER = ['pro', 'dat'])
;
; MODIFICATION HISTORY:
; 	Written by:	Your name here, Date.
;	July, 1994	Any additional mods get described here.  Remember to
;			change the stuff above if you add a new keyword or
;			something!
;-


; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END HEADER
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU3
;
; Put your comments here
;


PRO PDMENU3_Event, Event


  CASE Event.Value OF 


  'SPECIAL.SHOW CURRENT OPTIONS': com ='/'
  'SPECIAL.OPTION FILE.READ':     com ='restore'
  'SPECIAL.OPTION FILE.WRITE':    com = 'save'
  'SPECIAL.SHOW DATA FILES ONLINE': com ='online'
  'SPECIAL.PREVIEW DATA FILE': com ='preview'
  'SPECIAL.ANALYSIS SCRIPTS.SHOW': com ='idl,help,name="scr*"'
  'SPECIAL.ANALYSIS SCRIPTS.RUN': com = 'script'
  'SPECIAL.ENTER BATSE ARCHIVE MENU': com = 'batse_menu'
  'SPECIAL.SEND LAST PLOT FILE.TO PRINTER': com = 'hard'
  'SPECIAL.SEND LAST PLOT FILE.TO MAIL': com = 'idl,print,"No mail option yet"'
  ENDCASE
spex_proc, input_line=com, /gui
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU3
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU15
;
; Put your comments here
;


PRO PDMENU15_Event, Event


  CASE Event.Value OF 


  'TIME HISTORY.SHOW CURRENT OPTIONS': com = '/time'
  'TIME HISTORY.PREVIEW DATA FILE': com = 'preview'	;remove this pulldown
  'TIME HISTORY.PLOT LIGHT CURVE (READ).ONE TRACE': com ='time_history'
  'TIME HISTORY.PLOT LIGHT CURVE (READ).MULTI-TRACE': com = 'graph'
  'TIME HISTORY.BACKGROUND.SELECT INTERVALS': com='background'
  'TIME HISTORY.BACKGROUND.DISPLAY INTERVALS': com='backgrond,display'
  'TIME HISTORY.BACKGROUND.CLEAR BACKGROUND': com='background,clear'
  'TIME HISTORY.BACKGROUND.USE CURRENT BACKGROUND': com='background,old'
  'TIME HISTORY.BACKGROUND.SET BACKGROUND TO 0.0': com='idl,rate=flux & need.back=0'
  'TIME HISTORY.SEND LAST PLOT.TO FILE': com='create'
  'TIME HISTORY.SEND LAST PLOT.TO PRINTER': com='hard'
  'TIME HISTORY.SEND LAST PLOT.TO MAIL': com = 'idl,print,"No mail option yet"'
  'TIME HISTORY.FIT INTERVALS.SELECT': com='select'
  'TIME HISTORY.FIT INTERVALS.DISPLAY': com='display' 
  'TIME HISTORY.FIT INTERVALS.CLEAR': com='idl,need.select=1 & ifirst=0 & ilast=0'
  'TIME HISTORY.RESETS.SYSTEM VARIABLES': com='kleanplot'
  'TIME HISTORY.RESETS.UTPLOT DEFAULTS': com='clear'
  'TIME HISTORY.RESETS.DATAFILE': com='reset'
  'TIME HISTORY.ZOOM IN TIME': com='zoom'
  ENDCASE
spex_proc, input_line=com, /gui
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU15
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU16
;
; Put your comments here
;


PRO PDMENU16_Event, Event


  CASE Event.Value OF 


  'SPECTRAL FITS.SHOW CURRENT OPTIONS': com = '/fit'
  'SPECTRAL FITS.SPECTRAL PLOTS.PHOTONS': com = 'photon'
  'SPECTRAL FITS.SPECTRAL PLOTS.COUNTS': com = 'counts'
  'SPECTRAL FITS.SPECTRAL PLOTS.BACKGROUND': com = 'bspectrum'
  'SPECTRAL FITS.SEND LAST PLOT.TO FILE': com = 'create'
  'SPECTRAL FITS.SEND LAST PLOT.TO PRINTER':com = 'hard'
  'SPECTRAL FITS.SEND LAST PLOT.TO MAIL': com = 'idl,print,"No mail option yet"'
  'SPECTRAL FITS.FIT.FIT AND PLOT': com = 'fitting'
  'SPECTRAL FITS.FIT.FIT ONLY': com = 'fitting,fit'
  'SPECTRAL FITS.FIT.PLOT ONLY': com = 'fitting,plot'
  'SPECTRAL FITS.FIT.SELECT ENERGY RANGE': com ='enrange'
  'SPECTRAL FITS.SELECT T. HIST. BANDS': com = 'ch_bands'
  'SPECTRAL FITS.SPEC. PLOT BINNING.SELECT': com = 'spec_bands'
  'SPECTRAL FITS.SPEC. PLOT BINNING.CLEAR': com = 'nospec_bands'
  'SPECTRAL FITS.RESPONSE FUNCTION.SHOW CURRENT OPTIONS': com = '/drm'
  'SPECTRAL FITS.RESPONSE FUNCTION.READ MATRIX FILE': com = 'read_drm'
  'SPECTRAL FITS.RESPONSE FUNCTION.BUILD MATRIX': com = 'build_drm'
  ENDCASE
spex_proc, input_line=com, /gui
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU16
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU17
;
; Put your comments here
;


PRO PDMENU17_Event, Event


  CASE Event.Value OF 


  'SUMMARY.SHOW CURRENT OPTIONS': BEGIN
    PRINT, 'Event for SUMMARY.SHOW CURRENT OPTIONS'
    END
  'SUMMARY.SAVE OPTIONS, INTERVALS, AND FITS': BEGIN
    PRINT, 'Event for SUMMARY.SAVE OPTIONS, INTERVALS, AND FITS'
    END
  'SUMMARY.PLOT FIT PARAMETERS (SEE OPTIONS)': BEGIN
    PRINT, 'Event for SUMMARY.PLOT FIT PARAMETERS (SEE OPTIONS)'
    END
  'SUMMARY.SEND LAST PLOT.TO FILE ': BEGIN
    PRINT, 'Event for SUMMARY.SEND LAST PLOT.TO FILE '
    END
  'SUMMARY.SEND LAST PLOT.TO PRINTER': BEGIN
    PRINT, 'Event for SUMMARY.SEND LAST PLOT.TO PRINTER'
    END
  'SUMMARY.SEND LAST PLOT.TO MAIL': BEGIN
    PRINT, 'Event for SUMMARY.SEND LAST PLOT.TO MAIL'
    END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU17
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU37
;
; Put your comments here
;


PRO PDMENU37_Event, Event


  CASE Event.Value OF 


  'SPECIAL.OPTION FILE': BEGIN
    PRINT, 'Event for SPECIAL.OPTION FILE'
    END
  'SPECIAL.DATA TYPE.BATSE.CONT': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.BATSE.CONT'
    END
  'SPECIAL.DATA TYPE.BATSE.SHER AND SHERB': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.BATSE.SHER AND SHERB'
    END
  'SPECIAL.DATA TYPE.BATSE.HER AND HERB': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.BATSE.HER AND HERB'
    END
  'SPECIAL.DATA TYPE.YOHKOH.HXT': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.YOHKOH.HXT'
    END
  'SPECIAL.DATA TYPE.YOHKOH.HXS': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.YOHKOH.HXS'
    END
  'SPECIAL.DATA TYPE.YOHKOH.GRS': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.YOHKOH.GRS'
    END
  'SPECIAL.DATA TYPE.YOHKOH.SXS': BEGIN
    PRINT, 'Event for SPECIAL.DATA TYPE.YOHKOH.SXS'
    END
  'SPECIAL.DETECTOR #.0': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.0'
    END
  'SPECIAL.DETECTOR #.1': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.1'
    END
  'SPECIAL.DETECTOR #.2': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.2'
    END
  'SPECIAL.DETECTOR #.3': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.3'
    END
  'SPECIAL.DETECTOR #.4': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.4'
    END
  'SPECIAL.DETECTOR #.5': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.5'
    END
  'SPECIAL.DETECTOR #.6': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.6'
    END
  'SPECIAL.DETECTOR #.7': BEGIN
    PRINT, 'Event for SPECIAL.DETECTOR #.7'
    END
  'SPECIAL.EVENT ID.BATSE FLARE #': BEGIN
    PRINT, 'Event for SPECIAL.EVENT ID.BATSE FLARE #'
    END
  'SPECIAL.EVENT ID.BATSE BURST #': BEGIN
    PRINT, 'Event for SPECIAL.EVENT ID.BATSE BURST #'
    END
  'SPECIAL.EVENT ID.TIME': BEGIN
    PRINT, 'Event for SPECIAL.EVENT ID.TIME'
    END
  'SPECIAL.DATA FILE 1': BEGIN
    PRINT, 'Event for SPECIAL.DATA FILE 1'
    END
  'SPECIAL.DATA FILE 2': BEGIN
    PRINT, 'Event for SPECIAL.DATA FILE 2'
    END
  'SPECIAL.DATA DIRECTORY': BEGIN
    PRINT, 'Event for SPECIAL.DATA DIRECTORY'
    END
  'SPECIAL.POSTSCRIPT FORMAT': BEGIN
    PRINT, 'Event for SPECIAL.POSTSCRIPT FORMAT'
    END
  'SPECIAL.QUIET': BEGIN
    PRINT, 'Event for SPECIAL.QUIET'
    END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU37
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU40
;
; Put your comments here
;


PRO PDMENU40_Event, Event


  CASE Event.Value OF 


  'TIME HISTORY.START': BEGIN
    PRINT, 'Event for TIME HISTORY.START'
    END
  'TIME HISTORY.END': BEGIN
    PRINT, 'Event for TIME HISTORY.END'
    END
  'TIME HISTORY.BACK. ENERGY RANGE.FULL RANGE': BEGIN
    PRINT, 'Event for TIME HISTORY.BACK. ENERGY RANGE.FULL RANGE'
    END
  'TIME HISTORY.BACK. ENERGY RANGE.SUB-RANGE': BEGIN
    PRINT, 'Event for TIME HISTORY.BACK. ENERGY RANGE.SUB-RANGE'
    END
  'TIME HISTORY.SAMPLE AVERAGE': BEGIN
    PRINT, 'Event for TIME HISTORY.SAMPLE AVERAGE'
    END
  'TIME HISTORY.ENERGY BANDS (MULTI-TRACE)': BEGIN
    PRINT, 'Event for TIME HISTORY.ENERGY BANDS (MULTI-TRACE)'
    END
  'TIME HISTORY.SCALE FOR BANDS': BEGIN
    PRINT, 'Event for TIME HISTORY.SCALE FOR BANDS'
    END
  'TIME HISTORY.YRANGE': BEGIN
    PRINT, 'Event for TIME HISTORY.YRANGE'
    END
  'TIME HISTORY.Y UNITS.COUNTS/SEC': BEGIN
    PRINT, 'Event for TIME HISTORY.Y UNITS.COUNTS/SEC'
    END
  'TIME HISTORY.Y UNITS.COUNTS/SEC/CM^2/KEV': BEGIN
    PRINT, 'Event for TIME HISTORY.Y UNITS.COUNTS/SEC/CM^2/KEV'
    END
  'TIME HISTORY.BACKGROUND ORDER.0 CONSTANT': BEGIN
    PRINT, 'Event for TIME HISTORY.BACKGROUND ORDER.0 CONSTANT'
    END
  'TIME HISTORY.BACKGROUND ORDER.1 LINEAR': BEGIN
    PRINT, 'Event for TIME HISTORY.BACKGROUND ORDER.1 LINEAR'
    END
  'TIME HISTORY.BACKGROUND ORDER.2 QUADRATIC': BEGIN
    PRINT, 'Event for TIME HISTORY.BACKGROUND ORDER.2 QUADRATIC'
    END
  'TIME HISTORY.YAXIS.LINEAR': BEGIN
    PRINT, 'Event for TIME HISTORY.YAXIS.LINEAR'
    END
  'TIME HISTORY.YAXIS.LOG': BEGIN
    PRINT, 'Event for TIME HISTORY.YAXIS.LOG'
    END
  'TIME HISTORY.Y ERROR BARS.HIDE': BEGIN
    PRINT, 'Event for TIME HISTORY.Y ERROR BARS.HIDE'
    END
  'TIME HISTORY.Y ERROR BARS.SHOW': BEGIN
    PRINT, 'Event for TIME HISTORY.Y ERROR BARS.SHOW'
    END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU40
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU41
;
; Put your comments here
;


PRO PDMENU41_Event, Event


  CASE Event.Value OF 


  'SPECTRAL FITS.FIT PARAMETERS': BEGIN
    PRINT, 'Event for SPECTRAL FITS.FIT PARAMETERS'
    END
  'SPECTRAL FITS.FREE/FIX': BEGIN
    PRINT, 'Event for SPECTRAL FITS.FREE/FIX'
    END
  'SPECTRAL FITS.LOWER BOUNDS': BEGIN
    PRINT, 'Event for SPECTRAL FITS.LOWER BOUNDS'
    END
  'SPECTRAL FITS.UPPER BOUNDS': BEGIN
    PRINT, 'Event for SPECTRAL FITS.UPPER BOUNDS'
    END
  'SPECTRAL FITS.VALID FITTING ENERGIES': BEGIN
    PRINT, 'Event for SPECTRAL FITS.VALID FITTING ENERGIES'
    END
  'SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DEFAULT MATRIX.USE': BEGIN
    PRINT, 'Event for SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DEFAULT MATRIX.USE'
    END
  'SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DEFAULT MATRIX.OTHER': BEGIN
    PRINT, 'Event for SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DEFAULT MATRIX.OTHER'
    END
  'SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DIRECT MATRIX FILE': BEGIN
    PRINT, 'Event for SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DIRECT MATRIX FILE'
    END
  'SPECTRAL FITS.RESPONSE MATRIX OPTIONS.SCATTER MATRIX FILE': BEGIN
    PRINT, 'Event for SPECTRAL FITS.RESPONSE MATRIX OPTIONS.SCATTER MATRIX FILE'
    END
  'SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DIRECTORY': BEGIN
    PRINT, 'Event for SPECTRAL FITS.RESPONSE MATRIX OPTIONS.DIRECTORY'
    END
  'SPECTRAL FITS.RESPONSE MATRIX OPTIONS.BUILD HIGH ENERGY MATRIX': BEGIN
    PRINT, 'Event for SPECTRAL FITS.RESPONSE MATRIX OPTIONS.BUILD HIGH ENERGY MATRIX'
    END
  'SPECTRAL FITS.FIRST INTERVAL #': BEGIN
    PRINT, 'Event for SPECTRAL FITS.FIRST INTERVAL #'
    END
  'SPECTRAL FITS.LAST INTERVAL #': BEGIN
    PRINT, 'Event for SPECTRAL FITS.LAST INTERVAL #'
    END
  'SPECTRAL FITS.MIN. UNCERTAINTY': BEGIN
    PRINT, 'Event for SPECTRAL FITS.MIN. UNCERTAINTY'
    END
  'SPECTRAL FITS.PLOT XRANGE': BEGIN
    PRINT, 'Event for SPECTRAL FITS.PLOT XRANGE'
    END
  'SPECTRAL FITS.PLOT YRANGE': BEGIN
    PRINT, 'Event for SPECTRAL FITS.PLOT YRANGE'
    END
  'SPECTRAL FITS.SOURCE FOR INIT. PARAMS..PREVIOUS INTERVAL': BEGIN
    PRINT, 'Event for SPECTRAL FITS.SOURCE FOR INIT. PARAMS..PREVIOUS INTERVAL'
    END
  'SPECTRAL FITS.SOURCE FOR INIT. PARAMS..LAST FIT TO CURRENT INTERVAL': BEGIN
    PRINT, 'Event for SPECTRAL FITS.SOURCE FOR INIT. PARAMS..LAST FIT TO CURRENT INTERVAL'
    END
  'SPECTRAL FITS.XAXIS TYPE.LOG': BEGIN
    PRINT, 'Event for SPECTRAL FITS.XAXIS TYPE.LOG'
    END
  'SPECTRAL FITS.XAXIS TYPE.LINEAR': BEGIN
    PRINT, 'Event for SPECTRAL FITS.XAXIS TYPE.LINEAR'
    END
  'SPECTRAL FITS.YAXIS TYPE.LOG': BEGIN
    PRINT, 'Event for SPECTRAL FITS.YAXIS TYPE.LOG'
    END
  'SPECTRAL FITS.YAXIS TYPE.LINEAR': BEGIN
    PRINT, 'Event for SPECTRAL FITS.YAXIS TYPE.LINEAR'
    END
  'SPECTRAL FITS.MODEL FUNCTION.THERM + BR. P-LAW': BEGIN
    PRINT, 'Event for SPECTRAL FITS.MODEL FUNCTION.THERM + BR. P-LAW'
    END
  'SPECTRAL FITS.MODEL FUNCTION.2THERM + P-LAW': BEGIN
    PRINT, 'Event for SPECTRAL FITS.MODEL FUNCTION.2THERM + P-LAW'
    END
  'SPECTRAL FITS.MODEL FUNCTION.OTHER': BEGIN
    PRINT, 'Event for SPECTRAL FITS.MODEL FUNCTION.OTHER'
    END
  'SPECTRAL FITS.MORE INFO.SET': BEGIN
    PRINT, 'Event for SPECTRAL FITS.MORE INFO.SET'
    END
  'SPECTRAL FITS.MORE INFO.RESET': BEGIN
    PRINT, 'Event for SPECTRAL FITS.MORE INFO.RESET'
    END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU41
; DO NOT REMOVE THIS COMMENT: BEGIN PDMENU42
;
; Put your comments here
;


PRO PDMENU42_Event, Event


  CASE Event.Value OF 


  'SUMMARY.SUMMARY FILE NAME': BEGIN
    PRINT, 'Event for SUMMARY.SUMMARY FILE NAME'
    END
  'SUMMARY.SUMMARY FILE DIRECTORY': BEGIN
    PRINT, 'Event for SUMMARY.SUMMARY FILE DIRECTORY'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON XAXIS.TIME ': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON XAXIS.TIME '
    END
  'SUMMARY.PARAMETERS TO PLOT.ON XAXIS.PARAMETER #': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON XAXIS.PARAMETER #'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON XAXIS.CHISQUARE': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON XAXIS.CHISQUARE'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON XAXIS.SHOW ERRORS': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON XAXIS.SHOW ERRORS'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON XAXIS.HIDE ERRORS': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON XAXIS.HIDE ERRORS'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON YAXIS.PARAMETER #': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON YAXIS.PARAMETER #'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON YAXIS.CHISQUARE': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON YAXIS.CHISQUARE'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON YAXIS.SHOW ERRORS': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON YAXIS.SHOW ERRORS'
    END
  'SUMMARY.PARAMETERS TO PLOT.ON YAXIS.HIDE ERRORS': BEGIN
    PRINT, 'Event for SUMMARY.PARAMETERS TO PLOT.ON YAXIS.HIDE ERRORS'
    END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END PDMENU42
; DO NOT REMOVE THIS COMMENT: BEGIN MAIN2
;
; Put your comments here
;


PRO MAIN2_Event, Event


  WIDGET_CONTROL,Event.Id,GET_UVALUE=Ev

  CASE Ev OF 

  'BGROUP73': BEGIN
      IF Event.Select THEN Sel = 'On' ELSE Sel = 'Off'
      CASE Event.Value OF
      0: Print,'Button OVERVIEW Turned ', Sel
      1: Print,'Button DISPLAY SPEX COMMENTS Turned ', Sel
      ELSE: Message,'Unknown button pressed'
      ENDCASE
      END
  'BGROUP77': BEGIN
      IF Event.Select THEN Sel = 'On' ELSE Sel = 'Off'
      CASE Event.Value OF
      0: Print,'Button HELP ON ACTION BUTTON Turned ', Sel
      1: Print,'Button HELP ON OPTION BUTTON Turned ', Sel
      ELSE: Message,'Unknown button pressed'
      ENDCASE
      END
  ; Event for SPECIAL ACTIONS
  'SPECIAL_ACTION': PDMENU3_Event, Event
  ; Event for TIME HISTORY 
  'TIME HISTORY': PDMENU15_Event, Event
  ; Event for SPECTRAL FITS
  'SPECTRAL FITS': PDMENU16_Event, Event
  ; Event for SUMMARY
  'SUMMARY': PDMENU17_Event, Event
  ; Event for SPECIAL OPTIONS
  'SPECIAL_OPTIONS': PDMENU37_Event, Event
  ; Event for THIST_PAR
  'THIST_PAR': PDMENU40_Event, Event
  ; Event for SPEC_FITS
  'SPEC_FITS': PDMENU41_Event, Event
  ; Event for SUMMARY_OPT
  'SUMMARY_OPT': PDMENU42_Event, Event
  'FIELD111':   spex_proc, input_line=event.value, /gui
  'TEXTDISPLAY': BEGIN
      Print, 'Event for TEXTDISPLAY'
      END
  'exit_group': BEGIN
      CASE Event.Value OF
      0: widget_control, event.top, /destroy
      1: Print,'Button   SPEX    Pressed'
      2: Print,'Button     IDL      Pressed'
      ELSE: Message,'Unknown button pressed'
      ENDCASE
      END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END MAIN2
; DO NOT REMOVE THIS COMMENT: BEGIN DEP150
;
; Put your comments here
;


PRO DEP150_Event, Event


  WIDGET_CONTROL,Event.Id,GET_UVALUE=Ev

  CASE Ev OF 

  'MOD_BUTTONS': BEGIN
      CASE Event.Value OF
      0: Print,'Button DONE Pressed'
      1: Print,'Button QUIT Pressed'
      ELSE: Message,'Unknown button pressed'
      ENDCASE
      END
  'OPTION_NAME': BEGIN
      Print, 'Event for OPTION_NAME'
      END
  'FIELD162': BEGIN
      Print, 'Event for SPEX VARIABLE'
      END
  'OPTION_NAME': BEGIN
      Print, 'Event for OPTION_NAME'
      END
  'SCALAR_OPTION': BEGIN
      Print, 'Event for SCALAR_OPTION'
      END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END DEP150
; DO NOT REMOVE THIS COMMENT: BEGIN DEP112
;
; Put your comments here
;


PRO DEP112_Event, Event


  WIDGET_CONTROL,Event.Id,GET_UVALUE=Ev

  CASE Ev OF 

  'MOD_BUTTONS': BEGIN
      CASE Event.Value OF
      0: Print,'Button DONE Pressed'
      1: Print,'Button QUIT Pressed'
      ELSE: Message,'Unknown button pressed'
      ENDCASE
      END
  'OPTION_NAME': BEGIN
      Print, 'Event for OPTION_NAME'
      END
  'FIELD147': BEGIN
      Print, 'Event for SPEX VARIABLE'
      END
  'OPTION_NAME': BEGIN
      Print, 'Event for OPTION_NAME'
      END
  'FIELD114': BEGIN
      Print, 'Event for 0.'
      END
  'FIELD115': BEGIN
      Print, 'Event for 1.'
      END
  'FIELD116': BEGIN
      Print, 'Event for 2.'
      END
  'FIELD117': BEGIN
      Print, 'Event for 3.'
      END
  'FIELD118': BEGIN
      Print, 'Event for 4.'
      END
  'FIELD123': BEGIN
      Print, 'Event for 5.'
      END
  'FIELD124': BEGIN
      Print, 'Event for 6.'
      END
  'FIELD125': BEGIN
      Print, 'Event for 7.'
      END
  'FIELD126': BEGIN
      Print, 'Event for 8.'
      END
  'FIELD127': BEGIN
      Print, 'Event for 9.'
      END
  'FIELD128': BEGIN
      Print, 'Event for 10.'
      END
  'FIELD132': BEGIN
      Print, 'Event for 11.'
      END
  'FIELD133': BEGIN
      Print, 'Event for 12.'
      END
  'FIELD134': BEGIN
      Print, 'Event for 13.'
      END
  'FIELD135': BEGIN
      Print, 'Event for 14.'
      END
  ENDCASE
END

; Code after this line may be destroyed
; DO NOT REMOVE THIS COMMENT: END DEP112


PRO spex_controls, GROUP=Group


  IF N_ELEMENTS(Group) EQ 0 THEN GROUP=0

  junk   = { CW_PDMENU_S, flags:0, name:'' }


  MAIN2 = WIDGET_BASE(GROUP_LEADER=Group, $
      COLUMN=1, $
      MAP=1, $
      TITLE='SPEX CONTROL PANEL', $
      UVALUE='MAIN2')

  BASE70 = WIDGET_BASE(MAIN2, $
      ROW=1, $
      FRAME=1, $
      MAP=1, $
      TITLE='HELP', $
      UVALUE='BASE70')

  LABEL80 = WIDGET_LABEL( BASE70, $
      FONT='-adobe-itc avant garde gothic-book-r-normal--24-240-75-75-p-138-iso8859-1', $
      UVALUE='HELP:', $
      VALUE='HELP:')

  Btns674 = [ $
    'OVERVIEW', $
    'DISPLAY SPEX COMMENTS' ]
  BGROUP73 = CW_BGROUP( BASE70, Btns674, $
      NONEXCLUSIVE=1, $
      LABEL_TOP='GENERAL', $
      UVALUE='BGROUP73')

  Btns676 = [ $
    'HELP ON ACTION BUTTON', $
    'HELP ON OPTION BUTTON' ]
  BGROUP77 = CW_BGROUP( BASE70, Btns676, $
      COLUMN=1, $
      NONEXCLUSIVE=1, $
      LABEL_TOP='SPECIFIC', $
      UVALUE='BGROUP77')


  BASE2 = WIDGET_BASE(MAIN2, $
      ROW=1, $
      MAP=1, $
      TITLE='ACTIONS', $
      UVALUE='BASE2')

  LABEL186 = WIDGET_LABEL( BASE2, $
      UVALUE='LABEL186', $
      VALUE='ACTIONS:')

  MenuDesc680 = [ $
      { CW_PDMENU_S,       3, 'SPECIAL' }, $ ;        0
        { CW_PDMENU_S,       0, 'SHOW CURRENT OPTIONS' }, $ ;        1
        { CW_PDMENU_S,       1, 'OPTION FILE' }, $ ;        2
          { CW_PDMENU_S,       0, 'READ' }, $ ;        3
          { CW_PDMENU_S,       2, 'WRITE' }, $ ;        4
      { CW_PDMENU_S,       0, 'SHOW DATA FILES ONLINE' }, $ ;        5
      { CW_PDMENU_S,       0, 'PREVIEW DATA FILE' }, $ ;        6
      { CW_PDMENU_S,       1, 'ANALYSIS SCRIPTS' }, $ ;        7
        { CW_PDMENU_S,       0, 'SHOW' }, $ ;        8
        { CW_PDMENU_S,       2, 'RUN' }, $ ;        9
      { CW_PDMENU_S,       0, 'ENTER BATSE ARCHIVE MENU' }, $ ;       10
      { CW_PDMENU_S,       3, 'SEND LAST PLOT FILE' }, $ ;       11
        { CW_PDMENU_S,       0, 'TO PRINTER' }, $ ;       12
        { CW_PDMENU_S,       2, 'TO MAIL' } $  ;     13
  ]


  PDMENU3 = CW_PDMENU( BASE2, MenuDesc680, /RETURN_FULL_NAME, $
      UVALUE='SPECIAL_ACTION')

  MenuDesc685 = [ $
      { CW_PDMENU_S,       3, 'TIME HISTORY' }, $ ;        0
        { CW_PDMENU_S,       0, 'SHOW CURRENT OPTIONS' }, $ ;        1
        { CW_PDMENU_S,       0, 'PREVIEW DATA FILE' }, $ ;        2
        { CW_PDMENU_S,       1, 'PLOT LIGHT CURVE (READ)' }, $ ;        3
          { CW_PDMENU_S,       0, 'ONE TRACE' }, $ ;        4
          { CW_PDMENU_S,       2, 'MULTI-TRACE' }, $ ;        5
      { CW_PDMENU_S,       1, 'BACKGROUND' }, $ ;        6
        { CW_PDMENU_S,       0, 'SELECT INTERVALS' }, $ ;        7
        { CW_PDMENU_S,       0, 'DISPLAY INTERVALS' }, $ ;        8
        { CW_PDMENU_S,       0, 'CLEAR BACKGROUND' }, $ ;        9
        { CW_PDMENU_S,       0, 'USE CURRENT BACKGROUND' }, $ ;       10
        { CW_PDMENU_S,       2, 'SET BACKGROUND TO 0.0' }, $ ;       11
      { CW_PDMENU_S,       1, 'SEND LAST PLOT' }, $ ;       12
        { CW_PDMENU_S,       0, 'TO FILE' }, $ ;       13
        { CW_PDMENU_S,       0, 'TO PRINTER' }, $ ;       14
        { CW_PDMENU_S,       2, 'TO MAIL' }, $ ;       15
      { CW_PDMENU_S,       1, 'FIT INTERVALS' }, $ ;       16
        { CW_PDMENU_S,       0, 'SELECT' }, $ ;       17
        { CW_PDMENU_S,       0, 'DISPLAY' }, $ ;       18
        { CW_PDMENU_S,       2, 'CLEAR' }, $ ;       19
      { CW_PDMENU_S,       1, 'RESETS' }, $ ;       20
        { CW_PDMENU_S,       0, 'SYSTEM VARIABLES' }, $ ;       21
        { CW_PDMENU_S,       0, 'UTPLOT DEFAULTS' }, $ ;       22
        { CW_PDMENU_S,       2, 'DATAFILE' }, $ ;       23
      { CW_PDMENU_S,       2, 'ZOOM IN TIME' } $  ;     24
  ]


  PDMENU15 = CW_PDMENU( BASE2, MenuDesc685, /RETURN_FULL_NAME, $
      UVALUE='TIME HISTORY')

  MenuDesc692 = [ $
      { CW_PDMENU_S,       3, 'SPECTRAL FITS' }, $ ;        0
        { CW_PDMENU_S,       0, 'SHOW CURRENT OPTIONS' }, $ ;        1
        { CW_PDMENU_S,       1, 'SPECTRAL PLOTS' }, $ ;        2
          { CW_PDMENU_S,       0, 'PHOTONS' }, $ ;        3
          { CW_PDMENU_S,       0, 'COUNTS' }, $ ;        4
          { CW_PDMENU_S,       2, 'BACKGROUND' }, $ ;        5
      { CW_PDMENU_S,       1, 'SEND LAST PLOT' }, $ ;        6
        { CW_PDMENU_S,       0, 'TO FILE' }, $ ;        7
        { CW_PDMENU_S,       0, 'TO PRINTER' }, $ ;        8
        { CW_PDMENU_S,       2, 'TO MAIL' }, $ ;        9
      { CW_PDMENU_S,       1, 'FIT' }, $ ;       10
        { CW_PDMENU_S,       0, 'FIT AND PLOT' }, $ ;       11
        { CW_PDMENU_S,       0, 'FIT ONLY' }, $ ;       12
        { CW_PDMENU_S,       0, 'PLOT ONLY' }, $ ;       13
        { CW_PDMENU_S,       2, 'SELECT ENERGY RANGE' }, $ ;       14
      { CW_PDMENU_S,       0, 'SELECT T. HIST. BANDS' }, $ ;       15
      { CW_PDMENU_S,       1, 'SPEC. PLOT BINNING' }, $ ;       16
        { CW_PDMENU_S,       0, 'SELECT' }, $ ;       17
        { CW_PDMENU_S,       2, 'CLEAR' }, $ ;       18
      { CW_PDMENU_S,       3, 'RESPONSE FUNCTION' }, $ ;       19
        { CW_PDMENU_S,       0, 'SHOW CURRENT OPTIONS' }, $ ;       20
        { CW_PDMENU_S,       0, 'READ MATRIX FILE' }, $ ;       21
        { CW_PDMENU_S,       2, 'BUILD MATRIX' } $  ;     22
  ]


  PDMENU16 = CW_PDMENU( BASE2, MenuDesc692, /RETURN_FULL_NAME, $
      UVALUE='SPECTRAL FITS')

  MenuDesc699 = [ $
      { CW_PDMENU_S,       3, 'SUMMARY' }, $ ;        0
        { CW_PDMENU_S,       0, 'SHOW CURRENT OPTIONS' }, $ ;        1
        { CW_PDMENU_S,       0, 'SAVE OPTIONS, INTERVALS, AND FITS' }, $ ;        2
        { CW_PDMENU_S,       0, 'PLOT FIT PARAMETERS (SEE OPTIONS)' }, $ ;        3
        { CW_PDMENU_S,       3, 'SEND LAST PLOT' }, $ ;        4
          { CW_PDMENU_S,       0, 'TO FILE ' }, $ ;        5
          { CW_PDMENU_S,       0, 'TO PRINTER' }, $ ;        6
          { CW_PDMENU_S,       2, 'TO MAIL' } $  ;      7
  ]


  PDMENU17 = CW_PDMENU( BASE2, MenuDesc699, /RETURN_FULL_NAME, $
      UVALUE='SUMMARY')


  BASE31 = WIDGET_BASE(MAIN2, $
      ROW=1, $
      MAP=1, $
      TITLE='OPTIONS', $
      UVALUE='BASE31')

  LABEL32 = WIDGET_LABEL( BASE31, $
      UVALUE='XOPTIONS', $
      VALUE='OPTIONS:')

  MenuDesc704 = [ $
      { CW_PDMENU_S,       3, 'SPECIAL' }, $ ;        0
        { CW_PDMENU_S,       0, 'OPTION FILE' }, $ ;        1
        { CW_PDMENU_S,       1, 'DATA TYPE' }, $ ;        2
          { CW_PDMENU_S,       1, 'BATSE' }, $ ;        3
            { CW_PDMENU_S,       0, 'CONT' }, $ ;        4
            { CW_PDMENU_S,       0, 'SHER AND SHERB' }, $ ;        5
            { CW_PDMENU_S,       2, 'HER AND HERB' }, $ ;        6
        { CW_PDMENU_S,       3, 'YOHKOH' }, $ ;        7
          { CW_PDMENU_S,       0, 'HXT' }, $ ;        8
          { CW_PDMENU_S,       0, 'HXS' }, $ ;        9
          { CW_PDMENU_S,       0, 'GRS' }, $ ;       10
          { CW_PDMENU_S,       2, 'SXS' }, $ ;       11
      { CW_PDMENU_S,       1, 'DETECTOR #' }, $ ;       12
        { CW_PDMENU_S,       0, '0' }, $ ;       13
        { CW_PDMENU_S,       0, '1' }, $ ;       14
        { CW_PDMENU_S,       0, '2' }, $ ;       15
        { CW_PDMENU_S,       0, '3' }, $ ;       16
        { CW_PDMENU_S,       0, '4' }, $ ;       17
        { CW_PDMENU_S,       0, '5' }, $ ;       18
        { CW_PDMENU_S,       0, '6' }, $ ;       19
        { CW_PDMENU_S,       2, '7' }, $ ;       20
      { CW_PDMENU_S,       1, 'EVENT ID' }, $ ;       21
        { CW_PDMENU_S,       0, 'BATSE FLARE #' }, $ ;       22
        { CW_PDMENU_S,       0, 'BATSE BURST #' }, $ ;       23
        { CW_PDMENU_S,       2, 'TIME' }, $ ;       24
      { CW_PDMENU_S,       0, 'DATA FILE 1' }, $ ;       25
      { CW_PDMENU_S,       0, 'DATA FILE 2' }, $ ;       26
      { CW_PDMENU_S,       0, 'DATA DIRECTORY' }, $ ;       27
      { CW_PDMENU_S,       0, 'POSTSCRIPT FORMAT' }, $ ;       28
      { CW_PDMENU_S,       2, 'QUIET' } $  ;     29
  ]


  PDMENU37 = CW_PDMENU( BASE31, MenuDesc704, /RETURN_FULL_NAME, $
      UVALUE='SPECIAL_OPTIONS')

  MenuDesc711 = [ $
      { CW_PDMENU_S,       3, 'TIME HISTORY' }, $ ;        0
        { CW_PDMENU_S,       0, 'START' }, $ ;        1
        { CW_PDMENU_S,       0, 'END' }, $ ;        2
        { CW_PDMENU_S,       1, 'BACK. ENERGY RANGE' }, $ ;        3
          { CW_PDMENU_S,       0, 'FULL RANGE' }, $ ;        4
          { CW_PDMENU_S,       2, 'SUB-RANGE' }, $ ;        5
      { CW_PDMENU_S,       0, 'SAMPLE AVERAGE' }, $ ;        6
      { CW_PDMENU_S,       0, 'ENERGY BANDS (MULTI-TRACE)' }, $ ;        7
      { CW_PDMENU_S,       0, 'SCALE FOR BANDS' }, $ ;        8
      { CW_PDMENU_S,       0, 'YRANGE' }, $ ;        9
      { CW_PDMENU_S,       1, 'Y UNITS' }, $ ;       10
        { CW_PDMENU_S,       0, 'COUNTS/SEC' }, $ ;       11
        { CW_PDMENU_S,       2, 'COUNTS/SEC/CM^2/KEV' }, $ ;       12
      { CW_PDMENU_S,       1, 'BACKGROUND ORDER' }, $ ;       13
        { CW_PDMENU_S,       0, '0 CONSTANT' }, $ ;       14
        { CW_PDMENU_S,       0, '1 LINEAR' }, $ ;       15
        { CW_PDMENU_S,       2, '2 QUADRATIC' }, $ ;       16
      { CW_PDMENU_S,       1, 'YAXIS' }, $ ;       17
        { CW_PDMENU_S,       0, 'LINEAR' }, $ ;       18
        { CW_PDMENU_S,       2, 'LOG' }, $ ;       19
      { CW_PDMENU_S,       3, 'Y ERROR BARS' }, $ ;       20
        { CW_PDMENU_S,       0, 'HIDE' }, $ ;       21
        { CW_PDMENU_S,       2, 'SHOW' } $  ;     22
  ]


  PDMENU40 = CW_PDMENU( BASE31, MenuDesc711, /RETURN_FULL_NAME, $
      UVALUE='THIST_PAR')

  MenuDesc718 = [ $
      { CW_PDMENU_S,       3, 'SPECTRAL FITS' }, $ ;        0
        { CW_PDMENU_S,       0, 'FIT PARAMETERS' }, $ ;        1
        { CW_PDMENU_S,       0, 'FREE/FIX' }, $ ;        2
        { CW_PDMENU_S,       0, 'LOWER BOUNDS' }, $ ;        3
        { CW_PDMENU_S,       0, 'UPPER BOUNDS' }, $ ;        4
        { CW_PDMENU_S,       0, 'VALID FITTING ENERGIES' }, $ ;        5
        { CW_PDMENU_S,       1, 'RESPONSE MATRIX OPTIONS' }, $ ;        6
          { CW_PDMENU_S,       1, 'DEFAULT MATRIX' }, $ ;        7
            { CW_PDMENU_S,       0, 'USE' }, $ ;        8
            { CW_PDMENU_S,       2, 'OTHER' }, $ ;        9
        { CW_PDMENU_S,       0, 'DIRECT MATRIX FILE' }, $ ;       10
        { CW_PDMENU_S,       0, 'SCATTER MATRIX FILE' }, $ ;       11
        { CW_PDMENU_S,       0, 'DIRECTORY' }, $ ;       12
        { CW_PDMENU_S,       2, 'BUILD HIGH ENERGY MATRIX' }, $ ;       13
      { CW_PDMENU_S,       0, 'FIRST INTERVAL #' }, $ ;       14
      { CW_PDMENU_S,       0, 'LAST INTERVAL #' }, $ ;       15
      { CW_PDMENU_S,       0, 'MIN. UNCERTAINTY' }, $ ;       16
      { CW_PDMENU_S,       0, 'PLOT XRANGE' }, $ ;       17
      { CW_PDMENU_S,       0, 'PLOT YRANGE' }, $ ;       18
      { CW_PDMENU_S,       1, 'SOURCE FOR INIT. PARAMS.' }, $ ;       19
        { CW_PDMENU_S,       0, 'PREVIOUS INTERVAL' }, $ ;       20
        { CW_PDMENU_S,       2, 'LAST FIT TO CURRENT INTERVAL' }, $ ;       21
      { CW_PDMENU_S,       1, 'XAXIS TYPE' }, $ ;       22
        { CW_PDMENU_S,       0, 'LOG' }, $ ;       23
        { CW_PDMENU_S,       2, 'LINEAR' }, $ ;       24
      { CW_PDMENU_S,       1, 'YAXIS TYPE' }, $ ;       25
        { CW_PDMENU_S,       0, 'LOG' }, $ ;       26
        { CW_PDMENU_S,       2, 'LINEAR' }, $ ;       27
      { CW_PDMENU_S,       1, 'MODEL FUNCTION' }, $ ;       28
        { CW_PDMENU_S,       0, 'THERM + BR. P-LAW' }, $ ;       29
        { CW_PDMENU_S,       0, '2THERM + P-LAW' }, $ ;       30
        { CW_PDMENU_S,       2, 'OTHER' }, $ ;       31
      { CW_PDMENU_S,       3, 'MORE INFO' }, $ ;       32
        { CW_PDMENU_S,       0, 'SET' }, $ ;       33
        { CW_PDMENU_S,       2, 'RESET' } $  ;     34
  ]


  PDMENU41 = CW_PDMENU( BASE31, MenuDesc718, /RETURN_FULL_NAME, $
      UVALUE='SPEC_FITS')

  MenuDesc727 = [ $
      { CW_PDMENU_S,       3, 'SUMMARY' }, $ ;        0
        { CW_PDMENU_S,       0, 'SUMMARY FILE NAME' }, $ ;        1
        { CW_PDMENU_S,       0, 'SUMMARY FILE DIRECTORY' }, $ ;        2
        { CW_PDMENU_S,       3, 'PARAMETERS TO PLOT' }, $ ;        3
          { CW_PDMENU_S,       1, 'ON XAXIS' }, $ ;        4
            { CW_PDMENU_S,       0, 'TIME ' }, $ ;        5
            { CW_PDMENU_S,       0, 'PARAMETER #' }, $ ;        6
            { CW_PDMENU_S,       0, 'CHISQUARE' }, $ ;        7
            { CW_PDMENU_S,       0, 'SHOW ERRORS' }, $ ;        8
            { CW_PDMENU_S,       2, 'HIDE ERRORS' }, $ ;        9
      { CW_PDMENU_S,       3, 'ON YAXIS' }, $ ;       10
        { CW_PDMENU_S,       0, 'PARAMETER #' }, $ ;       11
        { CW_PDMENU_S,       0, 'CHISQUARE' }, $ ;       12
        { CW_PDMENU_S,       0, 'SHOW ERRORS' }, $ ;       13
        { CW_PDMENU_S,       2, 'HIDE ERRORS' } $  ;     14
  ]


  PDMENU42 = CW_PDMENU( BASE31, MenuDesc727, /RETURN_FULL_NAME, $
      UVALUE='SUMMARY_OPT')


  BASE71 = WIDGET_BASE(MAIN2, $
      COLUMN=1, $
      FRAME=1, $
      MAP=1, $
      TITLE='DIALOG BOX', $
      UVALUE='BASE71')

  FIELD111 = CW_FIELD( BASE71, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      FRAME=2, $
      TITLE='COMMAND LINE for SPEX>', $
      UVALUE='FIELD111', $
      XSIZE=43)

  LABEL82 = WIDGET_LABEL( BASE71, $
      UVALUE='INFOBOX', $
      VALUE='SPEX INFORMATION BOX')


  TextVal736 = [ $
    '', $
    '', $
    '', $
    'Spectral Plot and Fit Parameters:', $
    '', $
    'F_MODEL            f_vth_bpow', $
    'APAR               1.00000e-05  1.00000      3.92000      2.66000', $
    '400.000      1.93000', $
    'FREE               0            0            1            1', $
    '0            0', $
    'UNCERT             0.0500000', $
    'IFIRST             0', $
    'ILAST              0', $
    'RANGE_LO           1.00000e-07  0.500000     1.00000e-10  1.00000', $
    '12.0000      1.00000', $
    'RANGE_HI           1000.00      20.0000      1.00000e+10  12.0000', $
    '1500.00      12.0000', $
    'ERANGE             30.0000      100.000', $
    'SUMFIT             0', $
    'SP_XTYPE           1', $
    'SP_YTYPE           1', $
    'SPXRANGE           0.000000     0.000000', $
    'SPYRANGE           0.000000     0.000000', $
    'MORE_INFO          0', $
    '' ]
  TEXT214 = WIDGET_TEXT( BASE71,VALUE=TextVal736, $
      FONT='-adobe-itc avant garde gothic-book-r-normal--10-100-75-75-p-59-iso8859-1', $
      UVALUE='TEXTDISPLAY', $
      /scroll, $
      XSIZE=80, $
      YSIZE=15)

  printx, base = text214

  Btns738 = [ $
    '  MENU  ', $
    '  SPEX   ', $
    '    IDL     ' ]
  BGROUP187 = CW_BGROUP( MAIN2, Btns738, $
      ROW=1, $
      FRAME=4, $
      LABEL_LEFT='TO EXIT:', $
      UVALUE='exit_group')

  WIDGET_CONTROL, MAIN2, /REALIZE
  DEP150 = WIDGET_BASE(GROUP_LEADER=Group, $
      COLUMN=1, $
      MAP=1, $
      TITLE='MODIFY OPTION', $
      UVALUE='DEP150')

  Btns741 = [ $
    'DONE', $
    'QUIT' ]
  BGROUP153 = CW_BGROUP( DEP150, Btns741, $
      COLUMN=2, $
      UVALUE='MOD_BUTTONS')

  FieldVal743 = [ $
    'OPTION' ]
  FIELD165 = CW_FIELD( DEP150,VALUE=FieldVal743, $
      ROW=1, $
      STRING=1, $
      TITLE='OPTION_NAME', $
      UVALUE='OPTION_NAME')

  FieldVal745 = [ $
    'INTERNAL_NAME' ]
  FIELD162 = CW_FIELD( DEP150,VALUE=FieldVal745, $
      ROW=1, $
      STRING=1, $
      TITLE='SPEX VARIABLE', $
      UVALUE='FIELD162')

  ListVal747 = [ $
    'CHANGE OPTION IN FIELD BELOW ', $
    'SELECT "DONE" OR "QUIT" TO RETURN' ]
  LIST166 = WIDGET_LIST( DEP150,VALUE=ListVal747, $
      FRAME=4, $
      UVALUE='OPTION_NAME', $
      YSIZE=2)

  FieldVal749 = [ $
    'VALUE' ]
  FIELD164 = CW_FIELD( DEP150,VALUE=FieldVal749, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='=>', $
      UVALUE='SCALAR_OPTION', $
      XSIZE=30)

  WIDGET_CONTROL, DEP150, /REALIZE
  DEP112 = WIDGET_BASE(GROUP_LEADER=Group, $
      COLUMN=1, $
      MAP=1, $
      TITLE='MODIFY OPTIONS ARRAY', $
      UVALUE='DEP112')

  Btns752 = [ $
    'DONE', $
    'QUIT' ]
  BGROUP138 = CW_BGROUP( DEP112, Btns752, $
      COLUMN=2, $
      UVALUE='MOD_BUTTONS')

  FieldVal754 = [ $
    'OPTION' ]
  FIELD149 = CW_FIELD( DEP112,VALUE=FieldVal754, $
      ROW=1, $
      STRING=1, $
      TITLE='OPTION_NAME', $
      UVALUE='OPTION_NAME')

  FieldVal756 = [ $
    'INTERNAL_NAME' ]
  FIELD147 = CW_FIELD( DEP112,VALUE=FieldVal756, $
      ROW=1, $
      STRING=1, $
      TITLE='SPEX VARIABLE', $
      UVALUE='FIELD147')

  ListVal758 = [ $
    'CHANGE FIELDS BELOW THEN,', $
    ' CLICK ON "DONE" OR "QUIT"' ]
  LIST167 = WIDGET_LIST( DEP112,VALUE=ListVal758, $
      FRAME=4, $
      UVALUE='OPTION_NAME', $
      YSIZE=2)

  FieldVal760 = [ $
    'VALUE' ]
  FIELD114 = CW_FIELD( DEP112,VALUE=FieldVal760, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='0.', $
      UVALUE='FIELD114')

  FieldVal762 = [ $
    '' ]
  FIELD115 = CW_FIELD( DEP112,VALUE=FieldVal762, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='1.', $
      UVALUE='FIELD115')

  FieldVal764 = [ $
    '' ]
  FIELD116 = CW_FIELD( DEP112,VALUE=FieldVal764, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='2.', $
      UVALUE='FIELD116')

  FieldVal766 = [ $
    '' ]
  FIELD117 = CW_FIELD( DEP112,VALUE=FieldVal766, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='3.', $
      UVALUE='FIELD117')

  FieldVal768 = [ $
    '' ]
  FIELD118 = CW_FIELD( DEP112,VALUE=FieldVal768, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='4.', $
      UVALUE='FIELD118')

  FieldVal770 = [ $
    '' ]
  FIELD123 = CW_FIELD( DEP112,VALUE=FieldVal770, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='5.', $
      UVALUE='FIELD123')

  FieldVal772 = [ $
    '' ]
  FIELD124 = CW_FIELD( DEP112,VALUE=FieldVal772, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='6.', $
      UVALUE='FIELD124')

  FieldVal774 = [ $
    '' ]
  FIELD125 = CW_FIELD( DEP112,VALUE=FieldVal774, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='7.', $
      UVALUE='FIELD125')

  FieldVal776 = [ $
    '' ]
  FIELD126 = CW_FIELD( DEP112,VALUE=FieldVal776, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='8.', $
      UVALUE='FIELD126')

  FieldVal778 = [ $
    '' ]
  FIELD127 = CW_FIELD( DEP112,VALUE=FieldVal778, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='9.', $
      UVALUE='FIELD127')

  FieldVal780 = [ $
    '' ]
  FIELD128 = CW_FIELD( DEP112,VALUE=FieldVal780, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='10.', $
      UVALUE='FIELD128')

  FieldVal782 = [ $
    '' ]
  FIELD132 = CW_FIELD( DEP112,VALUE=FieldVal782, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='11.', $
      UVALUE='FIELD132')

  FieldVal784 = [ $
    '' ]
  FIELD133 = CW_FIELD( DEP112,VALUE=FieldVal784, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='12.', $
      UVALUE='FIELD133')

  FieldVal786 = [ $
    '' ]
  FIELD134 = CW_FIELD( DEP112,VALUE=FieldVal786, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='13.', $
      UVALUE='FIELD134')

  FieldVal788 = [ $
    '' ]
  FIELD135 = CW_FIELD( DEP112,VALUE=FieldVal788, $
      ROW=1, $
      STRING=1, $
      RETURN_EVENTS=1, $
      TITLE='14.', $
      UVALUE='FIELD135')

  WIDGET_CONTROL, DEP112, /REALIZE
  spex_proc, /gui, bang_out= bang

  XMANAGER, 'DEP150', DEP150, /JUST_REG, group_leader=main2

  XMANAGER, 'DEP112', DEP112, /JUST_REG, group_leader=main2

  XMANAGER, 'MAIN2', MAIN2
  xmanager			;helps user resume using on retall
  ;restore system variables to outside world
  if keyword_set(bang) then begin
	!p= bang.p
	!x= bang.x
	!y= bang.y
	!z= bang.z
  endif
  printx, base=-1	;disable printing to text widget
END