Greetings to the entire community, I am still working in korea until later this year, I've been a little absent, but here I leave a new tool, I hope to finish this new class to the "build" of December, I leave an example of it:
The class is small but with enough force
Inherited from TControl (-> TWindow) so we can make use of all control Codeblock events: D
I've used only 3 for this example
GIF LClicked = Changes for another (GetFile)
RClicked = Stop / Play Gif
Mouse Move = Show in Window title bar the GIF name where the event is generated
I've only tested in windows 7
http://www.sitasoft.com/fivewin/test/giftest.zip
The class is small but with enough force
Inherited from TControl (-> TWindow) so we can make use of all control Codeblock events: D
I've used only 3 for this example
GIF LClicked = Changes for another (GetFile)
RClicked = Stop / Play Gif
Mouse Move = Show in Window title bar the GIF name where the event is generated
I've only tested in windows 7
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