MFC Grid manual

IEditInPlace Class Reference

Manages all phases of edit in place process. More...

#include <Dapfor/GUI/IEditInPlace.h>

Inheritance diagram for IEditInPlace:

IAutoDelete CEditInPlace

List of all members.


Public Types

enum  StartReason { ActivateOnMouseClick, ActivateOnMouseDblClick, ActivateOnNavigation, ActivateOnUserStart }
 Indicates the reason for the start of edit in place. More...
enum  StopReason {
  Undefined, KeyReturn, KeyEscape, KeyUp,
  KeyDown, KeyLeft, KeyRight, KeyPageUp,
  KeyPageDown, KeyHome, KeyEnd, KeySpace,
  KeyTab, KeyShiftTab, KeyCtrlTab, MouseWheelUp,
  MouseWheelDown, MouseRBDown, MouseLBDown, MouseLBDblClick,
  MouseRBDblClick , LostFocus, UserStop
}
 Indicates the reason for the stop of edit in place. More...

Public Member Functions

virtual ~IEditInPlace ()
 Virtual destructor.
virtual bool CanBeginEdit (const CEditInPlaceContext &context, StartReason startReason) const =0
 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)=0
virtual bool CanStopEdit (const CEditInPlaceContext &context, StopReason stopReason) const =0
 Indicates whether edit in place can be stopped.
virtual void OnBeginEdit (const CEditInPlaceContext &context, CWnd *editControl)=0
 Called at the beginning of edit in place.
virtual void OnEndEdit (CEditInPlaceContext &context, StopReason stopReason, CWnd *detachedControl, const Common::CFormat *format)=0
 Stops edit in place. Detaches a control throught IControlReflector interface.
virtual bool Navigate (CEditInPlaceContext &context, StopReason stopReason)=0
 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)=0
 Forwards cell drawing of CGrid painting routine to an appropriate reflector before the cell is pained.
virtual void PostPaintCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)=0
 Forwards cell drawing of CGrid painting routine to an appropriate reflector after the cell is pained.

Classes

struct  NavigationTarget
 Determines the next cell which can participate in navigation. More...

Detailed Description

Manages all phases of edit in place process.

Version:
1.0.0.0 Initial version

Member Enumeration Documentation

enum StartReason

Indicates the reason for the start of edit in place.

Enumerator:
ActivateOnMouseClick  The user clicks with the left mouse button on a cell.
ActivateOnMouseDblClick  The user double clicks with the left mouse button on a cell.
ActivateOnNavigation  Navigation between edit in place controls.
ActivateOnUserStart  Other reasons.

enum StopReason

Indicates the reason for the stop of edit in place.

Enumerator:
Undefined  Undefined cause.
KeyReturn  Stop because 'Return' is pressed.
KeyEscape  Stop because 'Escape' is pressed.
KeyUp  Stop because 'Key up' is pressed.
KeyDown  Stop because 'Key down' is pressed.
KeyLeft  Stop because 'Key left' is pressed.
KeyRight  Stop because 'Key right'is pressed.
KeyPageUp  Stop because 'Page up' is pressed.
KeyPageDown  Stop because 'Page down' is pressed.
KeyHome  Stop because 'Home' is pressed.
KeyEnd  Stop because 'End' is pressed.
KeySpace  Stop because 'Space' is pressed.
KeyTab  Stop because 'Tab' is pressed.
KeyShiftTab  Stop because 'Shith + Tab' is pressed.
KeyCtrlTab  Stop because 'Control + Tab' is pressed.
MouseWheelUp  Stop because 'Mouse wheel up' is rotated.
MouseWheelDown  Stop because 'Mouse wheel down' is rotated.
MouseRBDown  Stop because 'Mouse right button' is pressed down.
MouseLBDown  Stop because 'Mouse left button' is pressed down.
MouseLBDblClick  Stop because 'Mouse right button' is double clicked.
MouseRBDblClick  Stop because 'Mouse left button' is double clicked.
LostFocus  Stop because the focus is lost.
UserStop  Other reasons.


Member Function Documentation

bool CanBeginEdit ( const CEditInPlaceContext context,
StartReason  startReason 
) const [pure 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.

Implemented in CEditInPlace.

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

Implemented in CEditInPlace.

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

Implemented in CEditInPlace.

void OnEndEdit ( CEditInPlaceContext context,
StopReason  stopReason,
CWnd *  detachedControl,
const Common::CFormat format 
) [pure 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.

Implemented in CEditInPlace.

bool Navigate ( CEditInPlaceContext context,
StopReason  stopReason 
) [pure 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.

Implemented in CEditInPlace.

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

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

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.

Implemented in CEditInPlace.

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

Forwards cell drawing of CGrid painting routine to an appropriate reflector after the cell is pained.

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.

Implemented in CEditInPlace.