Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 8th Jun 2007, 13:16
pallen pallen is offline
Registered Developer
 
Join Date: May 2007
Posts: 150
Default How to animate a Window.show()

In the Office Supply Catalog example, the Show Example IButton animates the Window.show() with a really nice outline and then minimizes back to the button when closed. How is this done?
Reply With Quote
  #2  
Old 8th Jun 2007, 14:41
Isomorphic Isomorphic is online now
Administrator
 
Join Date: May 2006
Posts: 30,555
Default

We're glad you like it
It's actually a pretty simple effect using the SmartClient animation APIs - all you need to do is:

- Create a visibility:"hidden" Canvas instance with a 2 px border (you can use a css class or the canvas.border property).
- Position it over the "launch" button and show it.
- Call 'animateRect()' passing in the desired final window size, and a callback method which hides the outline canvas and actually shows the window in question.

You can then override the 'closeClick' method on the window to
- hide the window and show the outline canvas
- use 'animateRect()' to shrink it back down to the size / position of the button, and then hide itself when the animation completes.

Take a look at the animation examples in the feature explorer and in the SDK [http://localhost:8080/examples/anima...gramming.html] for some more tips on using the SmartClient animation APIs.

Last edited by Isomorphic; 8th Jun 2007 at 14:54..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved