MFC Grid manual

CCheckBoxReflector Class Reference

Performs edit in place operations on bool-type fields. More...

#include <Dapfor/GUI/CheckBoxReflector.h>

Inheritance diagram for CCheckBoxReflector:

IControlReflector

List of all members.


Public Types

enum  Alignement { LeftFromText, RightFromText, DisableText }

Public Member Functions

 CCheckBoxReflector (Alignement style=DefaultStyle)
 Constructor.
virtual ~CCheckBoxReflector ()
 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 nothing. Stop previous edit in place if it can. Always returns true.
virtual void ShowControl ()
 Shows the control.
virtual bool CanStopEdit (const CEditInPlaceContext &context, IEditInPlace::StopReason reason) const
 Does nothing. Always returns true.
virtual bool Apply (CEditInPlaceContext &context, const Common::CFormat *format)
 Applies the new value, set by the user to the specified field in the data object.
virtual bool DetachAndDestroyControl (CGrid &grid, HITEM hItem, const CColumn *column)
 Does nothing. Always returns true.
virtual bool CanDrawControl (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Indicates that the control should be painted in CGrid painting routine.
virtual void PostPaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Performs check box drawing after the cell is painted.
virtual UINT PrePaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 The function modifies the paintFilter to prevent from text drawing in the cell painting procedure.
virtual bool CanActivateOnThumbClick (const CEditInPlaceContext &context, const Common::CFormat *format) const
 Indicates that the control can be activated if the user clicks inside of the cell.
virtual CWnd * GetControl ()
 Reflector doesn't have an MFC control and always returns zero.

Detailed Description

Performs edit in place operations on bool-type fields.

The reflector doesn't create underlying MFC control, but simulates checkbox behavior by painting an appropriate control in CGrid cell.

Version:
2.0.0 Initial version

Member Enumeration Documentation

enum Alignement

Enumerator:
LeftFromText  Paints the checkbox to the left and a text to the right of the cell.
RightFromText  Paints the checkbox to the right and a text to the left of the cell.
DisableText  Paints the checkbox at the center of the cell.


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 the bool-type format.

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 nothing. Stop previous edit in place if it can. Always returns true.

Parameters:
[in] context Indicates the cell, where the control should be attached.
[in] format Format object, that permits to populate a control.
[in] startReason Indicates the reason, why the control should be activated.
Returns:
Always true.

Implements IControlReflector.

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

Does nothing. Always returns true.

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:
Always true.

Implements IControlReflector.

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

Applies the new value, set by the user 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 the unformatted form and then set it into the appropriated field of the data object.
Returns:
Always true.

Implements IControlReflector.

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

Does nothing. Always returns true.

Parameters:
[in] grid CGrid object
[in] hItem Handle of a line in CGrid
[in] column Column in the grid
Returns:
Always true.

Implements IControlReflector.

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

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

Returns:
True if the underlying field type is boolean.

Implements IControlReflector.

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

Performs check box drawing after the cell is painted.

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.

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

The function modifies the paintFilter to prevent from text drawing in the cell painting procedure.

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 the cell painting.

Reimplemented from IControlReflector.

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

Indicates that the control can be activated if the user clicks inside of the cell.

Parameters:
[in] context Indicates the cell, where the control is attached.
[in] format Format object, that permits to populate MFC control.
Returns:
Always true.

Implements IControlReflector.

CWnd * GetControl (  )  [virtual]

Reflector doesn't have an MFC control and always returns zero.

Returns:
Always zero.

Implements IControlReflector.