Page 2 of 3

Re: Index progress bar

Posted: Sun Feb 28, 2016 12:15 pm
by trmpluym
serge_girard wrote:Yes, I can!
S
Thanks again Serge. Tried on another pc and ..... yes it works like a charm ! So something must we wrong with the display driver on this specific computer. I will try to update the driver.

Now i am gonne try to combine my sample with the eval() function...

Re: Index progress bar

Posted: Sun Feb 28, 2016 12:21 pm
by Carlos Britos
Hi try moving do events to the end

For nX := 0 to 100 step 5

//////// DO EVENTS

frmProgress.Progress_1.Value := nX
frmProgress.Title := "Progress: " + Str(nX,3)+" %"

MILLISEC(1000)


DO EVENTS

Next

Re: Index progress bar

Posted: Sun Feb 28, 2016 12:35 pm
by trmpluym
Carlos Britos wrote:Hi try moving do events to the end

Next
I tried, same problem (on the first W7 pc). Also Serge experienced the same (wrong) behaviour on his W10 pc. Strange the progressbar seems to be pc dependant.

It does work when i use it like this:

DO EVENTS
frmProgress.Progress_1.Value := nX
MILLISEC(1000)
frmProgress.Title := "Progress: " + Str(nX,3)+" %"

Re: Index progress bar

Posted: Tue Jul 05, 2016 2:09 am
by cherianj
I too have a problem related to progress bar. When I use the progress bar, it displays correctly as long as I don't do a mouse click. If I click the mouse, the bar progress stops and the title says "Not Responding". Later the process gets completed without the progress bar moving. I am new to HMG. Any help appreciated.

Cherian

Re: Index progress bar

Posted: Tue Jul 05, 2016 5:04 am
by mol
Did you used DO EVENTS phrase?

Re: Index progress bar

Posted: Tue Jul 05, 2016 7:58 am
by trmpluym
cherianj,

Can you post sample code to demonstrate the problem ?

Theo

Re: Index progress bar

Posted: Fri Jul 08, 2016 2:16 am
by cherianj
Thanks for the response. I managed to solve it by using DO EVENTS.
Regards,

Cherian

Re: Index progress bar

Posted: Sat Mar 25, 2017 2:02 pm
by trmpluym
Pablo,

I am sorry to bother you again, but this long lasting problem is still frustrating me. If you can find the time, can you please have a look ?

The PROGRESSBAR control does not seems to update correctly on many pc's at the first and the last step, see:
2017-03-25 14_53_07-Progress_ 5.png
2017-03-25 14_53_07-Progress_ 5.png (1.22 KiB) Viewed 4444 times
2017-03-25 14_53_07-Progress_ 100.png
2017-03-25 14_53_07-Progress_ 100.png (3.08 KiB) Viewed 4444 times
Here is the updated code to reproduce the problem:

Code: Select all

#include "hmg.ch"

Function Main

DEFINE WINDOW Win_1 ;
   ROW 0 ;
   COL 0 ;
   WIDTH 640 ;
   HEIGHT 480 ;
   TITLE 'Test' ;
   WINDOWTYPE MAIN
   
DEFINE BUTTON btnAanpassen
ROW    400
COL    80
WIDTH  100
HEIGHT 28
CAPTION "Start"
ACTION StatusBar()
END BUTTON   

END WINDOW

Win_1.Center
Win_1.Activate

Return


Function StatusBar()

   DEFINE WINDOW frmProgress ;
   ROW 0 ;
   COL 0 ;
   WIDTH 355 ;
   HEIGHT 100 ;
   TITLE "Progress:" ;   
   WINDOWTYPE MODAL ;
   NOSYSMENU ;
   ONINIT StartTest()

   @ 20,20 PROGRESSBAR Progress_1 ;
     RANGE 0,100 ;                
     VALUE 0 ;
     WIDTH 300 HEIGHT 25 
   
   END WINDOW

   CENTER WINDOW frmProgress
   ACTIVATE WINDOW frmProgress
  
Return(.T.)


Function StartTest()
   
Local nX

For nX := 0 to 100 step 5
     
   DO EVENTS

   frmProgress.Progress_1.Value := nX

   frmProgress.Title := "Progress: " + Str(nX,3)+" %"      
   
   frmProgress.Progress_1.Refresh()

   DO EVENTS
             
   IF nX==5 .OR. nX==100
      MILLISEC(4000)
   ELSE 
      MILLISEC(1000)   
   ENDIF   
   
Next   

frmProgress.Release()

return(.T.)
Theo

Re: Index progress bar

Posted: Sat Mar 25, 2017 4:09 pm
by serge_girard
Hi, Theo

On my W7-32 machine it works perfectly. On my W10-32 only 5% is not displayed. 10-100% is displayed but RETARDED (at the wrong position: 100% is displayed on position of 95%).

I changed your code a bit to slow down a bit:

Code: Select all

For nX := 0 to 100 step 5
   DO EVENTS
   frmProgress.Progress_1.Value := nX
   frmProgress.Title := "Progress: " + Str(nX,3)+" %"      
   hb_idleSleep( 1.5 )
Next   
Maybe Claudio knows why?

Serge

Index progress bar

Posted: Sat Mar 25, 2017 10:12 pm
by Pablo César
Hi Theo. It's okay.

I have tested, but I changed the timer to MILLISEC(50) and remove both DO EVENTS from you demo code.
 
Screen149.png
Screen149.png (13.87 KiB) Viewed 4421 times
 
I noted, the problem. It seems not be with timer, not with DO EVENTS but the problem "quite" always occurs mostly the time in THEMED Windows.

Try with Classic, not themed Windows and then you will see never be in fault. Strange, very strange.

In the themed Windows, never reach on time to 100%. ie. the StartTest procedure ends before 80% and the begining of ProgressBar it's also compromised at starting to show the bar just only after the 5%.

Also note that the step also was reduced to 1. With no themed Windows, wroks perfectly all the time. At least here in Win7 32bits, not themed.

Probably Serge did not noted because he tested on not themed Windows like me.
I deduce this, because I saw captured screen from Serge and noted, he probably use not themed like me.
serge_girard wrote: Sun Feb 28, 2016 9:54 am Theo,

Your PRG seems OK to me. See att.

Image
I particular like not themed. It's a little faster and safe IMO.

So, you can test your code switching thmed or not...

Probably Dr. Claudio could tell us something for this.