Page 1 of 2

How to define a gif from RC file with @say

PostPosted: Thu Oct 08, 2009 8:14 pm
by sambomb
Hi, I want to make a "fake" progress bar to use like a MsgRun()

In this I will use five bitmaps, each featuring a part of a continuous progress bar, and a Timer to change between each one so I don't need to know the time and my user's will know that the program has not crashed

My trouble is:
Change or do something like MsgRun()
Find or do the bitmaps
Use everything in @say
Do it compatible with five 2.6


Anyone want to try?


Ex:
■■□□□□□□□□
□■■□□□□□□□
□□■■□□□□□□
□□□■■□□□□□
□□□□■■□□□□
□□□□□■■□□□
□□□□□□■■□□
□□□□□□□■■□
□□□□□□□□■■
□□□□□□□■■□
□□□□□□■■□□
□□□□□■■□□□
□□□□■■□□□□
□□□■■□□□□□
□□■■□□□□□□
□■■□□□□□□□
■■□□□□□□□□

Re: How to make a "Fake progress bar"

PostPosted: Thu Oct 08, 2009 9:04 pm
by Otto
Have you had a look at the Fivewin sample <filecopy.prg>
Best regards,
Otto


Image

Code: Select all  Expand view
// Using system AVIs

#include "FiveWin.ch"

function Main()

   local oDlg, oAvi

   DEFINE DIALOG oDlg TITLE "Copying files..."

   @ 1, 1 VIDEO oAvi FILE "..\avis\download.avi" SIZE 134, 30 NOBORDER

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT oAvi:Play()

return nil

Re: How to make a "Fake progress bar"

PostPosted: Fri Oct 09, 2009 9:53 am
by Silvio
on Olivares site there is old canal5 meter class

Re: How to make a "Fake progress bar"

PostPosted: Fri Oct 09, 2009 1:23 pm
by sambomb
@Otto, thanks an Avi or maybe just a GIF will be better than many bitmaps more the timer...

@Silvio, I don't have an open internet, could you post the code here?

Re: How to make a "Fake progress bar"

PostPosted: Fri Oct 09, 2009 4:59 pm
by sambomb
There is the code until now:

Code: Select all  Expand view

****************************************************************************
static function MsgGif(cCaption, cTitle, bAction)
****************************************************************************
*
* Apresentar mensagem de espera com barra de progresso continua
* Parametros: cCaption, cTitle, bAction
* Retorno: cTempoDecorrido
*
* Autor: Samir
* 9/10/2009 - 13:43:50
*
****************************************************************************

local cTempoInicial := "". cTempoFinal := "", cTempoDecorrido := ""

LOCAL oDlg, nWidth

cTempoInicial := Time()

DEFAULT cCaption := "Please, wait...",;
bAction := { || WaitSeconds( 1 ) }

IF cTitle == NIL

DEFINE DIALOG oDlg ;
FROM 0,0 TO 3, Len( cCaption ) + 4 ;
STYLE nOr( DS_MODALFRAME, WS_POPUP )
ELSE

DEFINE DIALOG oDlg ;
FROM 0,0 TO 4, Max( Len( cCaption ), Len( cTitle ) ) + 4 ;
TITLE cTitle ;
STYLE DS_MODALFRAME
ENDIF

oDlg:bStart := { || Eval( bAction, oDlg ), oDlg:End(), SysRefresh() }
oDlg:cMsg := cCaption

nWidth := oDlg:nRight - oDlg:nLeft

ACTIVATE DIALOG oDlg;
CENTER ;
ON PAINT oDlg:Say( 11, 0, xPadC( oDlg:cMsg, nWidth ),,,, .T. )

cTempoFinal := Time()

cTempoDecorrido := ElapTime(cTempoFinal,cTempoInicial)

Return cTempoDecorrido

/*------------------------------------------------------------------------*/
 


The size of the gif is 88x13, how to add him from the RC File?

Re: How to define a gif from RC file with @say

PostPosted: Fri Oct 09, 2009 7:33 pm
by Silvio
I cannot post here

Re: How to define a gif from RC file with @say

PostPosted: Fri Oct 09, 2009 7:42 pm
by sambomb
Silvio wrote:I cannot post here


Post how to insert the gif in this code that I posted, loading the gif from a RC file

Re: How to define a gif from RC file with @say

PostPosted: Sat Oct 10, 2009 7:22 am
by Silvio
If you use PellesC I think you can inser a gif on Rc
Or you can use many BMPs to create a animation
Many Year ago Someone ( I cannot called he here) created something of that you want create
This man is Fernandez Garcia called P***.
I cannot post here his class.
But if you search on Olivares Site you can found it

Re: How to define a gif from RC file with @say

PostPosted: Sat Oct 10, 2009 7:23 am
by Silvio
But I say to you to use many bitmaps no gif

Re: How to define a gif from RC file with @say

PostPosted: Tue Oct 13, 2009 11:26 am
by sambomb
Silvio, how to add to the RC I know, but don't know how to invoke the gif and animate him in my code.

Re: How to define a gif from RC file with @say

PostPosted: Tue Oct 13, 2009 11:55 am
by James Bott
> but don't know how to invoke the gif and animate him in my code

How about just converting the animated GIF to AVI?

James

Re: How to define a gif from RC file with @say

PostPosted: Tue Oct 13, 2009 1:02 pm
by sambomb
Hi James, this is a possible solution, but I don't know how to invoke an AVI from resource too... can you post an example?

Re: How to define a gif from RC file with @say

PostPosted: Tue Oct 13, 2009 1:21 pm
by James Bott
Why must the AVI be in a resource file?

James

Re: How to define a gif from RC file with @say

PostPosted: Tue Oct 13, 2009 2:50 pm
by sambomb
Because I wanna that the file will be inside the exe, so I must use resource....

Re: How to define a gif from RC file with @say

PostPosted: Tue Oct 13, 2009 2:57 pm
by James Bott
>Because I wanna that the file will be inside the exe, so I must use resource....

Sometimes the level of effort required is not worth the return on the investment.

Personally, I wouldn't want to put a large AVI or GIF into the EXE. The animation will likely be larger than the EXE.

James