pro pltdat @pltdat.h ; ; Main driver for plotting from ascii data file: ; setdef widget_control,default_font=!wfont appbase = widget_base(title='PLTASCII',/column,$ xoffset=wxoffset,yoffset=wyoffset) ; ; File finder ; base = widget_base(appbase,/frame,row=1) wbut_finfo = widget_button(base,value="FILE FINDER",uvalue="FILE FINDER") wbut_prnthdr = widget_button(base,value="PRINT HEADER",uvalue="PRINT HDR") widget_control,wbut_prnthdr,sensitive=0 ; ; File text widget: ; base = widget_base(appbase,/frame,row=2) wlab_flnm = widget_label(base,value="ASCII DATA FILE:") base0 = widget_base(base,/row) wtxt_flnm = widget_text(base0,/editable,value=flnm,xsize=47,$ uvalue="TXT_FLNM") wbut_open = widget_button(base0,value='OPEN',uvalue='OPEN') ; ; File frame control: ; base = widget_base(appbase,/frame,/row) wbut_next = widget_button(base,value="NEXT FRAME",uvalue="NEXT FRAME") widget_control,wbut_next,sensitive=0 wbut_goto = widget_button(base,value="GOTO FRAME",uvalue="GOTO FRAME") widget_control,wbut_goto,sensitive=0 ; ; Draw widget: ; drawbase = widget_base(appbase,/frame,/row) wdraw = widget_draw(drawbase,xsize=Wwidth,ysize=Wheight) ; ; Exclusive group to choose maps, 2-d contour, or line plots: ; (this will be mapped after file is read) ; (buttons wb_types will be reset=0 when new file is read) ; typebase = widget_base(appbase,/frame,row=2,map=0) wlab_type = widget_label(typebase,value="CHOOSE PLOT TYPE:") typemenu = cw_bgroup(typebase,/exclusive,uvalue="BGP_TYPE",$ ['MAPS','CONTOUR/IMAGE','X/Y LINE'],/return_name,/row,ids=wb_types) ; ; Image and/or contour (to be mapped if maps or contour is chosen ; from plot types): ; imconbase = widget_base(appbase,/frame,row=2,map=0) imconmenu = cw_bgroup(imconbase,/exclusive,uvalue="BGP_IMCON",$ set_value=imcon,$ ["IMAGE ONLY","CONTOUR ONLY","IMAGE+CONTOUR"],/return_name,/row) ; ; Controls: ; cntrbase = widget_base(appbase,/frame,row=1) wbutton = widget_button(cntrbase,value="QUIT",uvalue="QUIT") wbut_cont = widget_button(cntrbase,value="CUSTOM CONTOUR",$ uvalue="CUSTOM CONTOUR") wbut_annot = widget_button(cntrbase,value="ANNOTATE",uvalue="ANNOTATE") wbut_clr = widget_button(cntrbase,value="COLOR",uvalue="COLOR") if imcon lt 1 then widget_control,wbut_cont,sensitive=0 wb_wrfiles = widget_button(cntrbase,value="WRITE FILES",uvalue="WRFILES") ; ; Realize system, and set window: ; widget_control,appbase,/realize,tlb_get_size=appsize widget_control,get_value=window,wdraw wset,window xmanager,'proc',appbase return end