;+
;
; NAME: 
;	ACRIMHELP_EV
;
; PURPOSE:
;	Event handler for the ACRIM program help interface.
;
; CATEGORY:
;	ACRIM
;
; CALLING SEQUENCE:
;	XMANAGER, 'ACRIMHELP', base, event_handler='ACRIMHELP_EV', group=group
;	
;
; CALLED BY:
;	ACRIMHELP, through the XMANAGER
;
; CALLS TO:
;	none
;
; INPUTS:
;       none 
;
; OPTIONAL INPUTS:
;	none
;
; OUTPUTS:
;       none 
;
; OPTIONAL OUTPUTS:
;	none
;
; COMMON BLOCKS:
;	none
;
; SIDE EFFECTS:
;	none
;
; RESTRICTIONS:
;	none
;
; PROCEDURE:
;	Display the help infromation about the topic the user clicked on.
;
; MODIFICATION HISTORY:
;	DEC 93 - Elaine Einfalt (HSTX)
;-


pro acrimhelp_ev, event

widget_control, event.id,  get_uvalue=input
widget_control, event.top, get_uvalue=text      ; ID for text widget

type = strmid(tag_names(event, /structure_name), 7,1000)

case type of
 'BUTTON' : widget_control, event.top, /destroy
 'LIST'   : begin

     value = input(event.index)

     case value of                     
      'Getting started'   : hlp = [ $
                'ACRIM is an IDL program designed to access and plot the',$
                'ACRIM data file. ', $
                ' ',$
                'Ideally the location of the data file is designated',$
                'by a logical or environment definition called',$
                'ACRIM_DATA. Examples of these assignments are given', $
		'below. If the data location is not predefined,', $
		'then you will be prompted for the location of file',$
                'ACRIM.DAT ',$
                ' ',$
                'VMS example (Entered at the DCL level):  ',$
                '  $ DEFINE ACRIM_DATA SDAC::SYS$DATA5:[ACRIM]ACRIM.DAT', $
                ' ',$
                'UNIX example (Entered at the shell level): ',$
                '  > setenv ACRIM_DATA /usr/users/Data/ACRIM.DAT', $
                ' ',$
                'In order to run the program, enter IDL and type:',$
                ' ',$
                '  IDL> ACRIM',$
                ' ',$
                'This help routine may be execute independently by',$
                'entering (at the IDL prompt):',$
                ' ',$
                '  IDL> ACRIMHELP ',$
                ' ']
 
      'Selecting time range' : hlp = [ $
		'Select the start and end time boundaries by moving', $
		'the slide bars to the desired month.  The ranges ', $
		'increment by units of months, but the data is plotted', $
		'in units of days.']

      'Selecting Y-axis range' : hlp = [ $
		'Select the Y-axis by moving the slide bars to the desired',$
		'irradiance value.']


      'Plot button' : hlp = [ $
		'The PLOT button cause the ACRIM data to be plotting using', $
		'your currently set parameters.']

      'Help button'    : hlp = [ $
		'The HELP button displays this help menu.',$
                'To run the help inteface independent of the search',$
                'program, enter at the prompt  IDL> ACRIMHELP.',$
                ' ']

      'Hardcopy button' : hlp = [ $
		'The HARDCOPY button allows you to produce a print of',$
		'of the ACRIM data.  The output uses the currently', $
		'set parameters. If you have modified some parameters',$
		'but not pressed the PLOT button then your printer ', $
		'output may not match the screen display.',$
		' ', $
		'To select a output device press the HARDCOPY button', $
		'and then press the desired device.']

      'Options button' : hlp = [ $
		'The OPTIONS button allows you to modify the appearence',$
		'of the plot and to save the data to an IDL save file ', $
		'(ACRIMSAVE.DAT) for independant study.']

      'Selecting error bars' : hlp = [ $
		'Select to display the plot with or without error bars', $
		'by selecting the desired error bar option.']

      'Selecting plot style' : hlp = [ $
		'Select to display the plot with or without connecting', $
		'lines by selecting one of the plot options.']
                                       
      'Quit button' : hlp = [ $
                'The QUIT button terminates the program.  And the widget',$
                'display will be destroyed. ']

     else: begin
		print,'Error - unknown list item in ACRIMHELP_EV: ',value
		return
	   end
     endcase


     widget_control, text, set_value=hlp


   end
else: print,'Error - unsupported widget type.'
endcase

return
end
  
  



;+
;
; NAME: 
;	ACRIMHELP
;
; PURPOSE:
;	The help for the ACRIM program
;
; CATEGORY:
;	ACRIM
;
; CALLING SEQUENCE:
;       ACRIMHELP [, group = group]	
;
; CALLED BY:
; 	ACRIM
;
; CALLS TO:
;	ACRIMHELP_EV, through the XMANAGER
;
; INPUTS:
;       none
;
; OPTIONAL INPUTS:
;	GROUP	: The widget ID of the parent widget
;
; OUTPUTS:
;       none explicit
;
; OPTIONAL OUTPUTS:
;	none
;
; COMMON BLOCKS:
;	none
;
; SIDE EFFECTS:
;	Creates a widget
;
; RESTRICTIONS:
;	Requires widget ablity
;
; PROCEDURE:
;	Create a widget and list the help topics.  As topics are selected by
;	the user, the help information is displayed.
;
; MODIFICATION HISTORY:
;	DEC 93 - Elaine Einfalt (HSTX)
;-


pro acrimhelp, group=group

 if xregistered('ACRIMHELP') then return

 if n_elements(group) eq 0 $
   then base = widget_base(title='ACRIM Help', /row) $
   else base = widget_base(title='ACRIM Help', /row, xoffset=20, yoffset=20)

 select = widget_base(base, /column)

    done = widget_button(select, value='Done with Help', uvalue='DONE')

    lab = widget_label(select, value='Select the topic of interest,')
    lab = widget_label(select, value='then click on that item.')
    lab = widget_label(select, value=' ')


    topics = [  'Getting started',      $
		'Selecting time range',	$
		'Selecting Y-axis range', $
		'Plot button',		$
		'Help button',		$
		'Hardcopy button',	$
		'Options button',	$
		'Selecting error bars', $
		'Selecting plot style', $
		'Quit button']

    list = widget_list(select, value=topics, uvalue=topics, ysize=15)

 text = widget_text(base, /scroll, /frame, xsize=55)

 widget_control, base, /realize
 widget_control, base, set_uvalue=text

 xmanager, 'ACRIMHELP', base, event_handler='ACRIMHELP_EV', group=group


return
end
