MFC Grid manual

CEditInPlace Class Reference

Default implementation of IEditInPlace interface. More...

#include <Dapfor/GUI/EditInPlace.h>

Inheritance diagram for CEditInPlace:

IEditInPlace IAutoDelete

List of all members.


Public Member Functions

 CEditInPlace (bool bAutoDelete=false)
 Constructor.
virtual ~CEditInPlace ()
 Virtual destructor.
virtual bool CanBeginEdit (const CEditInPlaceContext &context, StartReason startReason) const
 Indicates whether edit in place can be started in a specified cell with a given start reason.
virtual bool AttachControl (CEditInPlaceContext &context, StartReason startReason, const Common::CFormat *format)
 Starts edit in place. Handles control creation through IControlReflector interface. The best place to choose the appropriate reflector if default behavior doesn't conform to your needs.
virtual bool CanStopEdit (const CEditInPlaceContext &context, StopReason stopReason) const
 Indicates whether edit in place can be stopped.
virtual void OnBeginEdit (const CEditInPlaceContext &context, CWnd *attachedControl)
 Called at the beginning of edit in place.
virtual void OnEndEdit (CEditInPlaceContext &context, StopReason stopReason, CWnd *detachedControl, const Common::CFormat *format)
 Stops edit in place. Detaches a control throught IControlReflector interface.
virtual bool Navigate (CEditInPlaceContext &context, StopReason stopReason)
 Allows to choose the next control upon a navigation event like Tab, KeyUp, KeyDown etc.
virtual UINT PrePaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Forwards cell drawing of CGrid painting routine to an appropriate reflector before the cell is painted.
virtual void PostPaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Forwards cell drawing of CGrid painting routine to an appropriate reflector after the cell is painted.
virtual IControlReflectorGetReflector (const CGrid &grid, HITEM hItem, const Common::CDataObject *pDO, const CColumn *column, const Common::CFormat *format)
 Looks for the reflector that matches the specified format.
virtual bool AutoDelete () const
 IAutoDelete interface implementation. Indicates whether the object should be destroyed in the destructor of CGrid.

Detailed Description

Default implementation of IEditInPlace interface.

Version:
2.0.0 Initial version

Constructor & Destructor Documentation

CEditInPlace ( bool  bAutoDelete = false  ) 

Constructor.

Parameters:
[in] bAutoDelete If true, indicates, that CGrid should destroy this object in its destructor. If false, it is a responsibility of the programmer to destroy this object and free memory.


Member Function Documentation

bool CanBeginEdit ( const CEditInPlaceContext context,
StartReason  startReason 
) const [virtual]

Indicates whether edit in place can be started in a specified cell with a given start reason.

Parameters:
[in] context Nested information with the reference to CGrid, line and column where edit in place to be processed.
[in] startReason Indicates the reason for the start of edit in place.

Implements IEditInPlace.

bool AttachControl ( CEditInPlaceContext context,
IEditInPlace::StartReason  startReason,
const Common::CFormat format 
) [virtual]

Starts edit in place. Handles control creation through IControlReflector interface. The best place to choose the appropriate reflector if default behavior doesn't conform to your needs.

Parameters:
[in] context Nested information with the reference to CGrid, line and column where edit in place to be processed.
[in] format Format to customize the control populating
[in] startReason Indicates the reason for the start of edit in place.

Implements IEditInPlace.

bool CanStopEdit ( const CEditInPlaceContext context,
StopReason  stopReason 
) const [virtual]

Indicates whether edit in place can be stopped.

Parameters:
[in] context Nested information with the reference to CGrid, line and column where edit in place is processed.
[in] stopReason Indicates the reason for the stop of edit in place.

Implements IEditInPlace.

void OnBeginEdit ( const CEditInPlaceContext context,
CWnd *  editControl 
) [virtual]

Called at the beginning of edit in place.

Parameters:
[in] context Nested information with the reference to CGrid, line and column where edit in place to be processed.
[in] editControl Attached and populated edit in place control.

Implements IEditInPlace.

void OnEndEdit ( CEditInPlaceContext context,
StopReason  stopReason,
CWnd *  detachedControl,
const Common::CFormat format 
) [virtual]

Stops edit in place. Detaches a control throught IControlReflector interface.

Parameters:
[in] context Nested information with the reference to CGrid, line and column where edit in place is processed.
[in] stopReason Indicates the reason for the stop of edit in place.
[in] detachedControl Control to be detached.
[in] format Format to transform string to the non-formatted value which will be passed to the data object.

Implements IEditInPlace.

bool Navigate ( CEditInPlaceContext context,
StopReason  stopReason 
) [virtual]

Allows to choose the next control upon a navigation event like Tab, KeyUp, KeyDown etc.

Parameters:
[in] context Nested information with the reference to CGrid, line and column where edit in place is processed.
[in] stopReason Indicates the reason for the stop of edit in place.

Implements IEditInPlace.

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

Forwards cell drawing of CGrid painting routine to an appropriate reflector before the cell is painted.

Parameters:
[in] cell Cell related information
[in] paintContext Contains common information like device context, header, grid etc.
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.
Returns:
A new filter which is applied during cell painting.

Implements IEditInPlace.

IControlReflector * GetReflector ( const CGrid grid,
HITEM  hItem,
const Common::CDataObject pDO,
const CColumn column,
const Common::CFormat format 
) [virtual]

Looks for the reflector that matches the specified format.

Parameters:
[in] grid Reference to the grid
[in] hItem Handle to the inem in the grid
[in] pDO Pointer to the data object
[in] column The column
[in] format Textual format
Returns:
Reflector if found. Otherwise 0.

bool AutoDelete (  )  const [virtual]

IAutoDelete interface implementation. Indicates whether the object should be destroyed in the destructor of CGrid.

Returns:
A parameter, passed into the constructor of the class.

Implements IAutoDelete.