//------------------------------------------------------------------------ void CScrollbar::onVisualChange () { if (overlayStyle && !mouseIsInside) { Animation::InterpolationTimingFunction* timingFunction = new Animation::InterpolationTimingFunction (1100); timingFunction->addPoint (1000.f/1100.f, 0); addAnimation ("AlphaValueAnimation", new Animation::AlphaValueAnimation (0.001f), timingFunction); setAlphaValue (1.f); } }
//----------------------------------------------------------------------------- CMouseEventResult CScrollbar::onMouseExited (CPoint& where, const CButtonState& buttons) { if (overlayStyle) { Animation::ITimingFunction* timingFunction = 0; if (getAlphaValue () == 1.f) { Animation::InterpolationTimingFunction* interpolTimingFunction = new Animation::InterpolationTimingFunction (400); interpolTimingFunction->addPoint (300.f/400.f, 1.f); timingFunction = interpolTimingFunction; } else timingFunction = new Animation::LinearTimingFunction (100); addAnimation ("AlphaValueAnimation", new Animation::AlphaValueAnimation (0.001f), timingFunction); } mouseIsInside = false; return kMouseEventNotHandled; }
//------------------------------------------------------------------------ void PLUGIN_API TestAnimationController::update (FUnknown* changedUnknown, int32 message) { if (message == kChanged) { FUnknownPtr<Parameter> parameter (changedUnknown); if (parameter && animationView && animationView->getFrame ()) { Animation::InterpolationTimingFunction* timingFunction = new Animation::InterpolationTimingFunction (200); timingFunction->addPoint (0.5f, 0.2f); int32 value = parameter->toPlain (parameter->getNormalized ()); if (value) { animationView->getFrame ()->getAnimator ()->addAnimation (animationView, "SizeAnimation", new Animation::ViewSizeAnimation (originalRect), timingFunction); } else { CRect r (originalRect); r.bottom += 300; r.right += 80; animationView->getFrame ()->getAnimator ()->addAnimation (animationView, "SizeAnimation", new Animation::ViewSizeAnimation (r), timingFunction); } } } }