How to define a gif from RC file with @say

How to define a gif from RC file with @say

Postby sambomb » Thu Oct 08, 2009 8:14 pm

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:
■■□□□□□□□□
□■■□□□□□□□
□□■■□□□□□□
□□□■■□□□□□
□□□□■■□□□□
□□□□□■■□□□
□□□□□□■■□□
□□□□□□□■■□
□□□□□□□□■■
□□□□□□□■■□
□□□□□□■■□□
□□□□□■■□□□
□□□□■■□□□□
□□□■■□□□□□
□□■■□□□□□□
□■■□□□□□□□
■■□□□□□□□□
Last edited by sambomb on Fri Oct 09, 2009 5:39 pm, edited 1 time in total.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: How to make a "Fake progress bar"

Postby Otto » Thu Oct 08, 2009 9:04 pm

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: How to make a "Fake progress bar"

Postby Silvio » Fri Oct 09, 2009 9:53 am

on Olivares site there is old canal5 meter class
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: How to make a "Fake progress bar"

Postby sambomb » Fri Oct 09, 2009 1:23 pm

@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?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

Re: How to make a "Fake progress bar"

Postby sambomb » Fri Oct 09, 2009 4:59 pm

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?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

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

Postby Silvio » Fri Oct 09, 2009 7:33 pm

I cannot post here
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

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

Postby sambomb » Fri Oct 09, 2009 7:42 pm

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
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

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

Postby Silvio » Sat Oct 10, 2009 7:22 am

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
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

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

Postby Silvio » Sat Oct 10, 2009 7:23 am

But I say to you to use many bitmaps no gif
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

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

Postby sambomb » Tue Oct 13, 2009 11:26 am

Silvio, how to add to the RC I know, but don't know how to invoke the gif and animate him in my code.
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

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

Postby James Bott » Tue Oct 13, 2009 11:55 am

> 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

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

Postby sambomb » Tue Oct 13, 2009 1:02 pm

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?
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

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

Postby James Bott » Tue Oct 13, 2009 1:21 pm

Why must the AVI be in a resource file?

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

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

Postby sambomb » Tue Oct 13, 2009 2:50 pm

Because I wanna that the file will be inside the exe, so I must use resource....
Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
User avatar
sambomb
 
Posts: 388
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil

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

Postby James Bott » Tue Oct 13, 2009 2:57 pm

>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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 51 guests