Page 1 of 1

Progress with error

Posted: Wed Jun 08, 2022 2:31 pm
by marca
Exact example of the problem



I changed the array to a value of 168 elements and had it run


function Main()

local oDlg, oProg1, oProg2

DEFINE DIALOG oDlg TITLE "Progress Bars"

@ 1, 1 PROGRESS oProg1 SIZE 80, 12

@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL

@ 3, 9 BUTTON "Ok" ACTION oDlg:End()

oDlg:bStart = { || Increase( oProg1, oProg2 ) }

ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( oProg1:SetRange( 0, 168 ), oProg1:SetStep( 1 ),;
oProg2:SetRange( 0, 168 ), oProg2:SetStep( 1 ) )

return nil

function Increase( oProg1, oProg2 )

local n

for n = 1 to 168 // 111
// oProg1:StepIt()
// oProg2:StepIt()
oProg1:SetPos( n )
oProg2:SetPos( n )
Sleep( 50 )
SysRefresh()
next

Re: Progress with error

Posted: Wed Jun 08, 2022 3:42 pm
by cmsoft
Marcelo:
What is the problem that gives you?
The size of is different, one is 50 and the other is 80...

Re: Progress with error

Posted: Wed Jun 08, 2022 3:59 pm
by marca
cmsoft wrote:Marcelo:
What is the problem that gives you?
The size of is different, one is 50 and the other is 80...

hello Cesar
Sleep( 50 ) does not interfere with anything can remove the problem continues.
The bar does not complete

Re: Progress with error

Posted: Wed Jun 08, 2022 4:00 pm
by cmsoft
Prueba si te sirve des esta forma, usando METER

Code: Select all | Expand


#include "fivewin.ch"

function Main()

local oDlg, oProg1, oProg2, i := 0

DEFINE DIALOG oDlg TITLE "Progress Bars" FROM 05,18 TO 17,62

//@ 1, 1 PROGRESS oProg1 SIZE 50, 12

@ 05,10 METER oProg1 VAR i TOTAL 168 OF oDlg SIZE 90,12 NOPERCENTAGE;
      BARCOLOR nRGB(105,98,255),nRGB(0,0,0) PIXEL

@ 20,50 METER oProg2 VAR i TOTAL 168 OF oDlg SIZE 50,50 CIRCULAR NOPERCENTAGE;
      BARCOLOR nRGB(155,20,255),nRGB(0,0,0)  PIXEL

//@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL

@ 75, 70 BUTTON "Ok" ACTION oDlg:End() PIXEL

oDlg:bStart = { || Increase( oProg1, oProg2 ) }

ACTIVATE DIALOG oDlg CENTER

return nil

function Increase( oProg1, oProg2 )

local n
oProg1:Set(0)
oProg2:Set(0)
for n = 1 to 168 // 111
// oProg1:StepIt()
// oProg2:StepIt()
oProg1:Set( n )
oProg2:Set( n )
Sleep( 20 )
SysRefresh()
next
RETURN nil

Re: Progress with error

Posted: Wed Jun 08, 2022 7:16 pm
by marca
cmsoft wrote:Prueba si te sirve des esta forma, usando METER

Code: Select all | Expand


#include "fivewin.ch"

function Main()

local oDlg, oProg1, oProg2, i := 0

DEFINE DIALOG oDlg TITLE "Progress Bars" FROM 05,18 TO 17,62

//@ 1, 1 PROGRESS oProg1 SIZE 50, 12

@ 05,10 METER oProg1 VAR i TOTAL 168 OF oDlg SIZE 90,12 NOPERCENTAGE;
      BARCOLOR nRGB(105,98,255),nRGB(0,0,0) PIXEL

@ 20,50 METER oProg2 VAR i TOTAL 168 OF oDlg SIZE 50,50 CIRCULAR NOPERCENTAGE;
      BARCOLOR nRGB(155,20,255),nRGB(0,0,0)  PIXEL

//@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL

@ 75, 70 BUTTON "Ok" ACTION oDlg:End() PIXEL

oDlg:bStart = { || Increase( oProg1, oProg2 ) }

ACTIVATE DIALOG oDlg CENTER

return nil

function Increase( oProg1, oProg2 )

local n
oProg1:Set(0)
oProg2:Set(0)
for n = 1 to 168 // 111
// oProg1:StepIt()
// oProg2:StepIt()
oProg1:Set( n )
oProg2:Set( n )
Sleep( 20 )
SysRefresh()
next
RETURN nil




Meter I know it works I want to use progress which is newer

Re: Progress with error

Posted: Wed Jun 08, 2022 8:43 pm
by Enrico Maria Giordano
marca wrote:The bar does not complete


Your sample works perfectly right here using latest FWH version.

EMG

Re: Progress with error

Posted: Wed Jun 08, 2022 10:15 pm
by cmsoft
A mi tambien me funciona bien tu ejemplo

Re: Progress with error

Posted: Thu Jun 09, 2022 2:55 pm
by marca
Enrico Maria Giordano wrote:
marca wrote:The bar does not complete


Your sample works perfectly right here using latest FWH version.

EMG


I don't know how to put the image here but mine is missing a part of the bar to fill.
My version is 1402

Re: Progress with error

Posted: Thu Jun 09, 2022 7:05 pm
by karinha

Code: Select all | Expand


#Include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, oProg1, oProg2, i := 0

   DEFINE DIALOG oDlg TITLE "Progress Bars" FROM 05, 18 TO 17, 62

   @05, 10 METEREX oProg1 VAR I OF oDlg SIZE 90, 12 PIXEL TOTAL 100 ROUND ROUNDSIZE 6  ;
      GRADIENT CHUNK { { 1/2, nRGB( 255, 251, 229 ), nRGB( 250, 223, 143 ) } , ;
                       { 1/2, nRGB( 244, 194,  51 ), nRGB( 252, 235,  173 ) } };
      GRADIENT TRACK { { 1/2, nRGB( 198, 203, 213 ), nRGB( 219, 224, 233 ) },  ;
                       { 1/2, nRGB( 224, 238, 237 ), nRGB( 224, 238,237 ) } }


   @20, 50 METEREX oProg2 VAR I OF oDlg SIZE 50, 50 PIXEL TOTAL 100 ROUND ROUNDSIZE 6  ;
      GRADIENT CHUNK { { 1/2, nRGB( 255, 251, 229 ), nRGB( 250, 223, 143 ) } , ;
                       { 1/2, nRGB( 244, 194,  51 ), nRGB( 252, 235,  173 ) } };
      GRADIENT TRACK { { 1/2, nRGB( 198, 203, 213 ), nRGB( 219, 224, 233 ) },  ;
                       { 1/2, nRGB( 224, 238, 237 ), nRGB( 224, 238,237 ) } }

   /*
      GRADIENT CHUNK { { 1/2, nRGB( 255, 251, 229 ), nRGB( 250, 223, 143 ) } , ;
                       { 1/2, nRGB( 244, 194,  51 ), nRGB( 252, 235,  173 ) } }
   */


   @ 75, 70 BUTTON "Ok" ACTION( oDlg:End() ) PIXEL

   oDlg:bStart = {|| Increase( oProg1, oProg2 ) }

   ACTIVATE DIALOG oDlg CENTER

RETURN NIL

FUNCTION Increase( oProg1, oProg2 )

   LOCAL n

   oProg1:Set( 0 )
   oProg2:Set( 0 )

   FOR n = 1 TO 100

      SysRefresh()

      oProg1:Set( n )
      oProg2:Set( n )

      Sleep( 20 )

   NEXT

RETURN NIL
 


Regards, saludos.

Re: Progress with error

Posted: Fri Jun 10, 2022 7:52 am
by Silvio.Falconi
Here not run ok ( windows 10 ) see the video


I tried

Code: Select all | Expand

@05, 10 METEREX oProg1 VAR I OF oDlg SIZE 90, 12 PIXEL TOTAL 100 ROUND ROUNDSIZE 6  ;
      GRADIENT CHUNK { { 1/2, nRGB( 255, 251, 229 ), nRGB( 250, 223, 143 ) } , ;
                       { 1/2, nRGB( 244, 194,  51 ), nRGB( 252, 235,  173 ) } };
      GRADIENT TRACK { { 1/2, nRGB( 198, 203, 213 ), nRGB( 219, 224, 233 ) },  ;
                       { 1/2, nRGB( 224, 238, 237 ), nRGB( 224, 238,237 ) } }




Image


Make the same also the circular

Code: Select all | Expand

@ 20,50 METER oProg2 VAR i TOTAL 168 OF oDlg SIZE 50,50 CIRCULAR NOPERCENTAGE;
      BARCOLOR nRGB(155,20,255),nRGB(0,0,0)  PIXEL

Re: Progress with error

Posted: Fri Jun 10, 2022 1:58 pm
by karinha
Silvio, change:

// Sleep( 20 )

for

SysWait( 01 )

Regards, saludos.

Re: Progress with error

Posted: Fri Jun 10, 2022 2:41 pm
by Silvio.Falconi
karinha wrote:Silvio, change:

// Sleep( 20 )

for

SysWait( 01 )

Regards, saludos.


????????????????????????????????????????????

Re: Progress with error

Posted: Fri Jun 10, 2022 2:58 pm
by cmsoft
Silvio, puedes mostrar tu codigo?

Code: Select all | Expand


#include "fivewin.ch"

function Main()

local oDlg, oProg1, oProg2, i := 0

DEFINE DIALOG oDlg TITLE "Progress Bars" FROM 05,18 TO 17,62

//@ 1, 1 PROGRESS oProg1 SIZE 50, 12

@ 05,10 METER oProg1 VAR i TOTAL 168 OF oDlg SIZE 90,12 NOPERCENTAGE;
      BARCOLOR nRGB(105,98,255),nRGB(0,0,0) PIXEL

@ 20,50 METER oProg2 VAR i TOTAL 168 OF oDlg SIZE 50,50 CIRCULAR NOPERCENTAGE;
      BARCOLOR nRGB(155,20,255),nRGB(0,0,0)  PIXEL

//@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL

@ 75, 70 BUTTON "Ok" ACTION oDlg:End() PIXEL

oDlg:bStart = { || Increase( oProg1, oProg2 ) }

ACTIVATE DIALOG oDlg CENTER

return nil

function Increase( oProg1, oProg2 )

local n
oProg1:Set(0)
oProg2:Set(0)
for n = 1 to 168 // 111
// oProg1:StepIt()
// oProg2:StepIt()
oProg1:Set( n )
oProg2:Set( n )
Sleep( 20 )
SysRefresh()
next
RETURN nil

Este tampoco te funciona?

Re: Progress with error

Posted: Fri Jun 10, 2022 10:12 pm
by Silvio.Falconi
cmsoft wrote:Silvio, puedes mostrar tu codigo?

Code: Select all | Expand


#include "fivewin.ch"

function Main()

local oDlg, oProg1, oProg2, i := 0

DEFINE DIALOG oDlg TITLE "Progress Bars" FROM 05,18 TO 17,62

//@ 1, 1 PROGRESS oProg1 SIZE 50, 12

@ 05,10 METER oProg1 VAR i TOTAL 168 OF oDlg SIZE 90,12 NOPERCENTAGE;
      BARCOLOR nRGB(105,98,255),nRGB(0,0,0) PIXEL

@ 20,50 METER oProg2 VAR i TOTAL 168 OF oDlg SIZE 50,50 CIRCULAR NOPERCENTAGE;
      BARCOLOR nRGB(155,20,255),nRGB(0,0,0)  PIXEL

//@ 1, 20 PROGRESS oProg2 SIZE 12, 50 VERTICAL

@ 75, 70 BUTTON "Ok" ACTION oDlg:End() PIXEL

oDlg:bStart = { || Increase( oProg1, oProg2 ) }

ACTIVATE DIALOG oDlg CENTER

return nil

function Increase( oProg1, oProg2 )

local n
oProg1:Set(0)
oProg2:Set(0)
for n = 1 to 168 // 111
// oProg1:StepIt()
// oProg2:StepIt()
oProg1:Set( n )
oProg2:Set( n )
Sleep( 20 )
SysRefresh()
next
RETURN nil

Este tampoco te funciona?

I resolved with viewtopic.php?f=3&t=41886&sid=79bc9c8d1426005a6e34361081532558#p251085