public void removeChild(LayoutContainer child) { if (children.Remove(child)) { invalidate(); child._setParent(null); } }
public void insertChild(LayoutContainer child, int index) { child.SuppressLayout = true; children.Insert(index, child); child._setParent(this); child.Visible = visible; child.setAlpha(alpha); child.SuppressLayout = false; invalidate(); }
public void addChild(LayoutContainer child) { child.SuppressLayout = true; children.Add(child); child._setParent(this); child.Visible = visible; child.setAlpha(alpha); child.SuppressLayout = false; invalidate(); }
private void finishAnimation() { //reset the old child if (oldChildContainer != null) { oldChildContainer._setParent(null); oldChildContainer.setAlpha(1.0f); oldChildContainer.WorkingSize = oldSize; oldChildContainer.animatedResizeCompleted(oldSize); oldChildContainer.layout(); } fireAnimationComplete(oldChildContainer); if (childContainer != null) { childContainer.animatedResizeCompleted(currentSize); } unsubscribeFromUpdates(); }
public override void changePanel(LayoutContainer childContainer, float animDuration) { //If we were animating when a new request comes in clear the old animation first. if (animating) { if (this.childContainer != null) { this.childContainer.setAlpha(1.0f); this.childContainer.WorkingSize = newSize; this.childContainer.layout(); finishAnimation(); } else { //If we were transitioning to null, but now there is another container use the child that was being transitioned this.childContainer = oldChildContainer; unsubscribeFromUpdates(); } } currentTime = 0.0f; animationLength = animDuration; oldChildContainer = this.childContainer; if (oldChildContainer != null) { oldSize = oldChildContainer.DesiredSize; oldChildContainer.animatedResizeStarted(new IntSize2(oldSize.Width, WorkingSize.Height)); } else { oldSize = new IntSize2(0, 0); } this.childContainer = childContainer; if (childContainer != null) { childContainer._setParent(this); newSize = childContainer.DesiredSize; childContainer.animatedResizeStarted(new IntSize2(newSize.Width, WorkingSize.Height)); //Force the child container to fit in the current alloted space childContainer.Location = Location; childContainer.WorkingSize = new IntSize2(oldSize.Width, WorkingSize.Height); childContainer.layout(); } else { newSize = new IntSize2(0, 0); } sizeDelta = newSize - oldSize; if (oldSize.Width == 0) { currentEasing = EasingFunction.EaseOutQuadratic; } else if (newSize.Width == 0) { currentEasing = EasingFunction.EaseInQuadratic; } else { currentEasing = EasingFunction.EaseInOutQuadratic; } //Make sure we start with no alpha if blending if (childContainer != null && oldChildContainer != null) { childContainer.setAlpha(0.0f); } subscribeToUpdates(); }