Animate the change from one control to another |
Member of Container (PRIM_CPST)
Name | Type | Data Type | Description |
|---|---|---|---|
From | *Input | Control to be hidden | |
To | *Input | Control to be shown | |
TransitionType | *Input (Optional) | Enumeration | Type of animation |
Duration | *Input (Optional) | Integer | Number of milliseconds to take to complete the animation |
Delay | *Input (Optional) | Integer | Number of milliseconds to wait before starting the animation |
The Transition method will animate the hiding of one panel and the showing of another.
There are many different transitions available. Use AutoComplete or F2 in the IDE to obtain a complete list.
This example shows two panels transitioning when clicked
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(456) Width(864) Layoutmanager(#TableLayout2)
Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#Brush1)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(43:130:255)
Define_Com Class(#PRIM_VS.Style) Name(#Style2) Backgroundbrush(#Brush2)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush2) Color(255:146:40)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout2)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column2) Displayposition(1) Parent(#TableLayout2)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row2) Displayposition(1) Parent(#TableLayout2)
Define_Com Class(#PRIM_TBLO.Item) Name(#Panel1Item1) Column(#Column2) Manage(#Panel1) Parent(#TableLayout2) Row(#Row2) Margintop(20) Marginbottom(20) Marginleft(20) Marginright(20)
Define_Com Class(#PRIM_TBLO.Item) Name(#Panel1Item2) Column(#Column2) Manage(#Panel2) Parent(#TableLayout2) Row(#Row2) Margintop(20) Marginbottom(20) Marginleft(20) Marginright(20)
Define_Com Class(#PRIM_PANL) Name(#Panel1) Displayposition(1) Left(20) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(20) Layoutmanager(#TableLayout1) Height(416) Width(824) Style(#Style1)
Define_Com Class(#PRIM_PANL) Name(#Panel2) Displayposition(2) Left(20) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(20) Layoutmanager(#TableLayout1) Height(416) Width(824) Style(#Style2) Visible(False)
Evtroutine Handling(#Panel1.Click #Panel2.Click)
If (#Panel1.Visible)
#Com_owner.Transition( #Panel1 #Panel2 Fade )
Else
#Com_owner.Transition( #Panel2 #Panel1 Fade )
Endif
Endroutine
End_Com