Page 1 of 1

set busy cursor

PostPosted: Sun Jun 10, 2012 9:40 am
by Hans Nieuwenhuis
Hi,

I want to do somehing like :

Code: Select all
try {
  component.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
  doProcessing();
} finally {
  component.setCursor(Cursor.getDefaultCursor());
}



in my method.
Is that possible ??
I know the busy plugin exists, but I'd like to do it another way.
This way I do not have to change existing code.

Regards,

Re: set busy cursor

PostPosted: Mon Jun 11, 2012 8:58 am
by jbrancoIF

Re: set busy cursor

PostPosted: Mon Jun 11, 2012 9:46 am
by lwjwillemsen
This (IUIBlocker) should be exposed to us programmers through Servoy (-plugin ?) itself. Basic functionality IMHO.

Regards,

Re: set busy cursor

PostPosted: Mon Jun 11, 2012 10:15 am
by Hans Nieuwenhuis
+1

Re: set busy cursor

PostPosted: Mon Jun 11, 2012 10:59 am
by Harjo
+1

Re: set busy cursor

PostPosted: Mon Jun 11, 2012 11:09 am
by Hans Nieuwenhuis
This is the only thing that I am missing now in Servoy comparing it to Oracle Forms.

And that is a BIG compliment !!

Re: set busy cursor

PostPosted: Mon Jun 11, 2012 11:19 am
by lwjwillemsen
Yep, and it looks as if the IUIBlocker should work in both Smartclient and Webclient !

Oh, now I am reading in the IUIBlocker doc :
Block the Graphical User Interface, don't let any cmds happen, cursor is set to wait cursor.


What would 'don't let any cmds happen' mean ? No processing in code or just no UI commands ?

Re: set busy cursor

PostPosted: Wed Aug 01, 2012 8:51 am
by Hans Nieuwenhuis
Hi,

Johan Compagner made an addition tot the Busy plugin
Now You can simply show a busy cursor and a normal cursor (smart client).
https://www.servoyforge.net/news/279

Code: Select all
function setBusyNormal(event) {
   try
   {
      plugins.busy.showWaitCursor()
      // Your code
      //
      plugins.busy.showDefaultCursor()
   }
   finally
   {
      plugins.busy.showDefaultCursor()
   }
}



Thanks Johan !

Re: set busy cursor

PostPosted: Mon Aug 27, 2012 7:36 pm
by tgs
Hi,

this code
Code: Select all
plugins.busy.showWaitCursor()
   try {
      // some code
   } finally {
      plugins.busy.showDefaultCursor()
   }

does not show a busy cursor in my solution (Servoy 6.0.7, win 7, java 1.6.0_33).
If I use the plugins.busy.block(parameters) and plugins.busy.unblock() function the cursor get busy (circle).

Regards,

Re: set busy cursor

PostPosted: Mon Aug 27, 2012 8:25 pm
by ptalbot
Please note that these 2 functions are not web enabled. This comes from a patch that Johan pushed at a client request for Smart client only.

Re: set busy cursor

PostPosted: Mon Aug 27, 2012 8:44 pm
by tgs
Hi Patrick,

I'm using it in the Smart Client!


Regards,

Re: set busy cursor

PostPosted: Mon Aug 27, 2012 8:49 pm
by ptalbot
Ah, OK. Sorry. I'll have a look then.

Re: set busy cursor

PostPosted: Mon Aug 27, 2012 9:43 pm
by ptalbot
Just tried on Win 7, Java 1.6.0_33 (32 and 64-bit), Servoy 6.0.7 in Developer AND real Smart Client and this worked fine for me with this code:
Code: Select all
   plugins.busy.showWaitCursor();
   try {
      for (var i = 0; i < 10; i++) {
         application.sleep(500);
         application.output(i+1);
      }
   } finally {
      plugins.busy.showDefaultCursor()
   }


So I'm wondering what's the context of your call. Are you calling it from a method that already blocked the UI? Is it in a dialog?
And what do your "// some code" do in your case?