Busy indication using a free plugin!

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Busy indication using a free plugin!

Postby paul » Wed Oct 25, 2006 10:08 pm

I have created a plugin to notify a user that a solution is busy.


It does so by changing to the busy cursor, blocking user input, and darkening the screen (glass pane) with a message. The glass pane can be optionally turned off.

Sample:
Code: Select all
//NOTE: BE SURE TO USE A TRY/FINALLY BLOCK! (or else an exception will cause the client to need a restart)
try{
   plugins.busy.busy('Processing... please wait.'); // show the message on a glass pane and in the status area. Also, show a busy cursor
   // or plugins.busy.busy('Processing... please wait.', false); // show the message in the status area (no glass pane). Also, show a busy cursor
   // or plugins.busy.busy(null, true); // show a blank glass pane and status area. Also, show a busy cursor
   // or plugins.busy.busy(); // just show a busy cursor

   // do some process intensive work here
   application.sleep(3000); //for example :)

}finally{
   plugins.busy.ready();
}


New: Cancel support!

Cancel test code (note: the third arg enables the cancel button):
Code: Select all

//NOTE: BE SURE TO USE A TRY/FINALLY BLOCK! (or else an exception will cause the client to need a restart)
try{
   for(var i=0;i<20;i++)
   {
      plugins.busy.busy('Processing... please wait. ' + i,true,true);
      application.sleep(500)
      if(plugins.busy.isCanceled())
      {
         plugins.busy.busy('Canceling...');
         application.sleep(400)
         break;
      }
   }
}finally{
   plugins.busy.ready();
}



Note: you can also use this as a progress indicator by calling the busy function multiple times to update the message.


The code has been tested on Mac OSX using Servoy 3.0
Should work on other platforms (in theory). Let me know if not :)[/b]
Attachments
busy.jar
Busy indicator plugin (with cancel support)
(7.74 KiB) Downloaded 828 times
cancel.jpg
Using the cancel option.
cancel.jpg (28.36 KiB) Viewed 22017 times
screenshot.jpg
screenshot.jpg (111.35 KiB) Viewed 22052 times
Last edited by paul on Thu Oct 26, 2006 5:17 pm, edited 1 time in total.
Paul
Information Technology
DNA Diagnostics Center
paul
 
Posts: 5
Joined: Tue Aug 29, 2006 4:51 pm
Location: Cincinnati, OH

Postby Harjo » Wed Oct 25, 2006 11:15 pm

works here on Windows XP! :D

Thanks for this great contribution!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby cybersack » Thu Oct 26, 2006 5:03 am

Ho does a user cancel out ?
User avatar
cybersack
 
Posts: 302
Joined: Sun Jan 02, 2005 1:17 am

Postby paul » Thu Oct 26, 2006 2:17 pm

cybersack wrote:Ho does a user cancel out ?


Currently the user cannot cancel out. It was designed to simply let the user know that the app is busy. I understand however, that it would be nice to have a way to cancel. The trick would be finding an easy (but elegant) way to notify the executing script that it has been canceled. I will check into adding this functionality but I cannot make any promises.
Paul
Information Technology
DNA Diagnostics Center
paul
 
Posts: 5
Joined: Tue Aug 29, 2006 4:51 pm
Location: Cincinnati, OH

Added cancel support

Postby paul » Thu Oct 26, 2006 5:18 pm

I have added cancel support! (see top post)

Hope this helps you out cybersack.
Paul
Information Technology
DNA Diagnostics Center
paul
 
Posts: 5
Joined: Tue Aug 29, 2006 4:51 pm
Location: Cincinnati, OH

Postby antonio » Sat Oct 28, 2006 11:26 pm

Great Plug, Paul! Thanks heaps for making it freely available.
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Postby kurtbleicken » Fri Mar 14, 2008 9:35 pm

Trying to use the "busy" plugin in a FID. When the script is running within the FID the glass pane covers the underlying form but does not protect the FID. How do I get it to cover/protect the FID? K
Kurt Bleicken
Servoy 7
Executive Director, onRamp for nonprofits
kurtbleicken@gmail.com
Founder, AgentSphere, LLC
kurtbleicken@gmail.com
603.525.8019
kurtbleicken
 
Posts: 100
Joined: Mon Feb 12, 2007 11:36 pm

Postby tgs » Thu Apr 10, 2008 10:30 am

Hello Paul,

your 'busy' plugin is a cool thing, but for me it only works in Servoy developer and not on the Client! What is wrong?

Regards, Thomas
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Postby Harjo » Thu Apr 10, 2008 11:33 am

hmm, that is strange, we use it almost a year now, in developer AND client.

what does not work? do you get an error??
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby tgs » Thu Apr 10, 2008 11:47 am

Hi Harjo!

In Client I get no error messge or something else. The methode (exporting over 10000 records to a .csv file) is working correct, the maus cursor is busy (rolling on mac) and the form is locked. I can live with this, but it would be nicer and more professional to get the dimmed screen.

Regards, Thomas
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Postby IT2Be » Thu Apr 10, 2008 11:54 am

In Client I get no error messge or something else. The methode (exporting over 10000 records to a .csv file) is working correct, the maus cursor is busy (rolling on mac) and the form is locked. I can live with this, but it would be nicer and more professional to get the dimmed screen.
Do you perform an application.updateUI() before you start your export?
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Harjo » Thu Apr 10, 2008 12:00 pm

or an application.sleep(500) just after the call.
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby tgs » Thu Apr 10, 2008 12:49 pm

Thank you guys!

I modified my methodes by performing 'application.updateUI()' and now it works!

Regards an thank you again for your fast reply, Thomas
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: Busy indication using a free plugin!

Postby markhooper » Thu Nov 27, 2008 1:02 am

Does this work for webclient ??

Thanks in advance
markhooper
 
Posts: 84
Joined: Fri May 30, 2008 7:28 pm
Location: Canada

Re: Busy indication using a free plugin!

Postby ars » Thu Nov 27, 2008 7:46 am

markhooper wrote:Does this work for webclient ??


Hope not.

However, one of the workaround will be showing a modal window with some progress bar(image) would be nice...

See for a preview, did right now...

BusyWindow.png
Preview of Busy Window
BusyWindow.png (60 KiB) Viewed 21062 times


Progress bar Image

ProgressBar.gif
Progress bar Image
ProgressBar.gif (10.57 KiB) Viewed 21099 times


If you would like to non-functional the close button, then you can also do the same by just returning false with the onHide event of the form. See this topic http://forum.servoy.com/viewtopic.php?p=51630

Hope it Helps.
Arup Sahoo

Servoy Developer and Consultant

Find me @ arup.sahooATgmail.com
Skype me @ arup.sahoo
GTalk me @ arup.sahoo
User avatar
ars
 
Posts: 213
Joined: Thu Jun 28, 2007 2:04 pm
Location: India

Next

Return to How To

Who is online

Users browsing this forum: No registered users and 6 guests