Public Member Functions | |
virtual void | DrawHeader (CHeaderPaintInfo &paintInfo, const CPaintContext &paintContext, UINT paintFilter)=0 |
Called to draw a header in CGrid. | |
virtual void | DrawColumn (CColumnPaintInfo &paintInfo, const CPaintContext &paintContext, UINT paintFilter)=0 |
Called to draw a column in CGrid. | |
virtual void | DrawLine (CGridLine &line, const CPaintContext &paintContext, UINT paintFilter)=0 |
Called to draw a line. | |
virtual void | DrawCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)=0 |
Called to draw a cell. | |
virtual const ILinePaintFormat & | GetLinePaintFormat (const Common::CDataObject *pDO, HITEM hItem, ContextType contextType, int nRow) const =0 |
Provides default line paint format. The user can specify his preferred format for each line in CGrid. | |
virtual const ICellPaintFormat & | GetCellPaintFormat (const CColumn *column, const Common::CDataObject *pDO, HITEM hItem, ContextType contextType, int nRow) const =0 |
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 =0 |
Calculates optimal header height. | |
virtual int | GetOptimalRowHeight (CFont *font, CDC &dc) const =0 |
Calculates optimal row height. | |
virtual int | GetOptimalCellWidth (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const =0 |
Calculates optimal cell width considering a font, hierarchy, text size... |
It is designed to customize drawing of all elements in the grid. This interface is the central point through which all information for drawing each grid element is passed. Grid functions are divided into three groups. The first group is for drawing headers, the second group is for drawing lines and cells and the third group returns optimal lines, columns and cells sizes calculated on the basis of grid settings, font size, size of text displayed in cells, hierarchy and so on.
The interface itself is not designed for direct manipulation of "device context", although nothing prevents to do so. Originally specialized formats were intended for this purpose. IHeaderPaintFormat header and its default implementation CHeaderPaintFormat are used for painting. This format only calculates column size and location in the grid and hands over the painting task to IColumnPaintFormat via ICustomDraw. Neither IHeaderPaintFormat nor ICustomDraw performs direct column painting.
The same mechanism is used for painting lines and cells. ICustomDraw passes all necessary information to ILinePaintFormat that calculates cell location in the grid and uses ICustomDraw to pass the calculated information to ICellPaintFormat that performs painting directly.
Such approach enables storage of all graphical information at one place and complete re-definition of grid painting at any moment. When you need to redefine colors, font or icon to forbid displaying selection in some separate cells, ICustomDraw is the best choice. As for calculation of optimal height or width of headers, lines and cells, formats can do this best of all because they know how will information be displayed on screen.
void DrawHeader | ( | CHeaderPaintInfo & | paintInfo, | |
const CPaintContext & | paintContext, | |||
UINT | paintFilter | |||
) | [pure virtual] |
Called to draw a header in CGrid.
[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. |
Implemented in CCustomDraw.
void DrawColumn | ( | CColumnPaintInfo & | paintInfo, | |
const CPaintContext & | paintContext, | |||
UINT | paintFilter | |||
) | [pure virtual] |
Called to draw a column in CGrid.
[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. |
Implemented in CCustomDraw.
void DrawLine | ( | CGridLine & | line, | |
const CPaintContext & | paintContext, | |||
UINT | paintFilter | |||
) | [pure virtual] |
Called to draw a line.
[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. |
Implemented in CCustomDraw.
void DrawCell | ( | CGridCell & | cell, | |
const CPaintContext & | paintContext, | |||
UINT | paintFilter | |||
) | [pure virtual] |
Called to draw a cell.
[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. |
Implemented in CCustomDraw.
const ILinePaintFormat & GetLinePaintFormat | ( | const Common::CDataObject * | pDO, | |
HITEM | hItem, | |||
ContextType | contextType, | |||
int | nRow | |||
) | const [pure virtual] |
Provides default line paint format. The user can specify his preferred format for each line in CGrid.
[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. |
Implemented in CCustomDraw.
const ICellPaintFormat & GetCellPaintFormat | ( | const CColumn * | column, | |
const Common::CDataObject * | pDO, | |||
HITEM | hItem, | |||
ContextType | contextType, | |||
int | nRow | |||
) | const [pure virtual] |
Provides default cell paint format. The user can specify his preferred format for each cell in CGrid.
[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. |
Implemented in CCustomDraw.
int GetOptimalHeaderHeight | ( | CHeaderPaintInfo & | paintInfo, | |
const CPaintContext & | paintContext, | |||
UINT | paintFilter | |||
) | const [pure virtual] |
Calculates optimal header height.
[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. |
Implemented in CCustomDraw.
int GetOptimalRowHeight | ( | CFont * | font, | |
CDC & | dc | |||
) | const [pure virtual] |
Calculates optimal row height.
[in] | font | The font, used by CGrid. |
[in] | dc | Device context. |
Implemented in CCustomDraw.
int GetOptimalCellWidth | ( | CGridCell & | cell, | |
const CPaintContext & | paintContext, | |||
UINT | paintFilter | |||
) | const [pure virtual] |
Calculates optimal cell width considering a font, hierarchy, text size...
[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. |
Implemented in CCustomDraw.
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |