MvcCompositeViewport Class

class MvcCompositeViewport: public MvcViewport

This class simplifies the use of child components by providing a default collection implementation. Children can be added or removed from the collection, and each child will have it's Draw function called during the painting process. A function for hit testing child components in the composite helps controllers determine appropriate commands for child component actions.

Defined in: MvcCompositeViewport.h

Class Members

virtual void Draw(CDC* pDC)

Draws this viewport and calls Draw for all children in the composite

virtual void SetModel(MvcModel* pModel)

Sets the model that this viewport will observe

virtual MvcVisualComponent* HitTestComponent( CPoint pt )

Determines the child component that contains a point

virtual int AddComponent(MvcVisualComponent* pComponent)

Adds a child component to the composite

virtual void RemoveComponent(MvcVisualComponent* pComponent)

Removes a child component from the composite

inline ICollection_T<MvcVisualComponent*>* GetComponents()

Returns the collection of children in the composite viewport

virtual void CreateComponents()

Override this function to initially create child components. Called by SetModel()

virtual void DestroyComponents()

Deletes all child components and empties the collection

ComponentSet m_setComponents

The internal collection declaration