Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GRDSTD.H>
Link against: grid.lib

Class CGridLabelImg

class CGridLabelImg : public CBase;

Description

Draws a grid cell's label.

Derivation

Members

Defined in CGridLabelImg:

Inherited from CBase:


Construction and destruction


~CGridLabelImg()

IMPORT_C virtual ~CGridLabelImg();

Description

Destructor.

Releases resources before the object is destroyed. Specifically, it releases the font acquired when the object was constructed.


ConstructL()

IMPORT_C void ConstructL();

Description

Implements the second phase of two-phase construction.

Specifically, it gets the nearest font to that specified in the font specification passed to the constructor.


CGridLabelImg(const TFontSpec &,MGraphicsDeviceMap *)

protected: IMPORT_C CGridLabelImg(const TFontSpec &aFontSpec, MGraphicsDeviceMap *aGraphicsDeviceMap);

Description

Constructor taking specified parameters.

Parameters

const TFontSpec &aFontSpec

A font specification in device independent terms.

MGraphicsDeviceMap *aGraphicsDeviceMap

An interface for mapping between twips and device-specific units.

[Top]


Member functions


SetGraphicsDeviceMap(MGraphicsDeviceMap *)

inline void SetGraphicsDeviceMap(MGraphicsDeviceMap *aGraphicsDeviceMap);

Description

Supplies a new interface object for mapping between twips and device-specific units.

Note that the caller must call CGridLabelImg::ReleaseFont() before calling this function, and must call CGridLabelImg::NotifyGraphicsDeviceMapChangeL() afterwards.

Parameters

MGraphicsDeviceMap *aGraphicsDeviceMap

A new interface object for mapping between twips and device-specific units.


FontSpec()const

inline TFontSpec FontSpec() const;

Description

Gets the font specification.

Return value

TFontSpec

The font specification.


ReleaseFont()

IMPORT_C void ReleaseFont();

Description

Releases the font.

This is called by the destructor, and should be called before calling CGridLabelImg::SetGraphicsDeviceMap(MGraphicsDeviceMap *).

See also:


NotifyGraphicsDeviceMapChangeL()

IMPORT_C void NotifyGraphicsDeviceMapChangeL();

Description

Deals with the result of changing the graphics device map, i.e. the interface for mapping between twips and device-specific units.

The function releases the existing font, and then tries to get the nearest font to that specified in the font specification.

See also:


SetGridColors(const TGridColors &)

inline void SetGridColors(const TGridColors &aGridColors);

Description

Sets the colours to be used when drawing the label.

Parameters

const TGridColors &aGridColors

The object containing the grid colours specification.


DrawTopLeftLabelL(CGraphicsContext *,const TRect &,TRgb)const

protected: IMPORT_C void DrawTopLeftLabelL(CGraphicsContext *aGc, const TRect &aRect, TRgb aColor) const;

Description

Fills the specified rectangle with the specified colour.

Parameters

CGraphicsContext *aGc

The graphics context to be used.

const TRect &aRect

The rectangle to be filled.

TRgb aColor

The colour which is to fill the rectangle.


DrawRowLabelL(CGraphicsContext *,TInt,const TRect &)const

private: virtual void DrawRowLabelL(CGraphicsContext *aGc, TInt aRow, const TRect &aRect) const=0;

Description

Draws a row label.

Parameters

CGraphicsContext *aGc

The graphics context to be used.

TInt aRow

The row for which the label is to be drawn.

const TRect &aRect

The rectangle in which the label is to be drawn.


DrawColLabelL(CGraphicsContext *,TInt,const TRect &)const

private: virtual void DrawColLabelL(CGraphicsContext *aGc, TInt aCol, const TRect &aRect) const=0;

Description

Draws a column label.

Parameters

CGraphicsContext *aGc

The graphics context to be used.

TInt aCol

The column for which the label is to be drawn.

const TRect &aRect

The rectangle in which the label is to be drawn.


DrawTopLeftLabelL(CGraphicsContext *,const TRect &)const

private: IMPORT_C virtual void DrawTopLeftLabelL(CGraphicsContext *aGc, const TRect &aRect) const;

Description

Fills the specified rectangle with a colour.

The default implementation fills the specified rectangle with the background colour value as defined by the grid colour specification in iGridColors.

Parameters

CGraphicsContext *aGc

The graphics context to be used.

const TRect &aRect

The rectangle to be filled.

See also:


SideLabelWidthInPixels(TInt,TInt)const

private: IMPORT_C virtual TInt SideLabelWidthInPixels(TInt aStartRow, TInt aEndRow) const;

Description

Gets the width of the side labels.

Parameters

TInt aStartRow

A start row. The default implementation does not use this value, but a derived class can use this to define the start of a range of rows, which may be useful if side labels have variable widths.

TInt aEndRow

An end row. The default implementation does not use this value, but a derived class can use this to define the end of a range of rows, which may be useful if side labels have variable widths.

Return value

TInt

The width value, in pixels. The default implementation returns the pixel value corresponding to the twips value EDefaultSideLabelWidthInTwips, as converted by the graphics device map function MGraphicsDeviceMap::HorizontalTwipsToPixels(TInt)const.


TopLabelHeightInPixels()const

private: IMPORT_C virtual TInt TopLabelHeightInPixels() const;

Description

Gets the height of the top labels.

Return value

TInt

The height value, in pixels. The default implementation returns the pixel value corresponding to the twips value EDefaultTopLabelHeightInTwips, as converted by the graphics device map function MGraphicsDeviceMap::VerticalTwipsToPixels(TInt)const.


DrawRowCursorL(CGraphicsContext *,const TRect &)const

private: IMPORT_C virtual void DrawRowCursorL(CGraphicsContext *aGc, const TRect &aRect) const;

Description

Draws a cursor to identify a row.

The default implementation is empty.

Parameters

CGraphicsContext *aGc

The graphics context to be used.

const TRect &aRect

The rectangle in which the cursor is to be drawn.

[Top]


Member enumerations


Enum anonymous

protected: n/a

Description

EDefaultSideLabelWidthInTwips

The default width of side labels, in twips.

This is used by the default implementation of CGridLabelImg::SideLabelWidthInPixels(TInt,TInt)const.

EDefaultTopLabelHeightInTwips

The default height of top labels, in twips.

This is used by the default implementation of CGridLabelImg::TopLabelHeightInPixels()const.

[Top]


Member data


iFont

protected: CFont * iFont;

Description

The nearest font to that specified in the font specification.


iFontSpec

protected: TFontSpec iFontSpec;

Description

The font specification in device independent terms.


iGraphicsDeviceMap

protected: MGraphicsDeviceMap * iGraphicsDeviceMap;

Description

The graphics device map, an interface for mapping between twips and device-specific units.


iGridColors

protected: TGridColors iGridColors;

Description

The grid colour specification.