GH_Stack

References
public class GH_Stack
Represents 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

GH_Stack

#
public GH_Stack()

GH_Stack

#
public GH_Stack(int update_interval, int animation_length, GH_Interpolation animation_interpolation)
update_interval (int)
animation_length (int)
animation_interpolation (GH_Interpolation)

GH_Stack

#
public GH_Stack(int update_interval, int animation_length)
update_interval (int)
animation_length (int)

GH_Stack

#
public GH_Stack(int update_interval)
update_interval (int)

Properties

Count

#
public int Count { get; }
Gets the number of items in the stack.

Duration

#
public int Duration { get; set; }
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

#
public Rectangle Element_Final[int index] { get; }
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.
index (int)Index of stack element.
IndexOutOfRangeExceptionThrown if index does not represent a valid index in the stack.

Element_Initial

#
public Rectangle Element_Initial[int index] { get; }
Gets the starting dimensions of the stack element at the given index.
index (int)Index of stack element.
IndexOutOfRangeExceptionThrown if index does not represent a valid index in the stack.

Element_Intermediate

#
public Rectangle Element_Intermediate[int index] { get; }
Gets the intermediate dimensions for the specified physical stack element as determined by the current system time.
index (int)Index of stack element.

InMotion

#
public bool InMotion { get; }
Gets a value that indicates whether or not any element in this stack is currently in motion.
True if the stack is still (partly) in motion.

InMotion

#
public bool InMotion[int index] { get; }
Gets a value that indicates whether or not the element at the given index is currently in motion.
index (int)Index of element.
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

#
public int UpdateInterval { get; set; }
Gets or sets the interval (in milliseconds) for update events.
The number of milliseconds between update intervals.
InvalidConstraintExceptionThrown when the interval is set to less than 5 milliseconds.

Methods

AddElement

#
public void AddElement(Rectangle rec_0, Rectangle rec_1, int duration_override)
Add a new animated element to the stack.
rec_0 (Rectangle)Initial dimensions of element.
rec_1 (Rectangle)Final dimensions of element.
duration_override (int)Duration of animation in milliseconds.

AddElement

#
public void AddElement(Rectangle rec_0, Rectangle rec_1)
Add a new animated element to the stack.
rec_0 (Rectangle)Initial dimensions of element.
rec_1 (Rectangle)Final dimensions of element.

AddElement

#
public void AddElement(Rectangle rec)
Add a new static element to the stack.
rec (Rectangle)Dimensions of new element.

Clear

#
public void Clear()
Remove all boxes, timestamps and animators.

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.

Finalize

#
protected override void Finalize()
Object.Finalize

InsertElement

#
public void InsertElement(int index, Rectangle rec_0, Rectangle rec_1, int duration_override)
Add a new animated element to the stack.
index (int)Insertion index.
rec_0 (Rectangle)Initial dimensions of element.
rec_1 (Rectangle)Final dimensions of element.
duration_override (int)Duration of animation in milliseconds.

InsertElement

#
public void InsertElement(int index, Rectangle rec_0, Rectangle rec_1)
Add a new animated element to the stack.
index (int)Insertion index.
rec_0 (Rectangle)Initial dimensions of element.
rec_1 (Rectangle)Final dimensions of element.

InsertElement

#
public void InsertElement(int index, Rectangle rec)
Add a new static element to the stack.
index (int)Insertion index.
rec (Rectangle)Dimensions of new element.

RemoveElement

#
public void RemoveElement(int index)
Remove the stack element at the specified index.
index (int)Index of element to remove.

ResizeContainer

#
public void ResizeContainer(Rectangle region, bool fit_horizontal, bool fit_vertical)
Call this function to override the width or height of all elements without interfering with the animation.
region (Rectangle)New region.
fit_horizontal (bool)If True, all the elements will be fit to the region horizontally.
fit_vertical (bool)If True, all the elements will be fit to the region vertically.

SetNewTarget

#
public void SetNewTarget(int index, Rectangle element, bool bAnimate)
Set new target dimenions for the given object.
index (int)Index of element to set.
element (Rectangle)New dimensions.
bAnimate (bool)True if the change should animated.

SetNewTarget

#
public void SetNewTarget(int index, Rectangle element)
Set new target dimenions for the given object.
index (int)Index of element to set.
element (Rectangle)New dimenions.

SetOwner

#
public void SetOwner(Control ui_thread_owner, GH_StackEventDelegate ui_thread_update, GH_StackEventDelegate ui_thread_complete)
ui_thread_owner (Control)
ui_thread_update (GH_Stack.GH_StackEventDelegate)
ui_thread_complete (GH_Stack.GH_StackEventDelegate)

SetOwner

#
public void SetOwner(Control ui_thread_owner, GH_StackEventDelegate ui_thread_update)
ui_thread_owner (Control)
ui_thread_update (GH_Stack.GH_StackEventDelegate)