set busy cursor

Questions, tips and tricks and techniques for scripting in Servoy

set busy cursor

Postby Hans Nieuwenhuis » Sun Jun 10, 2012 9:40 am

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,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: set busy cursor

Postby jbrancoIF » Mon Jun 11, 2012 8:58 am

João
InfoForm SA

Servoy 2021.03
jbrancoIF
 
Posts: 68
Joined: Tue Jan 10, 2012 11:29 am

Re: set busy cursor

Postby lwjwillemsen » Mon Jun 11, 2012 9:46 am

This (IUIBlocker) should be exposed to us programmers through Servoy (-plugin ?) itself. Basic functionality IMHO.

Regards,
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: set busy cursor

Postby Hans Nieuwenhuis » Mon Jun 11, 2012 10:15 am

+1
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: set busy cursor

Postby Harjo » Mon Jun 11, 2012 10:59 am

+1
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

Re: set busy cursor

Postby Hans Nieuwenhuis » Mon Jun 11, 2012 11:09 am

This is the only thing that I am missing now in Servoy comparing it to Oracle Forms.

And that is a BIG compliment !!
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: set busy cursor

Postby lwjwillemsen » Mon Jun 11, 2012 11:19 am

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 ?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: set busy cursor

Postby Hans Nieuwenhuis » Wed Aug 01, 2012 8:51 am

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 !
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: set busy cursor

Postby tgs » Mon Aug 27, 2012 7:36 pm

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,
Thomas Schnaus
SAN Developer
yomotec GmbH
User avatar
tgs
 
Posts: 886
Joined: Wed Oct 04, 2006 12:05 pm
Location: Germany

Re: set busy cursor

Postby ptalbot » Mon Aug 27, 2012 8:25 pm

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.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: set busy cursor

Postby tgs » Mon Aug 27, 2012 8:44 pm

Hi Patrick,

I'm using it in the Smart Client!


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

Re: set busy cursor

Postby ptalbot » Mon Aug 27, 2012 8:49 pm

Ah, OK. Sorry. I'll have a look then.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: set busy cursor

Postby ptalbot » Mon Aug 27, 2012 9:43 pm

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?
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests