MFC Grid manual

CCustomDraw Class Reference

Default implementation of ICustomDraw interface. More...

#include <Dapfor/GUI/CustomDraw.h>

Inheritance diagram for CCustomDraw:

ICustomDraw IAutoDelete

List of all members.


Public Member Functions

 CCustomDraw (bool bAutoDelete=false)
 Constructor.
virtual void DrawHeader (CHeaderPaintInfo &paintInfo, const CPaintContext &paintContext, UINT paintFilter)
 Called to draw a header in CGrid.
virtual void DrawColumn (CColumnPaintInfo &paintInfo, const CPaintContext &paintContext, UINT paintFilter)
 Called to draw a column in CGrid.
virtual void DrawLine (CGridLine &line, const CPaintContext &paintContext, UINT paintFilter)
 Called to draw a line.
virtual void DrawCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Called to draw a cell.
virtual const ILinePaintFormatGetLinePaintFormat (const Common::CDataObject *pDO, HITEM hItem, ContextType contextType, int nRow) const
 Provides default line paint format. The user can specify his preferred format for each line in CGrid.
virtual const ICellPaintFormatGetCellPaintFormat (const CColumn *column, const Common::CDataObject *pDO, HITEM hItem, ContextType contextType, int nRow) const
 Provides default cell paint format. The user can specify his preferred format for each cell in CGrid.
virtual int GetOptimalHeaderHeight (CHeaderPaintInfo &paintInfo, const CPaintContext &paintContext, UINT paintFilter) const
 Calculates optimal header height.
virtual int GetOptimalRowHeight (CFont *font, CDC &dc) const
 Calculates optimal row height.
virtual int GetOptimalCellWidth (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Calculates optimal cell width considering a font, hierarchy, text size...
virtual bool AutoDelete () const
 IAutoDelete implementation. The function always returns true.

Detailed Description

Default implementation of ICustomDraw interface.

Version:
1.0.0.0 Initial version
See also:
Read Drawing workflow and Custom drawing to get more information about custom drawing.

Constructor & Destructor Documentation

CCustomDraw ( bool  bAutoDelete = false  ) 

Constructor.

Parameters:
[in] bAutoDelete Indicates whether CGrid is the owner of this object. If this parameter is true, CGrid will destroy this object in its own destructor.


Member Function Documentation

void DrawHeader ( CHeaderPaintInfo paintInfo,
const CPaintContext paintContext,
UINT  paintFilter 
) [virtual]

Called to draw a header in CGrid.

Parameters:
[in] paintInfo Header related infomation.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.

Implements ICustomDraw.

void DrawColumn ( CColumnPaintInfo paintInfo,
const CPaintContext paintContext,
UINT  paintFilter 
) [virtual]

Called to draw a column in CGrid.

Parameters:
[in] paintInfo Column related infomation.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.

Implements ICustomDraw.

void DrawLine ( CGridLine line,
const CPaintContext paintContext,
UINT  paintFilter 
) [virtual]

Called to draw a line.

Parameters:
[in] line Line related infomation to perform painting.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.

Implements ICustomDraw.

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

Called to draw a cell.

Parameters:
[in] cell Cell related infomation to perform painting.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.

Implements ICustomDraw.

const ILinePaintFormat & GetLinePaintFormat ( const Common::CDataObject pDO,
HITEM  hItem,
ContextType  contextType,
int  nRow 
) const [virtual]

Provides default line paint format. The user can specify his preferred format for each line in CGrid.

Parameters:
[in] pDO Pointer to a data object.
[in] hItem Handle in CGrid
[in] contextType Context type, where a handle is placed.
[in] nRow Index of a line in CGrid.
Returns:
Reference to the format which paints lines in CGrid.

Implements ICustomDraw.

const ICellPaintFormat & GetCellPaintFormat ( const CColumn column,
const Common::CDataObject pDO,
HITEM  hItem,
ContextType  contextType,
int  nRow 
) const [virtual]

Provides default cell paint format. The user can specify his preferred format for each cell in CGrid.

Parameters:
[in] column Pointer to a column.
[in] pDO Pointer to a data object.
[in] hItem Handle in CGrid
[in] contextType Context type where a handle is placed.
[in] nRow Index of a line in CGrid.
Returns:
Reference to the format which paints calls in CGrid.

Implements ICustomDraw.

int GetOptimalHeaderHeight ( CHeaderPaintInfo paintInfo,
const CPaintContext paintContext,
UINT  paintFilter 
) const [virtual]

Calculates optimal header height.

Parameters:
[in] paintInfo Header related infomation.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.
Returns:
Value, indicating an optimal height of the header

Implements ICustomDraw.

int GetOptimalRowHeight ( CFont *  font,
CDC &  dc 
) const [virtual]

Calculates optimal row height.

Parameters:
[in] font The font, used by CGrid.
[in] dc Device context.
Returns:
Value, indicating an optimal height of the row

Implements ICustomDraw.

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

Calculates optimal cell width considering a font, hierarchy, text size...

Parameters:
[in] cell Cell related infomation.
[in] paintContext General information like device context, reference to CGrid, header, etc...
[in] paintFilter Set of painting operations, defined in PaintFilter enumeration.
Returns:
Value, indicating an optimal width of the cell

Implements ICustomDraw.