; $Id: animatedemo.pro,v 1.1 1993/04/02 19:57:52 idl Exp $ ;+ ; NAME: ; ANIMATEDEMO ; PURPOSE: ; Demonstrates the use of the XInteractive animation library procedure ; and the XGetData procedure for selection of data. ; CATEGORY: ; Widgets, Demo ; CALLING SEQUENCE: ; ANIMATEDEMO ; KEYWORD PARAMETERS: ; GROUP = The widget ID of the widget that leads the animatedemo. If the ; leader is destroyed, the XManager will also destroy the ; animatedemo. ; SIDE EFFECTS: ; Initiates the XManager if it is not already invoked. ; PROCEDURE: ; Get the data to be displayed and then display it using the ; CW_ANIMATE widget. ; MODIFICATION HISTORY: Written by Steve Richards, December, 1990 ; Modified to use the CW_ANIMATE compound widget, AB June 1992 ;- PRO anidemo_event, ev ; The only event that can be seen by this application is the "DONE" ; event from the CW_ANIMATION cluster. widget_control, /destroy, ev.top END PRO animatedemo, GROUP = GROUP XGetData, frames, DESCRIPTION = description, $ DIMENSIONS = dimens, $ /THREE_DIM, $ TITLE = "Please Select Animation Data", /ASSOC_IT s = SIZE(frames) if s(0) gt 1 then begin pictsize = dimens(0) * dimens(1) fact = (1000000 / (pictsize * dimens(2))) > 1 < 5 ;Zoom factor ~ 1MB topbase = WIDGET_BASE(title=description) animatebase = CW_ANIMATE(topbase, dimens(0) * fact, dimens(1) * fact, $ dimens(2)) WIDGET_CONTROL, topbase, /REALIZE, /HOURGLASS IF fact ne 1 then FOR index = 0, dimens(2)-1 DO $ CW_ANIMATE_LOAD, animatebase, image = REBIN(frames(index), $ dimens(0) * fact, dimens(1) * fact), frame = index $ ELSE FOR index = 0, dimens(2)-1 DO $ CW_ANIMATE_LOAD, animatebase,image = frames(index), frame = index ; XInteranimate, SET = [dimens(0) * fact, dimens(1) * fact, dimens(2)], $ ; TITLE = description, /SHOWLOAD ; IF fact ne 1 then FOR index = 0, dimens(2)-1 DO $ ; XInteranimate, image = REBIN(frames(index), $ ; dimens(0) * fact, dimens(1) * fact), frame = index $ ; ELSE FOR index = 0, dimens(2)-1 DO $ ; XInteranimate, image = frames(index), frame = index junk = fstat(frames) free_lun, junk.unit ; XInteranimate, GROUP = GROUP ENDIF CW_ANIMATE_RUN, animatebase XMANAGER, 'AnimateDemo', topbase, EVENT_HANDLER = "anidemo_event", $ GROUP_LEADER = GROUP END