FUNCTION it_panel, parent, lbl=lbl, UVALUE=UVALUE filter=['*fts','*fits','sf_fits*','*FTS','*gif','*GIF','efr*','efz*','ecd*'] path=curdir() filelist=file_list(path,filter,/FILE,/CD) filelist=strip_dirname(filelist,path=pathlist) path=pathlist(0) col_table=1 IF NOT KEYWORD_SET(lbl) THEN lbl='No Label' IF NOT KEYWORD_SET(UVALUE) THEN uvalue=0 base=WIDGET_BASE(parent, UVALUE=uvalue, $ EVENT_FUNC='it_panel_event', $ FUNC_GET_VALUE='it_panel_get_value', $ PRO_SET_VALUE='it_panel_set_value', /COLUMN, $ TITLE=lbl, /FRAME) pathbox=WIDGET_TEXT(base,VALUE=path,/EDITABLE) filebox=WIDGET_LIST(base,XSIZE=17,YSIZE=5,VALUE=filelist) filename=filelist(0) buttons=CW_BGROUP(base,['Red-White','Blue-White','G/W Lin','G/W Exp'], $ COLUMN=3,/EXCLUSIVE,/RETURN_NAME,/FRAME) min_slid=WIDGET_SLIDER(base,MAXIMUM=255,VALUE=0,TITLE='Min') max_slid=WIDGET_SLIDER(base,MAXIMUM=255,VALUE=255,TITLE='Max') view_button=CW_BGROUP(base,['View'],/ROW,/RETURN_NAME) state={filebox:filebox,min_slid:min_slid,max_slid:max_slid, $ filter:filter,path:path,filelist:STRARR(300), $ filename:filename,col_table:col_table,min:0,max:255} state.filebox=filebox state.filter=filter state.path=path state.filename=filename state.filelist=filelist state.col_table=col_table WIDGET_CONTROL, WIDGET_INFO(base, /CHILD), SET_UVALUE=state, /NO_COPY RETURN, base END PRO it_panel_set_value,id,value print,'I''m in it_panel_set_value' stash=WIDGET_INFO(id, /CHILD) print,'I''m in set value' WIDGET_CONTROL, stash, GET_UVALUE=state, /NO_COPY print,state ;state.field=value WIDGET_CONTROL,stash,SET_UVALUE=state, /NO_COPY END FUNCTION it_panel_get_value, id print,'I''m in it_get_value' stash=WIDGET_INFO(id, /CHILD) WIDGET_CONTROL, stash, GET_UVALUE=state, /NO_COPY ret=state WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY RETURN, ret END FUNCTION it_panel_event, event event_type=TAG_NAMES(event, /STRUCTURE_NAME) print,event_type base=event.handler stash=WIDGET_INFO(base, /CHILD) WIDGET_CONTROL,stash,GET_UVALUE=state, /NO_COPY IF (event_type EQ 'WIDGET_TEXT_CH') THEN BEGIN ;{ WIDGET_CONTROL,event.id,GET_VALUE=pathlist WIDGET_CONTROL,/HOURGLASS newpath=pathlist(0) len=STRLEN(newpath)-1 IF (STRPOS(newpath,'/',len) NE -1) THEN $ newpath=STRMID(newpath,0,len) test=chk_dir(newpath) IF (test EQ 1) THEN BEGIN print,'Changing to : ',newpath CD,newpath temp_filelist=file_list(newpath,state.filter,/FILE,/CD) filelist=strip_dirname(temp_filelist) path=newpath+'/' state.filelist=filelist state.path=path WIDGET_CONTROL,state.filebox,SET_VALUE=state.filelist ENDIF ENDIF ;} IF (event_type EQ 'WIDGET_LIST') THEN BEGIN ;{ print,'The current filename is: ',state.filelist(event.index) state.filename=state.filelist(event.index) ENDIF ;} IF (event_type EQ '') THEN BEGIN ;{ IF (event.value EQ 'Red-White') THEN BEGIN ;{ state.col_table=3 ENDIF ;} IF (event.value EQ 'Blue-White') THEN BEGIN ;{ state.col_table=1 ENDIF ;} IF (event.value EQ 'G/W Lin') THEN BEGIN ;{ state.col_table=8 ENDIF ;} IF (event.value EQ 'G/W Exp') THEN BEGIN ;{ state.col_table=9 ENDIF ;} IF (event.value EQ 'View') THEN BEGIN ;{ this_device=!D.name SET_PLOT,'Z' temp_img=READFITS(state.path+state.filename,hdu) sz=SIZE(temp_img) img=BYTARR(3,sz(1),sz(2)) IF (state.col_table EQ 1) THEN load_lut,'blue_white_cp.lut', $ mn=state.min,mx=state.max $ ELSE BEGIN loadct,state.col_table STRETCH,state.min,state.max ENDELSE tvlct,r,g,b,/GET img(0,*,*)=r(temp_img) img(1,*,*)=g(temp_img) img(2,*,*)=b(temp_img) SET_PLOT,this_device WINDOW,1,XSIZE=sz(1),YSIZE=sz(2),/FREE TVSCL,img(0,*,*),CHANNEL=1 TVSCL,img(1,*,*),CHANNEL=2 TVSCL,img(2,*,*),CHANNEL=3 ENDIF ;} ENDIF ;} IF (event_type EQ 'WIDGET_SLIDER') THEN BEGIN ;{ WIDGET_CONTROL,state.min_slid,GET_VALUE=mn WIDGET_CONTROL,state.max_slid,GET_VALUE=mx state.min=mn state.max=mx ENDIF ;} IF (event_type EQ 'RGB_EVENT') THEN BEGIN ;{ r=event.r g=event.g b=event.b print,r,g,b TVLCT,r,g,b ENDIF ;} IF (event_type EQ 'COLORSEL_EVENT') THEN BEGIN ;{ WIDGET_CONTROL,event.id,GET_VALUE=var print,var ENDIF ;} ret={it_panel_event, ID:base, TOP:event.top, $ HANDLER:0L} WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY RETURN,ret END