;+ ; NAME: ; qView_UpdateTime ; PURPOSE: ; Update the widget when time is changed ; CATEGORY: ; Widget qView ; CALLING SEQUENCE: FUNCTION qView_UpdateTime, state ; INPUTS: ; state array[1]; type: structure ; qView state structure ; OPTIONAL INPUT PARAMETERS: ; OUTPUTS: ; Result scalar; type: byte ; 0B if the new active image is the same as the one on display ; 1B if this is not the case. ; (this can be used by the caller to call qView_Image if this routine returns 1B. ; OPTIONAL OUTPUT PARAMETERS: ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; TimeSet, IsTime, TimeOp, TimeUnit, qView_ImageInfo, qView_UpdateActive ; PROCEDURE: ; STATE INFO MODIFIED: ; MODIFICATION HISTORY: ; MAR-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- widget_control, state.wid_time, get_value=time time = TimeSet(time) CASE IsTime(time) OF ;0: value = qView_ImageInfo(state, /display) 0: value = qView_ImageInfo(state, /active) 1: BEGIN widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy times = allfiles[*,2] widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy list = qView_ImageInfo(state, /list) times = times[list] tmp = min(abs(TimeOp(/subtract,TimeSet(times),time,TimeUnit(/day))),value) value = list[value] END ENDCASE RETURN, qView_UpdateActive(state, value=value) & END