TAnimate

Fuente: source/classes/tanimate.prg

Inherits from: TControl

TAnimate wraps the Windows animation common control to display AVI (Audio Video Interleaved) clip files. It is typically used to provide visual feedback during longer operations such as file copying, searching, or printing. The control plays silent AVI clips in a fixed-size window and supports preset system animations.

Key DATA Members

DATATypeDescription
cAviCharacterAVI file path or system animation resource name

Methods

MethodDescription
New( nRow, nCol, oWnd, lPixel, lDesign, nW, nH )Create a new TAnimate control
Open( cAvi )Open an AVI file or system animation for playback
Play( nFrom, nTo, nRepeat )Play the animation from frame nFrom to nTo, repeating nRepeat times
Stop()Stop the current playback
Close()Close the AVI and release resources
Seek( nFrame )Seek to a specific frame in the animation

Preset System Animations

The following system AVI resource names can be passed to Open() for standard shell animations:

NameDescription
AVI_FINDFILEMagnifying glass searching animation
AVI_COPYFILEDocument being copied animation
AVI_SEARCHSearch disk animation
AVI_DELETEDocument being deleted (recycle) animation

Example: File Copy Animation

#include "FiveWin.ch"

function Main()

   local oWnd, oAnimate

   DEFINE WINDOW oWnd TITLE "Copying Files..." SIZE 300, 150

   @ 10, 10 ANIMATE oAnimate SIZE 280, 80 OF oWnd

   oAnimate:Open( AVI_COPYFILE )
   oAnimate:Play( 1, 100, 0 )   // 0 = repeat indefinitely

   // Simulate a long operation
   // ... file copy code here ...

   oAnimate:Stop()
   oAnimate:Close()

   ACTIVATE WINDOW oWnd CENTERED

return nil

Notes

Ver También