;+
; NAME        : EIT_SUB_PRINT
;
; PURPOSE     : Print the current subfield display
;
; CATEGORY    : EIT subfield
;
; EXPLANATION : 
;
; SYNTAX      : 
;
; EXAMPLES    : none
; 
; CALLED BY   :
;
; CALLS TO    : none
;
; ARGUMENTS   : 0 = b/w print, 1=soho_color3 (cheap color), 2= $$$ color
;
; KEYWORDS    : none
;
; OUTPUTS     : none
;
; COMMON      : none
;
; RESTRICTIONS: none
;
; SIDE EFFECTS: none
;
; PROJECT     : SOHO - EIT
;
; HISTORY     : V1,  1996/10/15 Elaine Einfalt (HSTX)
; 	1999-march  Einfalt - - passing group to more routines for V5 modal
;
; CONTACT     : eit@xanado.nascom.nasa.gov
;-

pro eit_sub_print, printer, substruc=substruc, new_sub_ids=new_sub_ids

    if printer eq 0 then color = 0 else color = 1

    ; Redraw it to clean up stray "nubbies"

    ; File        : same
    ; Grid        : same
    ; Rotation    : current displayed in tool interface
    ; Offset      : current displayed in tool interface
    ; Subfields   : same
    ; Window size : same

    EIT_SUB_DISP,    /refile,				$
     		     sub_ids    = new_sub_ids, 		$
   		     substruc   = substruc

    !p.font=0 

    ; For now just snap
    ; Oneday maybe go back and pass printer thru EIT_SUB_DISP.PRO

    snap = byte(tvrd(0,0,!d.x_size,!d.y_size))
    set_plot,'PS', /copy 

    device, bits_per_pixel=8, $
	 /inches, xsize=7.5, ysize=7.5, xoffset=0.5, yoffset=3.0, $
         color=color, /helvetica, FILENAME='EIT_SUBFIELD.PS'

    tv, snap

    xyouts, 0.5, -0.1, substruc.cur_file, alignment=0.5, charsize=2, /normal

 device,/close
 
 case printer of
    1 : queue = "soho_color3"
    2 : queue = "soho_color2"
    else: queue = "soho_laser4"
 endcase

 set_plot,'x'  &  !p.font=-1 
 
 print_pick = ['Black/White printer', $
	       'Cheap color printer', $ 
	       'Expensive color printer'] 

 do_it = respond_widg(mess=['Do you want to print to ' + print_pick(printer),$
			    'If you respond "No", file EIT_SUBFIELD.PS ', $
			    'will remain on disk.'], $
		    button = ['No','Yes'], /col, group=substruc.sub_base_id)

 if do_it then $
    psplot, FILENAME='EIT_SUBFIELD.PS', queue=queue, color=color, /delete


return
end
