home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / CLASSES / VIDEO.PRG < prev    next >
Text File  |  1994-06-11  |  1KB  |  51 lines

  1. #include "FiveWin.ch"
  2. #include "Constant.ch"
  3.  
  4. static lRegistered := .f.
  5.  
  6. //----------------------------------------------------------------------------//
  7.  
  8. CLASS TVideo FROM TControl
  9.  
  10.    DATA   oMci
  11.  
  12.    METHOD New( nRow, nCol, nWidth, nHeight, cFileName, oWnd ) CONSTRUCTOR
  13.  
  14.    METHOD Play( nFrom, nTo ) INLINE  ::oMci:Play( nFrom, nTo, ::hWnd )
  15.  
  16. ENDCLASS
  17.  
  18. //----------------------------------------------------------------------------//
  19.  
  20. METHOD New( nRow, nCol, nWidth, nHeight, cFileName, oWnd ) CLASS TVideo
  21.  
  22.    DEFAULT nWidth := 200, nHeight := 200, cFileName := ""
  23.  
  24.    ::nTop      = nRow *  VID_CHARPIX_H    // 8      
  25.    ::nLeft     = nCol * VID_CHARPIX_W    // 14
  26.    ::nBottom   = ::nTop  + nHeight - 1
  27.    ::nRight    = ::nLeft + nWidth + 1
  28.    ::nStyle    = nOR( WS_CHILD, WS_VISIBLE, WS_TABSTOP, WS_BORDER )
  29.    ::nId       = ::GetNewId()
  30.    ::oWnd      = oWnd
  31.    ::oMci      = TMci():New( "avivideo", cFileName )
  32.    ::lDrag     = .f.
  33.    ::lCaptured = .f.
  34.  
  35.    if ! lRegistered
  36.       ::Register( nOR( CS_VREDRAW, CS_HREDRAW, CS_GLOBALCLASS ) )
  37.       lRegistered = .t.
  38.    endif
  39.  
  40.    if oWnd:lVisible
  41.       ::Create()
  42.       ::oMci:lOpen()
  43.       ::oMci:SetWindow( Self )
  44.    else
  45.       oWnd:DefControl( Self )
  46.    endif
  47.  
  48. return nil
  49.  
  50. //----------------------------------------------------------------------------//
  51.