Previous topic Next topic
ANIMATEBOX
Help > Controls >

/////////////////////////////////////////////////////////////////////
// ANIMATEBOX
/////////////////////////////////////////////////////////////////////

Creates an animation control inside a form, to play an AVI file.
A set of commands is provided for manipulating an existing control.
Note that the file must not contain sound or it will not be played.

Control creation:

*** Standard syntax:

   @ nRow, nCol ANIMATEBOX Name ;
      [ OBJ Obj ; ]
      [ <OF, PARENT> Parent ; ]
      [ WIDTH nWidht ; ]
      [ HEIGHT nHeight ; ]
      [ FILE cFile ; ]
      [ AUTOPLAY ; ]
      [ CENTER ; ]
      [ TRANSPARENT ; ]
      [ HELPID nHelpid ; ]
      [ SUBCLASS Subclass ; ]
      [ INVISIBLE ; ]
      [ NOTABSTOP ; ]
      [ DISABLED ; ]
      [ RTL ; ]
      [ TOOLTIP cTooltip ]

*** Alternative syntax:

   DEFINE ANIMATEBOX Name ;
      [ COL nCol ]
      [ ROW nRow ]
      [ OBJECT Obj ]
      [ PARENT Parent ]
      [ WIDTH nWidth ]
      [ HEIGHT nHeight ]
      [ FILE cFile ]
      [ AUTOPLAY <.T., .F.> ]
      [ CENTER <.T., .F.> ]
      [ TRANSPARENT <.T., .F.> ]
      [ HELPID nHelpid ]
      [ SUBCLASS Subclass ]
      [ <VISIBLE, INVISIBLE> <.T., .F.> ]
      [ TABSTOP <.T., .F.> ]
      [ <ENABLE, DISABLED> <.T., .F.> ]
      [ RTL <.T., .F.> ]
      [ TOOLTIP cTooltip ]
   END ANIMATEBOX

*** OOP syntax:

   [ Obj := ] TAnimateBox():Define( cName, [ cParent ], [ nCol ], [ nRow ], ;
      [ nWidth ], [ nHeight ], [ lAutoplay ], [ lCenter ], [ lTransparent ], ;
      [ cFile ], [ nHelpId ], [ lInvisible ], [ lNoTabstop ], [ lDisabled ], ;
      [ lRtl ], [ cToolTip ] )

Related commands, functions and methods:

*** Standard syntax:

   OPEN ANIMATEBOX ControlName OF ParentForm FILE cFileName
      Loads an AVI file and shows its first frame.
   PLAY ANIMATEBOX ControlName OF ParentForm
      Plays the file in the background while the app continues executing.
   SEEK ANIMATEBOX ControlName OF ParentForm POSITION nFrame
      Shows the frame at position nFrame.
   STOP ANIMATEBOX ControlName OF ParentForm
      Stops playing the file. The last played frame remains displayed.
   CLOSE ANIMATEBOX ControlName OF ParentForm
      Closes the file.
   DESTROY ANIMATEBOX ControlName OF ParentForm
      Releases the control.

*** Alternative syntax:

   OpenAnimateBox( ControlName, ParentForm, cFileName )
      Loads an AVI file and shows its first frame.
   PlayAnimateBox( ControlName, ParentForm )
      Plays the file in the background while the app continues executing.
   SeekAnimateBox( ControlName, ParentForm, nFrame )
      Shows the frame at position nFrame.
   StopAnimateBox( ControlName, ParentForm )
      Stops playing the file. The last played frame remains displayed.
   CloseAnimateBox( ControlName, ParentForm )
      Closes the file.
   DestroyAnimateBox( ControlName, ParentForm )
      Releases the control.

*** OOP syntax:

   Obj:Open( cFileName )
      Loads an AVI file and shows its first frame.
   Obj:Play()
      Plays the file in the background while the app continues executing.
   Obj:Seek( nFrame )
      Shows the frame at position nFrame.
   Obj:Stop()
      Stops playing the file. The last played frame remains displayed.
   Obj:Close()
      Closes the file.
   Obj:Release()
      Releases the control.

Notes on clauses:

   1. OBJ and OBJECT set a reference to the control into variable Obj.
      When using OBJECT, the variable must be previously declared.
      When using OBJ, if the variable does not exist, it's created PRIVATE.
   2. PARENT declares which window is the parent (owner) of the control.
      It can be ommited when used inside a DEFINE/END WINDOW structure.
   3. ROW and COL define the position of the control inside it's parent client
      area. Default is 0.
   4. WIDTH and HEIGHT define the dimension of the control. Default is 0.
   5. TABSTOP and NOTABSTOP specify if the control can/can't be focused using
      TAB key. Default is TABSTOP.
   6. DISABLED specifies that the control can't receive mouse clicks and
      pressed keys. Default is ENABLED.
   7. SUBCLASS indicates that the control must be an instance of the specified
      class, instead of the default TActiveX class.
   8. VISIBLE and INVISIBLE specify if the control must be visible/hidden when
      created. Default is VISIBLE.
   9. RTL specifies that the control must have WS_EX_LTRREADING, WS_EX_LEFT and
      WS_EX_LEFTSCROLLBAR styles.
      Default is .F.
  10. HELPID associates a help topic within the current help file to the
      control. Default is 0.
  11. FILE specifies that the control must load and show the firt frame of the
      indicated AVI file. Default is NIL.
  12. AUTOPLAY specifies that the control must have ACS_AUTOPLAY style.
      Default is .F.
  13. CENTER specifies that the control must have ACS_CENTER style.
      Default is .F.
  14. TRANSPARENT specifies that the control must have ACS_TRANSPARENT style.
      Default is .F.
  15. TOOLTIP sets a text that will be display when the mouse is positioned
      over the control. Default is NIL.

Notes on parameters:

   1. nFrame, nHelpid, nRow, nCol, nWidth and nHeight must be numbers.
   2. Name, Parent, ControlName and ParentForm must be valid identifiers
      enclosed or not within quotes.
   3. cFile, cTooltip and cFileName must be strings.
   4. Obj and Subclass must be valid identifiers not enclosed within quotes.
   5. cName and cParent must be strings containing valid identifiers.
   6. lAutoplay, lCenter, lTransparent, lInvisible, lNoTabstop, lDisabled
      and lRtl must be .T. or .F.