CODSizeCommand Class
class CODSizeCommand: public CODCommand
The size command sets the size of one or more components. The size command can be used to set the width, height, or both width and height of the components to a given size. Sizing occurs about a fixed control point on the components. The command saves the position of each component in a map prior to execution, so that CODComponent::SetPosition can be used by Unexecute to restore the position and size of the components.Defined in: OdSizeCmd.h
See Also
CODModel::SetComponentWidth, CODModel::SetComponentHeight, CODModel::SetComponentSize
Class Members
CODSizeCommand(CODModel* pModel)
Constructor.
virtual ~CODSizeCommand()
Destructor.
CSize m_szAll
Size for all components.
OD_CONTROL_POINT m_nControlPoint
The control point to use as the origin for the size operation.
CMap<CODComponent*,CODComponent*,CODComponentPosition*,CODComponentPosition*> m_mapOldPositions
Maps components to their old position and size.
void SetWidth(const int nWidth)
Sets the width for all components.
void SetHeight(const int nHeight)
Sets the height for all components.
void SetSize(const CSize& szAll)
Sets the size for all components.
void SetControlPoint(const OD_CONTROL_POINT nControlPoint)
Sets the control point to use as the origin for the size operation.
virtual BOOL Execute()
Sizes the components.
virtual BOOL Unexecute()
Restores the previous sizes of the changed components.
virtual sfl::MvcCommand* Dup() const
Make a copy of this size command.
virtual void Sprint(CString& strCmd)
Print information on this command for logging purposes.
virtual void AddComponent(CODComponent* pComp)
Adds a component to the list of affected components.
virtual void RemoveComponent(CODComponent* pComp)
Removes a component to the list of affected components.
void SavePosition(CODComponent* pComp)
Save the position of a component.
CODComponentPosition* GetPosition(CODComponent* pComp) const
Get the saved position of a component.
void ClearPositions()
Clears all saved component positions.