@dcs_modifybeamclosedrawdatafile
@dcs_patchrawdatafile
@dcs_renormalizeDAVEfile
@dcs_rotaterawdatafile
@dcs_sumrawdatafiles
@dcs_bitflipcorrectrawdatafile
@centertlb
@dave_get_values
@free_all_ptrs

pro dcs_handler,event
widget_control,event.top,get_uvalue=state
if (event.id eq	state.done) then begin
	widget_control,event.top,/destroy
	return
endif
end

pro dcs,event

;LRK 031208
;UPDATED THIS METHOD TO RECEIVE AND EVENT WHEN CALLED FROM DAVE.
if n_elements(event) eq 0 then begin
  tlb=widget_base(title='DCS (non-DAVE) program launch utility',/col)
endif else begin
  tlb=widget_base(title='DCS (non-DAVE) program launch utility',/col,group_leader=event.top)
endelse
;
	base1=widget_base(tlb,/row,frame=3)
		void=widget_button(base1,value='Modify one or more beam closed raw data files',$
			event_pro='dcs_modifybeamclosedrawdatafile',xsize=300)
		hmod=widget_button(base1,value='Help',$
			event_pro='dcs_modifybeamclosedrawdatafile',uname='help',xsize=50)
;
	base1=widget_base(tlb,/row,frame=3)
		void=widget_button(base1,value='Patch a DCS raw data file',$
			event_pro='dcs_patchrawdatafile',xsize=300)
		hpat=widget_button(base1,value='Help',$
			event_pro='dcs_patchrawdatafile',uname='help',xsize=50)
;
	base1=widget_base(tlb,/row,frame=3)
		void=widget_button(base1,value='Renormalize one or more DAVE files',$
			event_pro='dcs_renormalizeDAVEfile',xsize=300)
		hren=widget_button(base1,value='Help',$
			event_pro='dcs_renormalizeDAVEfile',uname='help',xsize=50)
;
	base1=widget_base(tlb,/row,frame=3)
		void=widget_button(base1,value='Rotate one or more DCS raw data files',$
			event_pro='dcs_rotaterawdatafile',xsize=300)
		hrot=widget_button(base1,value='Help',$
			event_pro='dcs_rotaterawdatafile',uname='help',xsize=50)
;
	base1=widget_base(tlb,/row,frame=3)
		void=widget_button(base1,value='Sum one or more DCS raw data files',$
			event_pro='dcs_sumrawdatafiles',xsize=300)
		hsum=widget_button(base1,value='Help',$
			event_pro='dcs_sumrawdatafiles',uname='help',xsize=50)
;
	base1=widget_base(tlb,/row,frame=3)
		void=widget_button(base1,value='Bitflip-correct one or more DCS raw data files',$
			event_pro='dcs_bitflipcorrectrawdatafile',xsize=300)
		hbfc=widget_button(base1,value='Help',$
			event_pro='dcs_bitflipcorrectrawdatafile',uname='help',xsize=50)
;
	done=widget_button(tlb,value='EXIT')
;
centertlb,tlb
widget_control,tlb,xoffset=50,yoffset=50
widget_control,tlb,/realize
state={done:done,hmod:hmod,hpat:hpat,hren:hren,hrot:hrot,hsum:hsum,hbfc:hbfc}
widget_control,tlb,set_uvalue=state
xmanager,'dcs',tlb,event_handler='dcs_handler'
end