CMvcVisualPart Class

class CMvcVisualPart: public _Base

A CMvcVisualPart is a type of visual component that keeps track of its container. Knowledge of its parent allows a visual part to perform invalidation and establish its own size based on the size of its container.

Because of its extra member variables, a visual part is a slightly heavier object than the CMvcVisualComponent class. If you require many instantiations of a display object, you should probably derive each from CMvcVisualComponent and the container from CMvcVisualPart, CMvcLogicalPart or CMvcViewport.

Defined in: MvcVisualPart.h

Class Template Arguments

_Base

Base visual class.

_Container

Container type.

Class Members

CMvcVisualPart(_ContainerClass* pContainer = NULL) :  (_ContainerClass* pContainer = NULL)

Construct a visual part object

_ContainerClass* m_pContainer

Pointer to the object that contains the visual part

virtual BOOL  Create(_ContainerClass* pContainer = NULL)

Create a visual part as a child of the specified container

_ContainerClass*  GetContainer()

Returns a pointer to the visual object that contains the visual part

virtual void  SetContainer(_ContainerClass* pContainer)

Sets a pointer to the visual part that contains the visual part

virtual void  InvalidateRect(const CRect& rect, BOOL bErase = TRUE, BOOL bRepairNow = FALSE)

Invalidates the specified rectangle of this component in logical coordinates

virtual void  ValidateRect(const CRect& rect)

Validates the specified rectangle of this component in logical coordinates

virtual void  Invalidate(BOOL bErase = TRUE, BOOL bRepairNow = FALSE)

Invalidates this component's entire rectangle.

virtual void  InvalidateVisual(IVisual* pVisual, BOOL bErase = TRUE, BOOL bRepairNow = FALSE)

Invalidates the specified visual component's entire rectangle.

virtual BOOL  OnCreate()

Called after the visual part has been created to allow the creation and/or initialization of additional children