MFC Grid manual

IControlReflector Class Reference

IControlReflector interface. More...

#include <Dapfor/GUI/IControlReflector.h>

Inheritance diagram for IControlReflector:

CBoolReflector CCharReflector CCheckBoxReflector CDefaultReflector CDoubleReflector CFloatReflector CInt64DateReflector CInt64Reflector CLongColorReflector CLongDateTimeReflector CLongEnumReflector CLongMsecTimeReflector CLongReflector CShortReflector CUCharReflector CULongReflector CUShortReflector

List of all members.


Public Member Functions

virtual ~IControlReflector ()
 Virtual destructor.
virtual bool Match (const Common::CFormat *format) const =0
 Indicates whether a reflector can show a data object field via the specified format in an appropriated MFC control.
virtual bool CreateAndAttachControl (CEditInPlaceContext &context, const Common::CFormat *format, IEditInPlace::StartReason startReason)=0
 Creates and fills appropriate MFC control, and attaches it to a cell in CGrid.
virtual void ShowControl ()=0
 Shows the control.
virtual bool CanStopEdit (const CEditInPlaceContext &context, IEditInPlace::StopReason reason) const =0
 Indicates whether CGrid can stop edit in place in the control.
virtual bool Apply (CEditInPlaceContext &context, const Common::CFormat *format)=0
 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)=0
 Detaches MFC control from CGrid and destroys it.
virtual bool CanDrawControl (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)=0
 Indicates that a control should be painted in CGrid painting routine.
virtual UINT PrePaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Paints a reflector in CGrid painting routine before the cell is pained.
virtual void PostPaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)=0
 Paints a reflector in CGrid painting routine after the cell is pained.
virtual bool CanActivateOnThumbClick (const CEditInPlaceContext &context, const Common::CFormat *format) const =0
 Indicates whether MFC control can be activated if the user clicks inside of a cell.
virtual CWnd * GetControl ()=0
 Gets underlying MFC control.

Detailed Description

IControlReflector interface.

Version:
2.0.0 Initial version

Member Function Documentation

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

Indicates whether a reflector can show a data object field via the specified format in an appropriated MFC control.

Each data type can be presented in different manners i.e bool type can be presented by a droplist control, short, long, double... - by CEdit, long-type date value - by a date time picker, etc. So the format gets the ideas, how value of a specified type is reflected.

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

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

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

Creates and fills appropriate MFC control, and attaches it to a cell in CGrid.

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.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

bool CanStopEdit ( const CEditInPlaceContext context,
IEditInPlace::StopReason  reason 
) const [pure 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.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

bool Apply ( CEditInPlaceContext context,
const Common::CFormat format 
) [pure 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.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

bool DetachAndDestroyControl ( CGrid grid,
HITEM  hItem,
const CColumn column 
) [pure 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.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

bool CanDrawControl ( CGridCell cell,
const CPaintContext paintContext,
UINT  paintFilter 
) [pure 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.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

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

Paints a reflector in CGrid painting routine after the cell is pained.

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.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

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

Indicates whether MFC control can be activated if the user clicks inside of a cell.

Some controls can be activated if the user clicks in the specified area inside of a cell. For example, if the user clicks on a drop down button, CGrid starts edit in place process, but in case, when the click is occurred outside the place where a drop down is displayed (inside of the same cell), CGrid doesn't perform the activation.

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. Otherwise false.

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.

CWnd * GetControl (  )  [pure virtual]

Gets underlying MFC control.

Returns:
MFC control

Implemented in CBoolReflector, CCharReflector, CCheckBoxReflector, CDefaultReflector, CDoubleReflector, CFloatReflector, CInt64DateReflector, CInt64Reflector, CLongColorReflector, CLongDateTimeReflector, CLongEnumReflector, CLongMsecTimeReflector, CLongReflector, CShortReflector, CUCharReflector, CULongReflector, and CUShortReflector.