MFC Grid manual

CCellPaintFormat Class Reference

Default implementation of ICellPaintFormat interface. Performs painting of a cell in CGrid. More...

#include <Dapfor/GUI/CellPaintFormat.h>

Inheritance diagram for CCellPaintFormat:

ICellPaintFormat CProgressCellPaintFormat

List of all members.


Public Member Functions

virtual void DrawCell (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Paints a cell in CGrid.
virtual COLORREF GetBackColor (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Gets an effective background color of a cell after blending.
virtual COLORREF GetForeColor (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Gets an effective foreground color of a cell after blending.
virtual int GetOptimalCellWidth (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Gets an optimal width of a cell.
virtual CRect GetImageRect (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Gets the rectangle, occupied by the icon painted in a cell.
virtual CRect GetTextRect (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter) const
 Gets cell bounds where a text can be drawn.
virtual ICellPaintFormatClone () const
 Gets a clone of a format.

Protected Member Functions

virtual void OnDrawBackGround (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw a background of a cell in CGrid.
virtual void OnDrawMouseSelection (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw the rectangle, selected by the mouse, moved with the pressed right button and which intersects with a cell in CGrid.
virtual void OnDrawText (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw a text inside a cell in CGrid.
virtual void OnDrawImage (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw an icon inside a cell in CGrid.
virtual void OnDrawFocusedLineFrame (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw a frame around the focused line in CGrid.
virtual void OnDrawSelectedLineFrame (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw a frame around the selected line in CGrid.
virtual void OnDrawHierarchy (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw hierarchical icons (+/-) inside a cell in CGrid.
virtual void OnDrawDropPosition (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw a line between two rows that indicates where drop operation is performed.
virtual void OnDrawDropParentPosition (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw an indicator that points to the hierarchical item, which becomes a parent for the dropped lines.
virtual void OnDrawVerticalLines (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw vertical lines that separate columns in CGrid.
virtual void OnDrawHorizontalLines (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw horizontal lines that separate rows in CGrid.
virtual void OnDrawEditInPlace (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to perform Edit in place specefic drawing in CGrid.
virtual void OnNextPaintRequest (CGridCell &cell, const CPaintContext &paintContext, UINT paintFilter)
 Is called to draw highlighting in a cell.

Detailed Description

Default implementation of ICellPaintFormat interface. Performs painting of a cell in CGrid.

Version:
1.0.0.0 Initial version

Member Function Documentation

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

Paints a cell in CGrid.

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.

Implements ICellPaintFormat.

Reimplemented in CProgressCellPaintFormat.

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

Gets an effective background color of a cell after blending.

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:
Resulting background color after alpha-blend operations

Implements ICellPaintFormat.

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

Gets an effective foreground color of a cell after blending.

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:
Resulting foreground color after alpha-blend operations

Implements ICellPaintFormat.

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

Gets an optimal width of a cell.

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:
Optimal width of the cell

Implements ICellPaintFormat.

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

Gets the rectangle, occupied by the icon painted in a cell.

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:
Rectangle occupied by the icon

Implements ICellPaintFormat.

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

Gets cell bounds where a text can be drawn.

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:
Rectangle which can be used for text painting in the cell

Implements ICellPaintFormat.

ICellPaintFormat * Clone (  )  const [virtual]

Gets a clone of a format.

Returns:
Deep copy of the object.

Implements ICellPaintFormat.

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

Is called to draw a background of a cell in CGrid.

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

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

Is called to draw the rectangle, selected by the mouse, moved with the pressed right button and which intersects with a cell in CGrid.

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

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

Is called to draw a text inside a cell in CGrid.

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

Reimplemented in CProgressCellPaintFormat.

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

Is called to draw an icon inside a cell in CGrid.

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

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

Is called to draw a frame around the focused line in CGrid.

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

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

Is called to draw a frame around the selected line in CGrid.

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

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

Is called to draw hierarchical icons (+/-) inside a cell in CGrid.

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

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

Is called to draw a line between two rows that indicates where drop operation is performed.

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

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

Is called to draw an indicator that points to the hierarchical item, which becomes a parent for the dropped lines.

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

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

Is called to draw vertical lines that separate columns in CGrid.

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

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

Is called to draw horizontal lines that separate rows in CGrid.

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

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

Is called to perform Edit in place specefic drawing in CGrid.

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

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

Is called to draw highlighting in a cell.

In case when highlighting is enabled, the function asks CGrid for the next painting. A time interval is calculated according to the highlighting type and user preferences. When the interval expires, the grid automatically invalidates the rectangle occupied by the cell and then repaints it.

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