MFC Grid manual

CEmbeddedControlAdapter Class Reference

Enables attachment of almost any MFC control to CGrid. More...

#include <Dapfor/GUI/EmbeddedControlAdapter.h>

List of all members.


Public Member Functions

 CEmbeddedControlAdapter (CWnd *pWnd, const CEmbeddedControlParams &params)
 Constructor.
virtual ~CEmbeddedControlAdapter ()
 Virtual destructor.
virtual void MoveControl (const CRect &cellRect)
 Moves MFC control over the client area of the grid.
virtual CWnd * GetControl () const
 Gets MFC control.
virtual bool PaintControl (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Paints MFC control.
virtual void MoveAway ()
 Moves MFC control outside of the client area without changing its visibility.
virtual void HideControl ()
 Makes the control invisible.
virtual void ShowControl ()
 Makes the control visible.
virtual void AddSink (ISink *sink)
 Adds a callback interface to receive notifications from MFC control.
virtual void RemoveSink (ISink *sink)
 Removes a callback interface from the subscription list.
virtual const
CEmbeddedControlParams
GetParams () const
 Gets current settings.
virtual bool AutoDelete () const
 IAutoDelete implementation. Returns true.

Classes

struct  ISink
 Callback interface to receive notifications from MFC control. More...

Detailed Description

Enables attachment of almost any MFC control to CGrid.

An object of this class enables communication between CGrid and MFC control. It forwards some notifications from the control to the grid i.e. focus lost, control destruction, etc. On the other hand, the grid can manage visibility, placement the control over the client area and paint via an adapter in the control.

Version:
2.0.0 Initial version

Constructor & Destructor Documentation

CEmbeddedControlAdapter ( CWnd *  pWnd,
const CEmbeddedControlParams params 
)

Constructor.

Parameters:
[in] pWnd MFC control is attached to CGrid
[in] params Attachment parameters.


Member Function Documentation

void MoveControl ( const CRect &  cellRect  )  [virtual]

Moves MFC control over the client area of the grid.

Parameters:
[in] cellRect Rectangle in the client area of CGrid where MFC control should be displaced.

CWnd * GetControl (  )  const [virtual]

Gets MFC control.

Returns:
MFC control

bool PaintControl ( CGridCell cell,
const CPaintContext paintContext,
UINT  paintFilter 
) [virtual]

Paints MFC control.

Parameters:
[in] cell Cell related infomation to perform painting.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of the painting operations, defined in PaintFilter enumeration.
Returns:
True if success. Otherwise false.

void AddSink ( ISink sink  )  [virtual]

Adds a callback interface to receive notifications from MFC control.

Parameters:
[in] sink Callback to subscribe for control notifications.

void RemoveSink ( ISink sink  )  [virtual]

Removes a callback interface from the subscription list.

Parameters:
[in] sink Callback to unsubscribe from control notifications.

const CEmbeddedControlParams & GetParams (  )  const [virtual]

Gets current settings.

Returns:
Attachment parameters