CBaseKeyFrame Class

Implements the basic functionality of a keyframe.

Syntax

class CBaseKeyFrame : public CObject;

Members

Public Constructors

Name Description
CBaseKeyFrame::CBaseKeyFrame Constructs a keyframe object.

Public Methods

Name Description
CBaseKeyFrame::AddToStoryboard Adds a keyframe to storyboard.
CBaseKeyFrame::GetAnimationKeyframe Returns the underlying keyframe value.
CBaseKeyFrame::IsAdded Tells whether a keyframe has been added to storyboard.
CBaseKeyFrame::IsKeyframeAtOffset Specifies whether the keyframe should be added to storyboard at offset, or after transition.

Protected Data Members

Name Description
CBaseKeyFrame::m_bAdded Specifies whether this keyframe has been added to a storyboard.
CBaseKeyFrame::m_bIsKeyframeAtOffset Specifies whether this keyframe should be added to storyboard at an offset from another existing keyframe, or at the end of some transition.
CBaseKeyFrame::m_keyframe Represents a Windows Animation API keyframe. When a keyframe is not initialized it is set to the predefined value UI_ANIMATION_KEYFRAME_STORYBOARD_START.

Remarks

Encapsulates UI_ANIMATION_KEYFRAME variable. Serves as a base class for any keyframe implementation. A keyframe represents a moment in time within a storyboard and can be used to specify the start and end times of transitions. There are two types of keyframes - keyframes added to storyboard at the specified offset (in time), or keyframes added after specified transition. Because durations of some transitions can't be known before animation starts, the actual values of some keyframes are determined at runtime only. Because keyframes may depend on transitions, which in their turn depend on keyframes, it's important to prevent infinite recursions when building keyframe chains.

Inheritance Hierarchy

CObject

CBaseKeyFrame

Requirements

Header: afxanimationcontroller.h

CBaseKeyFrame::AddToStoryboard

Adds a keyframe to storyboard.

virtual BOOL AddToStoryboard(
    IUIAnimationStoryboard* pStoryboard,
    BOOL bDeepAdd);

Parameters

pStoryboard
A pointer to a storyboard.

bDeepAdd
If this parameter is TRUE and the keyframe being added depends on some other keyframe or transition, this method tries to add this keyframe or transition to storyboard first.

Return Value

TRUE if keyframe was added to storyboard successfully; otherwise FALSE.

Remarks

This method is called to add a keyframe to storyboard.

CBaseKeyFrame::CBaseKeyFrame

Constructs a keyframe object.

CBaseKeyFrame();

CBaseKeyFrame::GetAnimationKeyframe

Returns the underlying keyframe value.

UI_ANIMATION_KEYFRAME GetAnimationKeyframe() const;

Return Value

A current keyframe. The default value is UI_ANIMATION_KEYFRAME_STORYBOARD_START.

Remarks

This is an accessor to the underlying keyframe value.

CBaseKeyFrame::IsAdded

Tells whether a keyframe has been added to storyboard.

BOOL IsAdded() const;

Return Value

TRUE if a keyframe is added to a storyboard; otehrwise FALSE.

Remarks

In the base class IsAdded always returns TRUE, but it's overridden in derived classes.

CBaseKeyFrame::IsKeyframeAtOffset

Specifies whether the keyframe should be added to storyboard at offset, or after transition.

BOOL IsKeyframeAtOffset() const;

Return Value

TRUE if the keyframe should be added to storyboard at some specified offset. FALSE if the keyframe should be added to storyboard after some transition.

Remarks

Specifies whether the keyframe should be added to storyboard at offset. The offset or transition must be specified in a derived class.

CBaseKeyFrame::m_bAdded

Specifies whether this keyframe has been added to a storyboard.

BOOL m_bAdded;

CBaseKeyFrame::m_bIsKeyframeAtOffset

Specifies whether this keyframe should be added to storyboard at an offset from another existing keyframe, or at the end of some transition.

BOOL m_bIsKeyframeAtOffset;

CBaseKeyFrame::m_keyframe

Represents a Windows Animation API keyframe. When a keyframe is not initialized it is set to the predefined value UI_ANIMATION_KEYFRAME_STORYBOARD_START.

UI_ANIMATION_KEYFRAME m_keyframe;

See also

Classes