Hi all
Attached you find another way of a StatusPanel which can be used during
long batch Processes for correctly displaying Informations and keeping
your Application reacting to Windows without the need of a sentinel.
The user can cancel the Loop with keyboard or by clicking the cancel
button. The Panel can be moved with the mouse over the screen, all
Repainting issues are done automatically. Also there are no longer any
"Not Reacting" displays from Windows, your Application seems to react
completely normaly. It is also possible to Task to another App and
reactivate your application even if the loop isn't finished.
By Pressing the F12 Key the user have the possibility to "freeze" the
display (new Informations are not displayed) which greatly improves the
speed of your loop. By pressing F12 the informations are displayed again.
The StatusPanel can display either 3 Lines of Information and a
ProgressBar (if desired) or 1 Information Line and a Standard Windows
Animation (like the FileCopy Animation of Windows Explorer). It is
necessary to repeatedly call the TestForCancel Function inside your loop.
This function is responsible for displaying everything correctly and also
checks for Keystrokes and Mouseclicks if the user want's to abort the
loop. Even if you don't want to have the possibility of canceling your
Loop you have to call this function to ensure, that everything is
repainted correctly and that the user can take the speed advantage of
freezing the display with F12.
For examples of usage look at the end Of the File. There you can find
commented examples of the different possibilities of this StatusPanel
Include this Package directly inside your ClientArea Object.
VERY IMPORTANT NOTICE:
Since VDF can not handle multiple Threads some techniques used within
this package are advanced and NOT! recommended if you are not exactly
know what are you doing. I use this StatusPanel without problems almost a
year now but i can't promise that it is working for everybody else. Use
it at your own risk, i highly recommend, that you test your Application
and this StatusPanel very deeply as i have done it for my app.
Also take notice, that there is no guarantee that this StatusPanel still
works (correctly) with upcoming Versions of Visual DataFlex.
If you keep this Information in mind all i can tell you is:
Have fun and i hope you like it!
Regards
Bernhard