MFC Grid manual

CInt64DateReflector Class Reference

Performs edit in place operations on __int64-type fields in CEmbeddedDateTimeCtrl control. More...

#include <Dapfor/GUI/Int64DateReflector.h>

Inheritance diagram for CInt64DateReflector:

IControlReflector

List of all members.


Public Member Functions

 CInt64DateReflector ()
 Constructor.
virtual ~CInt64DateReflector ()
 Virtual destructor.
virtual bool Match (const Common::CFormat *format) const
 Indicates whether a reflector matches to the specified format.
virtual bool CreateAndAttachControl (CEditInPlaceContext &context, const Common::CFormat *format, IEditInPlace::StartReason startReason)
 Creates datetime MFC control.
virtual void ShowControl ()
 Shows the control.
virtual bool CanStopEdit (const CEditInPlaceContext &context, IEditInPlace::StopReason reason) const
 Indicates whether CGrid can stop edit in place in the control.
virtual bool Apply (CEditInPlaceContext &context, const Common::CFormat *format)
 Applies the new value set by user in MFC control to the specified field in the data object.
virtual bool DetachAndDestroyControl (CGrid &grid, HITEM hItem, const CColumn *column)
 Detaches MFC control from CGrid and destroys it.
virtual bool CanDrawControl (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Indicates that a control should be painted in CGrid painting routine.
virtual void PostPaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Paints dropdown or spin buttons to the right of the cell.
virtual bool CanActivateOnThumbClick (const CEditInPlaceContext &context, const Common::CFormat *format) const
 Indicates that MFC control can be activated if the user clicks on dropdown or spin button painted in the cell.
virtual CWnd * GetControl ()
 Gets datetime MFC control.

Detailed Description

Performs edit in place operations on __int64-type fields in CEmbeddedDateTimeCtrl control.

Version:
2.0.0 Initial version

Member Function Documentation

bool Match ( const Common::CFormat format  )  const [virtual]

Indicates whether a reflector matches to the specified format.

The reflector matches only to __int64-type format which presents date or time.

Parameters:
[in] format A textual format to verify whether a reflector matches to.
Returns:
True if the reflector matches to the format. Otherwise false.

Implements IControlReflector.

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

Creates datetime MFC control.

Creates MFC control of CEmbeddedDateTimeCtrl type and initializes it with the parameters, returned by the format.

Parameters:
[in] context Indicates the cell, where the control should be attached.
[in] format Format object, that permits to populate MFC control.
[in] startReason Indicates the reason, why MFC control should be created.
Returns:
true if MFC control has been successfully created.

Implements IControlReflector.

bool CanStopEdit ( const CEditInPlaceContext context,
IEditInPlace::StopReason  reason 
) const [virtual]

Indicates whether CGrid can stop edit in place in the control.

Parameters:
[in] context Indicates the cell, where the control is attached.
[in] reason Indicates the reason, why the control should be detached and then destroyed.
Returns:
True if edit in place can be stopped. Otherwise false.

Implements IControlReflector.

bool Apply ( CEditInPlaceContext context,
const Common::CFormat format 
) [virtual]

Applies the new value set by user in MFC control to the specified field in the data object.

Parameters:
[in] context Indicates the cell, where the control is attached.
[in] format Format object, that permits to transform the formatted value in MFC control to an unformatted form and then set it into the appropriated field of the data object.
Returns:
True if the value has been successfully set into the appropriated field of the data object.

Implements IControlReflector.

bool DetachAndDestroyControl ( CGrid grid,
HITEM  hItem,
const CColumn column 
) [virtual]

Detaches MFC control from CGrid and destroys it.

Parameters:
[in] grid CGrid object
[in] hItem Handle of a line in CGrid
[in] column Column in the grid
Returns:
True if the control has been succesfully detached and destroyed.

Implements IControlReflector.

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

Indicates that a control should be painted in CGrid painting routine.

Reflectors create their underlying controls during edit in place operation. CGrid doesn't create MFC controls up to the user starts edit in place operations. Nevertheless while the mouse is moving it is desirable to highlight the control where the mouse is over, or perform other drawings (for ex. drop button). This drawing can be made only inside CGrid painting routine where CGrid can forward cell drawing into the reflector.

Parameters:
[in] cell Cell in CGrid
[in] paintContext Nested information to process drawing.
[in] paintFilter Current paint filter applied to draw a cell.
Returns:
True, if the reflector customizes drawing. Otherwise false.

Implements IControlReflector.

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

Paints dropdown or spin buttons to the right of the cell.

Parameters:
[in] cell Cell in CGrid
[in] paintContext Nested information to process drawing.
[in] paintFilter Current paint filter applied to draw a cell.

Implements IControlReflector.

bool CanActivateOnThumbClick ( const CEditInPlaceContext context,
const Common::CFormat format 
) const [virtual]

Indicates that MFC control can be activated if the user clicks on dropdown or spin button painted in the cell.

Parameters:
[in] context Indicates the cell, where the control is attached.
[in] format Format object, that permits to populate MFC control.
Returns:
True if CGrid can activate edit in place MFC control. Otherwise false.

Implements IControlReflector.

CWnd * GetControl (  )  [virtual]

Gets datetime MFC control.

Returns:
gets CEmbeddedDateTimeCtrl type MFC control if it exists. Otherwise zero.

Implements IControlReflector.