CAnimationSize Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CAnimationSize Class.

Implements the functionality of a size object whose dimensions can be animated.

class CAnimationSize : public CAnimationBaseObject;  

Public Constructors

NameDescription
CAnimationSize::CAnimationSizeOverloaded. Constructs an animation size object.

Public Methods

NameDescription
CAnimationSize::AddTransitionAdds transitions for Width and Height.
CAnimationSize::GetCXProvides access to CAnimationVariable representing Width.
CAnimationSize::GetCYProvides access to CAnimationVariable representing Height.
CAnimationSize::GetDefaultValueReturns the default values for Width and Height.
CAnimationSize::GetValueReturns current value.
CAnimationSize::SetDefaultValueSets default value.

Protected Methods

NameDescription
CAnimationSize::GetAnimationVariableListPuts the encapsulated animation variables into a list. (Overrides CAnimationBaseObject::GetAnimationVariableList.)

Public Operators

NameDescription
CAnimationSize::operator CSizeConverts a CAnimationSize to a CSize.
CAnimationSize::operator=Assigns szSrc to CAnimationSize.

Protected Data Members

NameDescription
CAnimationSize::m_cxValueThe encapsulated animation variable that represents width of animation size.
CAnimationSize::m_cyValueThe encapsulated animation variable that represents height of animation size.

The CAnimationSize class encapsulates two CAnimationVariable objects and can represent in applications a size. For example, you can use this class to animate a size of any two dimensional object on the screen (like rectangle, control etc). To use this class in application, just instantiate an object of this class, add it to animation controller using CAnimationController::AddAnimationObject and call AddTransition for each transition to be applied to Width and/or Height.

CObject

CAnimationBaseObject

CAnimationSize

Header: afxanimationcontroller.h

Adds transitions for Width and Height.

void AddTransition(
    CBaseTransition* pCXTransition,  
    CBaseTransition* pCYTransition);

Parameters

pCXTransition
A pointer to transition for Width.

pCYTransition
A pointer to transition for Height.

Remarks

Call this function to add the specified transitions to the internal list of transitions to be applied to animation variables for Width and Height. When you add transitions, they are not applied immediately and stored in an internal list. Transitions are applied (added to a storyboard for a particular value) when you call CAnimationController::AnimateGroup. If you don't need to apply a transition to one of dimensions, you can pass NULL.

Constructs an animation size object.

CAnimationSize();

 
CAnimationSize(
    const CSize& szDefault,  
    UINT32 nGroupID,  
    UINT32 nObjectID = (UINT32)-1,  
    DWORD dwUserData = 0);

Parameters

szDefault
Specifies default size.

nGroupID
Specifies Group ID.

nObjectID
Specifies Object ID.

dwUserData
Specifies user-defined data.

Remarks

The object is constructed with default values for width, height, Object ID and Group ID, which will be set to 0. They can be changed later at runtime using SetDefaultValue and SetID.

Puts the encapsulated animation variables into a list.

virtual void GetAnimationVariableList(CList<CAnimationVariable*, CAnimationVariable*>& lst);

Parameters

lst
When the function returns, it contains pointers to two CAnimationVariable objects representing the width and height.

Provides access to CAnimationVariable representing Width.

CAnimationVariable& GetCX();

Return Value

A reference to encapsulated CAnimationVariable representing Width.

Remarks

You can call this method to get direct access to underlying CAnimationVariable representing Width.

Provides access to CAnimationVariable representing Height.

CAnimationVariable& GetCY();

Return Value

A reference to encapsulated CAnimationVariable representing Height.

Remarks

You can call this method to get direct access to underlying CAnimationVariable representing Height.

Returns the default values for Width and Height.

CSize GetDefaultValue();

Return Value

A CSize object containing default values.

Remarks

Call this function to retrieve default value, which was previously set by constructor or SetDefaultValue.

Returns current value.

BOOL GetValue(CSize& szValue);

Parameters

szValue
Output. Contains the current value when this method returns.

Return Value

TRUE, if the current value was successfully retrieved; otherwise FALSE.

Remarks

Call this function to retrieve the current value of animation size. If this method fails or underlying COM objects for Width and Size have not been initialized, szValue contains default value, which was previously set in constructor or by SetDefaultValue.

The encapsulated animation variable that represents width of animation size.

CAnimationVariable m_cxValue;  

The encapsulated animation variable that represents height of animation size.

CAnimationVariable m_cyValue;  

Converts a CAnimationSize to a CSize.

operator CSize();

Return Value

Current value of animation size as CSize.

Remarks

This function internally calls GetValue. If GetValue for some reason fails, the returned size will contain default values for Width and Height.

Assigns szSrc to CAnimationSize.

void operator=(const CSize& szSrc);

Parameters

szSrc
Refers to CSize or SIZE.

Remarks

Assigns szSrc to CAnimationSize. It's recommended to do that before animation start, because this operator calls SetDefaultValue, which recreates the underlying COM objects for Width and Height if they have been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.

Sets default value.

void SetDefaultValue(const CSize& szDefault);

Parameters

szDefault
Specifies new default size.

Remarks

Use this function to set a default value to animation object. This methods assigns default values to Width and Height of animation size. It also recreates underlying COM objects if they have been created. If you subscribed this animation object to events (ValueChanged or IntegerValueChanged), you need to re-enable these events.

Classes

Show: