संपादित करें

इसके माध्यम से साझा किया गया


CAnimationVariableIntegerChangeHandler Class

Note

The Microsoft Foundation Classes (MFC) library continues to be supported. However, we're no longer adding features or updating the documentation.

Implements a callback, which is called by the Animation API when the value of an animation variable changes.

Syntax

class CAnimationVariableIntegerChangeHandler : public CUIAnimationVariableIntegerChangeHandlerBase<CAnimationVariableIntegerChangeHandler>;

Members

Public Constructors

Name Description
CAnimationVariableIntegerChangeHandler::CAnimationVariableIntegerChangeHandler Constructs a CAnimationVariableIntegerChangeHandler object.

Public Methods

Name Description
CAnimationVariableIntegerChangeHandler::CreateInstance Creates an instance of CAnimationVariableIntegerChangeHandler callback.
CAnimationVariableIntegerChangeHandler::OnIntegerValueChanged Called when a value of an animation variable has changed. (Overrides CUIAnimationVariableIntegerChangeHandlerBase::OnIntegerValueChanged.)
CAnimationVariableIntegerChangeHandler::SetAnimationController Stores a pointer to animation controller to route events.

Remarks

This event handler is created and passed to IUIAnimationVariable::SetVariableIntegerChangeHandler method, when you call CAnimationVariable::EnableIntegerValueChangedEvent or CAnimationBaseObject::EnableIntegerValueChangedEvent (which enables this event for all animation variables encapsulated in an animation object).

Inheritance Hierarchy

MFC Classes

CUIAnimationCallbackBase

CUIAnimationVariableIntegerChangeHandlerBase

CAnimationVariableIntegerChangeHandler

Requirements

Header: afxanimationcontroller.h

CAnimationVariableIntegerChangeHandler::CAnimationVariableIntegerChangeHandler

Constructs a CAnimationVariableIntegerChangeHandler object.

CAnimationVariableIntegerChangeHandler ();

CAnimationVariableIntegerChangeHandler::CreateInstance

Creates an instance of CAnimationVariableIntegerChangeHandler callback.

static COM_DECLSPEC_NOTHROW HRESULT CreateInstance(
    CAnimationController* pAnimationController,
    IUIAnimationVariableIntegerChangeHandler** ppHandler);

Parameters

pAnimationController
A pointer to animation controller, which will receive events.

ppHandler

Return Value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

CAnimationVariableIntegerChangeHandler::OnIntegerValueChanged

Called when a value of an animation variable has changed.

IFACEMETHOD(OnIntegerValueChanged) (
    __in IUIAnimationStoryboard* storyboard,
    __in IUIAnimationVariable* variable,
    __in INT32 newValue,
    __in INT32 previousValue);

Parameters

storyboard
The storyboard that is animating the variable.

variable
The animation variable that was updated.

newValue
The new rounded value.

previousValue
The previous rounded value.

Return Value

S_OK if the method succeeds; otherwise E_FAIL.

CAnimationVariableIntegerChangeHandler::SetAnimationController

Stores a pointer to animation controller to route events.

void SetAnimationController(CAnimationController* pAnimationController);

Parameters

pAnimationController
A pointer to animation controller, which will receive events.

See also

Classes