GH_Stack
ReferencesRepresents a manager for animating asynchronous box movements. This is a useful feature for GUIs that want to mimic physical behaviour or continuous UI changes.
Remarks: This class is ABSOLUTELY NOT Thread-safe.
Constructors
Properties
Duration
#Gets or sets the duration (in milliseconds) of individual frame animations. This change is only applied to new animations. Existing animations will keep the duration set at construction.
Element_Final
#Gets or sets the target dimenions of the stack element at the given index. If you overwrite the existing value with a different value, a new animation will be initiated for this stack element. If you wish to retrieve the current (based on system time) stack element dimensions, you should use the Intermediate readonly property.
Parameters:
| index (int) | Index of stack element. |
Exceptions:
| IndexOutOfRangeException | Thrown if index does not represent a valid index in the stack. |
Element_Initial
#Gets the starting dimensions of the stack element at the given index.
Parameters:
| index (int) | Index of stack element. |
Exceptions:
| IndexOutOfRangeException | Thrown if index does not represent a valid index in the stack. |
Element_Intermediate
#Gets the intermediate dimensions for the specified physical stack element as determined by the current system time.
Parameters:
| index (int) | Index of stack element. |
InMotion
#Gets a value that indicates whether or not any element in this stack is currently in motion.
Returns: True if the stack is still (partly) in motion.
InMotion
#Gets a value that indicates whether or not the element at the given index is currently in motion.
Parameters:
| index (int) | Index of element. |
Returns: True if the element hasn't yet reached its final location.
Interpolation
#public GH_Interpolation Interpolation { get; set; }
Gets or sets the interpolation mode for stack animations. Cubic results in a more natural motion. Although you can change the interpolation during animation, it might result in a discontinuous motion. You should set the desired interpolation algorithm during or directly after construction of this stack.
UpdateInterval
#Gets or sets the interval (in milliseconds) for update events.
Value: The number of milliseconds between update intervals.
Exceptions:
| InvalidConstraintException | Thrown when the interval is set to less than 5 milliseconds. |
Methods
AddElement
#public void AddElement(Rectangle rec_0, Rectangle rec_1)
Add a new animated element to the stack.
AddElement
#public void AddElement(Rectangle rec)
Add a new static element to the stack.
Parameters:
| rec (Rectangle) | Dimensions of new element. |
Destroy
#public void Destroy()
Call this function when you are certain you will no longer need the stack. It will disable any current update events and clear animation instances.
InsertElement
#Add a new animated element to the stack.
RemoveElement
#Remove the stack element at the specified index.
Parameters:
| index (int) | Index of element to remove. |
ResizeContainer
#Call this function to override the width or height of all elements without interfering with the animation.
SetNewTarget
#Set new target dimenions for the given object.
SetOwner
#public void SetOwner(Control ui_thread_owner, GH_StackEventDelegate ui_thread_update, GH_StackEventDelegate ui_thread_complete)
Parameters:
| ui_thread_owner (Control) | |
| ui_thread_update (GH_Stack.GH_StackEventDelegate) | |
| ui_thread_complete (GH_Stack.GH_StackEventDelegate) |