; ;------------------------------------------------------------------ ; function showpopup,base,str widget_control,base,show=1,bad_id=badid if badid eq 0 then begin print,'>>> There is already a ',str,' window on your screen <<<' return,-1 endif return,0 end ; ;------------------------------------------------------------------ ; pro proc_event,ev @pltdat.h ; widget_control,ev.id,get_uvalue=uval case uval of "QUIT": begin if opencgm gt 0 then begin stat = cgmclose(cgmname) print,'Closed cgm file ',cgmname endif if psdev.openps gt 0 then stat = psclose(psdev.psname) widget_control,finderbase,bad_id=badid,/destroy widget_control,mapbase,bad_id=badid,/destroy widget_control,vecbase,bad_id=badid,/destroy widget_control,contbase,bad_id=badid,/destroy widget_control,wrfilesbase,bad_id=badid,/destroy widget_control,conimagebase,bad_id=badid,/destroy widget_control,xylinebase,bad_id=badid,/destroy widget_control,gotobase,bad_id=badid,/destroy widget_control,/destroy,ev.top return end "FILE FINDER": begin widget_control,finderbase,show=1,bad_id=badid if badid eq 0 then begin print,'>>> there is already a file finder window on your screen' return endif finderbase = filefinder(!finderspec,wtxt_flnm,'newfile',$ !srcdir+'/filefinder.hlp') return end "PRINT HDR": begin printhdr, frame,flnm,ifileframe end "OPEN": begin widget_control,wtxt_flnm,get_value=flnm files = findfile(flnm(0),count=nfiles) if nfiles eq 0 then begin print,'>>> Could not find file ',flnm(0) return endif if nfiles gt 1 then begin print,'The following files were found: ' for i=0,nfiles-1 do print,files(i) endif else begin newfile,files(0) return endelse end "NEXT FRAME": begin istat = rdascii(ludat,flnm,frame) if istat ne 0 then begin print,'(May be end of file -- hit OPEN to go back to first frame)' return endif resetbases ifileframe = ifileframe+1 printhdr, frame,flnm,ifileframe end "GOTO FRAME": begin popup_gotoframe end "TXT_FLNM": begin widget_control,ev.id,get_value=value files = findfile(value(0),count=nfiles) if nfiles eq 0 then begin print,'>>> Could not find file ',value(0) return endif if nfiles gt 1 then begin print,'The following files were found: ' for i=0,nfiles-1 do print,files(i) endif else begin newfile,files(0) return endelse end "BGP_IMCON": begin case ev.value of "IMAGE ONLY": begin imcon = 0 if map.continents ge 0 then map.continents = black if map.grid ge 0 then map.grid = black widget_control,wbut_cont,sensitive=0 print,'Will make images only' return end "CONTOUR ONLY": begin imcon = 1 cont.conclr = white if map.continents ge 0 then map.continents = white if map.grid ge 0 then map.grid = white widget_control,wbut_cont,sensitive=1 print,'Will make contours only' return end "IMAGE+CONTOUR": begin imcon = 2 cont.conclr = black if map.continents ge 0 then map.continents = black if map.grid ge 0 then map.grid = black widget_control,wbut_cont,sensitive=1 print,'Will make images overlain with contours' return end else: begin print,'Unknown imcon type' return end endcase end "BGP_TYPE": begin case ev.value of "MAPS": begin itype = 0 widget_control,imconbase,/map widget_control,conimagebase,bad_id=badid,/destroy widget_control,xylinebase,bad_id=badid,/destroy print,'Will make maps' popup_map end "CONTOUR/IMAGE": begin itype = 1 widget_control,imconbase,/map widget_control,mapbase,bad_id=badid,/destroy widget_control,xylinebase,bad_id=badid,/destroy popup_conimage end "X/Y LINE": begin itype = 3 widget_control,imconbase,map=0 widget_control,mapbase,bad_id=badid,/destroy widget_control,conimagebase,bad_id=badid,/destroy popup_xyline end endcase end "CUSTOM CONTOUR": begin stat = showpopup(contbase,'custom contouring') if stat ne 0 then return popup_cont,ev.top return end "ANNOTATE": begin widget_control,wdraw,get_value=window annotate,window=window return end "COLOR": begin xcolor,group=ev.id,file=!clrtabfile return end "WRFILES": begin stat = showpopup(wrfilesbase,'write files') if stat ne 0 then return popup_wrfiles,ev.top return end else: print,'Unknown uvalue=',uval endcase return end