Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: GRDSTD.H
Link against: grid.lib

Class CGridLabelImg

class CGridLabelImg : public CBase;

Description

Draws a grid cell's label.

Derivation

Members

Defined in CGridLabelImg:
CGridLabelImg(), ConstructL(), DrawColLabelL(), DrawRowCursorL(), DrawRowLabelL(), DrawTopLeftLabelL(), DrawTopLeftLabelL(), EDefaultSideLabelWidthInTwips, EDefaultTopLabelHeightInTwips, FontSpec(), NotifyGraphicsDeviceMapChangeL(), ReleaseFont(), SetGraphicsDeviceMap(), SetGridColors(), SideLabelWidthInPixels(), TopLabelHeightInPixels(), anonymous, iFont, iFontSpec, iGraphicsDeviceMap, iGridColors, ~CGridLabelImg()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CGridLabelImg()

virtual IMPORT_C ~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()

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()

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 ReleaseFont() before calling this function, and must call NotifyGraphicsDeviceMapChangeL() afterwards.

Parameters

MGraphicsDeviceMap *aGraphicsDeviceMap

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


FontSpec()

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 SetGraphicsDeviceMap().

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()

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()

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()

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()

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()

private: virtual IMPORT_C 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()

private: virtual IMPORT_C 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().


TopLabelHeightInPixels()

private: virtual IMPORT_C 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().


DrawRowCursorL()

private: virtual IMPORT_C 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 SideLabelWidthInPixels().

EDefaultTopLabelHeightInTwips

The default height of top labels, in twips.

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

[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.