FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to define a gif from RC file with @say
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
How to define a gif from RC file with @say
Posted: Thu Oct 08, 2009 08: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:
â– â– â–¡â–¡â–¡â–¡â–¡â–¡â–¡â–¡
â–¡â– â– â–¡â–¡â–¡â–¡â–¡â–¡â–¡
â–¡â–¡â– â– â–¡â–¡â–¡â–¡â–¡â–¡
â–¡â–¡â–¡â– â– â–¡â–¡â–¡â–¡â–¡
â–¡â–¡â–¡â–¡â– â– â–¡â–¡â–¡â–¡
â–¡â–¡â–¡â–¡â–¡â– â– â–¡â–¡â–¡
â–¡â–¡â–¡â–¡â–¡â–¡â– â– â–¡â–¡
â–¡â–¡â–¡â–¡â–¡â–¡â–¡â– â– â–¡
â–¡â–¡â–¡â–¡â–¡â–¡â–¡â–¡â– â– 
â–¡â–¡â–¡â–¡â–¡â–¡â–¡â– â– â–¡
â–¡â–¡â–¡â–¡â–¡â–¡â– â– â–¡â–¡
â–¡â–¡â–¡â–¡â–¡â– â– â–¡â–¡â–¡
â–¡â–¡â–¡â–¡â– â– â–¡â–¡â–¡â–¡
â–¡â–¡â–¡â– â– â–¡â–¡â–¡â–¡â–¡
â–¡â–¡â– â– â–¡â–¡â–¡â–¡â–¡â–¡
â–¡â– â– â–¡â–¡â–¡â–¡â–¡â–¡â–¡
â– â– â–¡â–¡â–¡â–¡â–¡â–¡â–¡â–¡

Email: SamirSSabreu@gmail.com
xHarbour 1.2.3 + Fwhh 20.2
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: How to make a "Fake progress bar"
Posted: Thu Oct 08, 2009 09:04 PM
Have you had a look at the Fivewin sample <filecopy.prg>
Best regards,
Otto




Code (fw): Select all Collapse
// 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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How to make a &quot;Fake progress bar&quot;
Posted: Fri Oct 09, 2009 09:53 AM

on Olivares site there is old canal5 meter class

Best Regards, Saludos



Falconi Silvio
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to make a &quot;Fake progress bar&quot;
Posted: Fri Oct 09, 2009 01: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
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to make a &quot;Fake progress bar&quot;
Posted: Fri Oct 09, 2009 04:59 PM
There is the code until now:

Code (fw): Select all Collapse
****************************************************************************
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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How to define a gif from RC file with @say
Posted: Fri Oct 09, 2009 07:33 PM

I cannot post here

Best Regards, Saludos



Falconi Silvio
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to define a gif from RC file with @say
Posted: Fri Oct 09, 2009 07: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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How to define a gif from RC file with @say
Posted: Sat Oct 10, 2009 07: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
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: How to define a gif from RC file with @say
Posted: Sat Oct 10, 2009 07:23 AM

But I say to you to use many bitmaps no gif

Best Regards, Saludos



Falconi Silvio
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to define a gif from RC file with @say
Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: How to define a gif from RC file with @say
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to define a gif from RC file with @say
Posted: Tue Oct 13, 2009 01: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: How to define a gif from RC file with @say
Posted: Tue Oct 13, 2009 01:21 PM

Why must the AVI be in a resource file?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 389
Joined: Mon Oct 13, 2008 11:26 AM
Re: How to define a gif from RC file with @say
Posted: Tue Oct 13, 2009 02: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: How to define a gif from RC file with @say
Posted: Tue Oct 13, 2009 02: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10