Control Animations

LANSA Version 13 SP2

Control Animations


Control animations allow for much more varied animations. There are move, fade, rotate, scale and many more types of animation, each of which can be used to affect the state of a specific control.

Importantly however, animations cannot put a control in state that cannot be described by the properties of the control. So, while a control’s properties are not being updated during the animation, when complete the animation the control is still subject to the normal Visual LANSA rules.

For a simple example, a button that is positioned by a layout can still be moved by an animation to or from a given point, but when the animation finishes the layout will again take control and position the button.

For simplicity, some animations are available as features of controls.

Evtroutine Handling(#Button.Click)

#Button.Scale(200)

#Button.FadeOut

Endroutine

 

The code above will start scaling the button to twice its width and then start fading out.

More complex animations can be achieved by building composite animations that move multiple controls

Define_Com Class(#prim_anim) Name(#Animation)

Define_Com Class(#Prim_anim.Opacity) Name(#ShowBanner) Duration(2000) Manage(#Banner) Opacity(100) Parent(#Animation)

Define_Com Class(#Prim_anim.opacity) Na`me(#ShowGlobe) Duration(2000) Manage(#Globe) Opacity(100) Parent(#Animation)

Define_Com Class(#Prim_anim.MoveFrom) Name(#BannerInFromLeft) Duration(2000) Manage(#Banner) Parent(#Animation)

Define_Com Class(#Prim_anim.MoveFrom) Name(#GlobeInFromBelow) Duration(2000) Manage(#Globe) Parent(#Animation)

 

This example is taken from the DirectX Sample splash screen. It takes 2 seconds to make a Banner and Globe 100% opaque while at the same moving them from off the screen in to view.

Complex animations may have many component pieces and all will be executed when the animation starts. Each piece has a StartTime property that can be modified so that the animation can run in a specific sequence.