Page 1 of 2
Progress Bar
Posted: Wed Jul 24, 2013 3:18 pm
by serge_girard
Hello All,
When I use the progressbar for a loop during about 3 minutes the program is showing the progressbar nice but when I click another program and then click the program with the progressbar it says: '<title> (doesn't react)' and the screen turns white and shows only the hourglass.
Is there a way to make the progressbar (and the rest) visible again?
See little example:
Code: Select all
#include "hmg.ch"
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 400 ;
TITLE 'Progressbar ' ;
MAIN
@ 10,10 BUTTON bt_1 CAPTION 'Progress_1' ACTION Progress_1() WIDTH 150 HEIGHT 20 FONT "Arial" SIZE 10 FLAT
@ 100,10 PROGRESSBAR Progress_1 ;
RANGE 0 , 65535 ;
WIDTH 200 ;
HEIGHT 30
END WINDOW
Setproperty('Form_1','Progress_1','Visible', .F. )
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
RETURN
function Progress_1()
Setproperty('Form_1','Progress_1','Visible', .T. )
Setproperty('Form_1','Progress_1','Value', 0 )
Setproperty('Form_1','Progress_1','RangeMax', 65535 )
FOR A = 1 TO 65535
Setproperty('Form_1','Progress_1','Value', A )
FOR B = 1 TO 10000
NEXT B
NEXT A
RETURN
Thx,
Serge
Re: Progress Bar
Posted: Wed Jul 24, 2013 4:29 pm
by esgici
Hi Serge
serge_girard wrote:
When I use the progressbar for a loop during about 3 minutes the program is showing the progressbar nice but when I click another program and then click the program with the progressbar it says: '<title> (doesn't react)' and the screen turns white and shows only the hourglass.
Is there a way to make the progressbar (and the rest) visible again?
Fortunately, yes :
Try using
DO EVENTS into innermost loop :
Code: Select all
FOR A = 1 TO 65535
Setproperty('Form_1','Progress_1','Value', A )
FOR B = 1 TO 10000
DO EVENTS // <----
NEXT B
NEXT A
Viva HMG

Re: Progress Bar
Posted: Thu Jul 25, 2013 7:46 am
by serge_girard
Thx Esgici !
What does the DO EVENT actually do more?
Is it possible to start a batch and then (at the sametime) another?
Merci!
Serge
Re: Progress Bar
Posted: Thu Jul 25, 2013 11:06 am
by esgici
Pas de quoi Serge
serge_girard wrote:
...What does the DO EVENT actually do more?...
It's a bit deep side of Window programming and I'm not an expert
As far as I understand:
- Window want periodically communicate with running programs
- If a running program ask something from OS, no problem, communication continues
- When a program running for own internal process ( such as indexing, copying large file etc ) don't ask something to OS and can't answer to Windows's requests
- When Window don't get answer or any order over a period from running program, adjudge that "this program not answer !"
- In this situation Windows don't obey some tasks previously asked by running program ( such as progress bar )
- DO EVENT command says to Windows : "I'm a bit busy; you, my slave, continue my previous order !"
I'm not sure correctness of all of this
Surely experts may give more adequate explications
Viva HMG

Re: Progress Bar
Posted: Thu Jul 25, 2013 11:28 am
by serge_girard
Hello,
I noticed that with DO EVENT the function pauses for the time you do something else.
In my case I had a large batch running with DBF updates etc. (and the DO EVENT).
The DO EVENT gave me the possibility to open a new form/function which has a CLOSE ALL statement by its release.
The last release did the CLOSE ALL and the running batch terminated with an error (Alias does not exist).
So my CLOSE ALL closed really ALL.... I will have to change it into CLOSE <file>.
Thx for the explanation!
Bye, Serge
Re: Progress Bar
Posted: Mon Oct 21, 2013 11:12 am
by danielmaximiliano
Hola Esgici :
esto es lo unico que encontre para el manejo de eventos dentro de windows.
Translate Google :
this is what I found there to handle events within windows.
http://msdn.microsoft.com/en-us/library ... vents.aspx" onclick="window.open(this.href);return false;
Re: Progress Bar
Posted: Mon Oct 21, 2013 11:23 am
by esgici
danielmaximiliano wrote:
this is what I found there to handle events within windows.
http://msdn.microsoft.com/en-us/library ... vents.aspx" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;" onclick="window.open(this.href);return false;
Gracias Daniel
Viva HMG amistad

Re: Progress Bar
Posted: Mon Oct 21, 2013 11:28 am
by danielmaximiliano
esgici wrote:
Gracias Daniel
Viva HMG amistad

Cada comentario hecho en el foro es un poco mas de conocimiento Esgici, intente buscar dentro del "Core" de harbour la funcion "Do Events" o "DoEvents()" sin ningun resultado.
cuando regrese a la tarde vere si lo encuentro mediante "TextCrawler".
Translate Google
Every comment made on the forum is a little more knowledge Esgici, try looking in the "Core" function harbor "Do Events" or "DoEvents ()" without any results.
when you return in the afternoon I'll see if I can find by "TextCrawler".
Re: Progress Bar
Posted: Mon Oct 21, 2013 11:47 am
by esgici
danielmaximiliano wrote:
Every comment made on the forum is a little more knowledge
You are right amigo
try looking in the "Core" function harbor "Do Events" or "DoEvents ()" without any results.
As far as know
Do Events is a HMG feature, not Harbour
when you return in the afternoon I'll see if I can find by "TextCrawler".
You need about two hours to noon, and here it's about three hours afternoon
Nevertheless I will wait of course
Viva HMG amistad

Re: Progress Bar
Posted: Mon Oct 21, 2013 10:27 pm
by danielmaximiliano
esgici wrote:
try looking in the "Core" function harbor "Do Events" or "DoEvents ()" without any results.
As far as know
Do Events is a HMG feature, not Harbour
Hola Esgici :
No encontre en HMG y Harbour funciones o procedimientos llamados "Events"
posiblemente este dentro de la API de Windows, posiblemente el amigo Clausio S. sepá más de este tema.
para mas referencia sobre el commando "DO"
Translate Google :
Hello Esgici:
I did not find in HMG and Harbour functions or procedures called "Events"
possibly this in Windows API, the friend Clausio S. Know more about this topic.
for more reference on the command "DO"
http://www.elektrosoft.it/tutorials/Har ... ide.htm#Do