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;
Name | Description |
---|---|
CAnimationSize::CAnimationSize | Overloaded. Constructs an animation size object. |
Name | Description |
---|---|
CAnimationSize::AddTransition | Adds transitions for Width and Height. |
CAnimationSize::GetCX | Provides access to CAnimationVariable representing Width. |
CAnimationSize::GetCY | Provides access to CAnimationVariable representing Height. |
CAnimationSize::GetDefaultValue | Returns the default values for Width and Height. |
CAnimationSize::GetValue | Returns current value. |
CAnimationSize::SetDefaultValue | Sets default value. |
Name | Description |
---|---|
CAnimationSize::GetAnimationVariableList | Puts the encapsulated animation variables into a list. (Overrides CAnimationBaseObject::GetAnimationVariableList.) |
Name | Description |
---|---|
CAnimationSize::operator CSize | Converts a CAnimationSize to a CSize. |
CAnimationSize::operator= | Assigns szSrc to CAnimationSize. |
Name | Description |
---|---|
CAnimationSize::m_cxValue | The encapsulated animation variable that represents width of animation size. |
CAnimationSize::m_cyValue | The 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.
Header: afxanimationcontroller.h
Adds transitions for Width and Height.
void AddTransition(
CBaseTransition* pCXTransition,
CBaseTransition* pCYTransition);
pCXTransition
A pointer to transition for Width.
pCYTransition
A pointer to transition for Height.
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);
szDefault
Specifies default size.
nGroupID
Specifies Group ID.
nObjectID
Specifies Object ID.
dwUserData
Specifies user-defined data.
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);
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();
A reference to encapsulated CAnimationVariable representing Width.
You can call this method to get direct access to underlying CAnimationVariable representing Width.
Provides access to CAnimationVariable representing Height.
CAnimationVariable& GetCY();
A reference to encapsulated CAnimationVariable representing Height.
You can call this method to get direct access to underlying CAnimationVariable representing Height.
Returns the default values for Width and Height.
CSize GetDefaultValue();
A CSize object containing default values.
Call this function to retrieve default value, which was previously set by constructor or SetDefaultValue.
Returns current value.
BOOL GetValue(CSize& szValue);
szValue
Output. Contains the current value when this method returns.
TRUE, if the current value was successfully retrieved; otherwise FALSE.
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();
Current value of animation size as CSize.
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);
szSrc
Refers to CSize or SIZE.
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);
szDefault
Specifies new default size.
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.