Un Cordial saludos a toda la comunidad, sigo trabajando en korea hasta finales de este año, he estado algo ausente pero aqui les dejo un nuevo trabajo, espero terminar esta nueva clase para el "build" de diciembre, les dejo un ejemplo de la misma:
La clase es pequeña pero con bastante fuerza
Heredamos de TControl (->TWindow) asi que podemos hacer uso de todos codeblock para el control de eventos
He usado solo 3 para este ejemplo
LClicked = Cambia el GIF por otro (GetFile)
RClicked = Stop/Play Gif
Mouse Move = Muestra en la barra de titulo de la Window el nombre del GIF donde se genera el evento
solo lo he probado en windows 7 pues aqui no tengo disponibilidad de otro
http://www.sitasoft.com/fivewin/test/giftest.zip
La clase es pequeña pero con bastante fuerza
Heredamos de TControl (->TWindow) asi que podemos hacer uso de todos codeblock para el control de eventos
He usado solo 3 para este ejemplo
LClicked = Cambia el GIF por otro (GetFile)
RClicked = Stop/Play Gif
Mouse Move = Muestra en la barra de titulo de la Window el nombre del GIF donde se genera el evento
solo lo he probado en windows 7 pues aqui no tengo disponibilidad de otro
http://www.sitasoft.com/fivewin/test/giftest.zip
#include "fivewin.ch"
function Main()
local oWnd, oGif, n
oGif = Array( 13 )
DEFINE WINDOW oWnd TITLE "TEST GIF CLASS"
oGif[ 1 ] := TGif():New( ".\gif\006.gif", 0, 22, 345, 240, oWnd )
oGif[ 2 ] := TGif():New( ".\gif\015.gif", 0, oGif[ 1 ]:nRight + 5, 345, 240, oWnd )
oGif[ 3 ] := TGif():New( ".\gif\bigled.gif", 0, oGif[ 2 ]:nRight + 5, 90, 532, oWnd )
oGif[ 4 ] := TGif():New( ".\gif\forGif.gif", oGif[ 3 ]:nBottom + 5, oGif[ 3 ]:nLeft, 120, 120, oWnd )
oGif[ 5 ] := TGif():New( ".\gif\forGif3.gif", oGif[ 3 ]:nBottom + 5, oGif[ 4 ]:nRight + 5, 120, 120, oWnd )
oGif[ 6 ] := TGif():New( ".\gif\Funny.gif", oGif[ 1 ]:nBottom + 5, 22, 345, 240, oWnd )
oGif[ 7 ] := TGif():New( ".\gif\gif01.gif", oGif[ 3 ]:nBottom + 5, oGif[ 5 ]:nRight + 5, 120, 120, oWnd )
oGif[ 8 ] := TGif():New( ".\gif\gif02.gif", oGif[ 3 ]:nBottom + 5, oGif[ 7 ]:nRight + 5, 120, 120, oWnd )
oGif[ 9 ] := TGif():New( ".\gif\gif03.gif", oGif[ 3 ]:nBottom + 5, oGif[ 8 ]:nRight + 5, 120, 120, oWnd )
oGif[ 10 ] := TGif():New( ".\gif\gif04.gif", oGif[ 6 ]:nTop, oGif[ 6 ]:nRight + 5, 345, 240, oWnd )
oGif[ 11 ] := TGif():New( ".\gif\gif05.gif", oGif[ 6 ]:nTop, oGif[ 10 ]:nRight + 5, 345, 240, oWnd )
oGif[ 12 ] := TGif():New( ".\gif\gif08.gif", oGif[ 6 ]:nTop, oGif[ 11 ]:nRight + 5, 345, 240, oWnd )
oGif[ 13 ] := TGif():New( ".\gif\mail056.gif", oGif[ 4 ]:nBottom + 5, oGif[ 3 ]:nLeft, 345, 240, oWnd )
for n = 1 to Len( oGif )
oGif[ n ]:bLClicked := MakeLClick( oGif[ n ] )
oGif[ n ]:bMMoved := MakeMMove( oGif[ n ] )
oGif[ n ]:bRClicked := MakeRClick( oGif[ n ] )
next
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
function MakeLClick( oGif )
return {| | ReloadGif( oGif ) }
function MakeMMove( oGif )
return {| | oGif:oWnd:cTitle := oGif:cFileName }
function MakeRClick( oGif )
return {| | If( oGif:IsRunning(), oGif:Stop(), oGif:Play() ) }
function ReloadGif( oGif )
local cFile
cFile := cGetFile( "*.Gif" )
if ! Empty( cFile )
oGif:SetFile( cFile )
endif
return nil
//-----------------------------------------------------------
// Class TGif
// Gif Info ==> lLopping
// nCurrentLoop
// nImages
// nWidth
// nHeight
//-----------------------------------------------------------
CLASS TGif FROM TControl
DATA hGif
DATA lRegGif
DATA cFilename
CLASSDATA lRegistered
METHOD New( oWnd, cFileName, nTop, nLeft )
METHOD GetData() INLINE GetGifInfo( ::hGif )
METHOD Play() INLINE FWGifPlay( ::hGif )
METHOD Stop() INLINE FWGifStop( ::hGif )
METHOD Restart() INLINE FWGifRestart( ::hGif )
METHOD IsRunning() INLINE FWGifIsRunning( ::hGif )
METHOD Destroy() INLINE FWGifEnd()
METHOD SetFile( cFile ) INLINE ::cFileName := cFile, SetWindowText( ::hGif, cFile )
ENDCLASS
//----------------------------------------------------------------//
METHOD New( cFileName, nTop, nLeft, nBottom, nRight, oWnd ) CLASS TGif
local aData
default oWnd := GetWndDefault(),;
nTop := 0,;
nLeft := 0,;
nBottom := 100,;
nRight := 100
::nTop = nTop
::nLeft = nLeft
::nBottom = nBottom + nTop
::nRight = nRight + nLeft
::oWnd = oWnd
::nStyle = nOR( WS_VISIBLE, WS_CHILD )
::cFileName = cFileName
if ! Empty( cFileName ) .And. ! File( cFileName )
return nil
endif
::Register( )
if ! Empty( oWnd:hWnd )
::Create()
::lVisible = .t.
oWnd:AddControl( Self )
else
oWnd:DefControl( Self )
::lVisible = .f.
endif
FWGIFClass( 0, GetInstance() )
::hGif := FWGifWindow( cFileName, nOR( WS_CHILD, WS_VISIBLE ), 0, 0, ::nWidth, ::nHeight, ::hWnd, 1 )
return selfour best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5Njk4MDc1OQ?src=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5Njk4MDc1OQ?src=global9