Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: coeccntx.h
Link against: cone.lib

Class CCoeBrushAndPenContext

class CCoeBrushAndPenContext : public CBase, public MCoeControlContext;

Description

Brush and pen graphics context.

This class allows an MCoeControlContext to be instantiated and used to set brush and pen properties before drawing a control.

Derivation

Members

Defined in CCoeBrushAndPenContext:
BrushBitmap(), BrushColor(), BrushStyle(), NewL(), PenColor(), PrepareContext(), SetBrushBitmap(), SetBrushColor(), SetBrushStyle(), SetPenColor()

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

Inherited from MCoeControlContext:
ActivateContext(), MCoeControlContext_Reserved1(), MCoeControlContext_Reserved2(), ResetContext()


Construction and destruction


NewL()

static IMPORT_C CCoeBrushAndPenContext *NewL();

Description

Allocates and constructs a new brush and pen graphics context object.

Return value

CCoeBrushAndPenContext *

A pointer to the newly created object

[Top]


Member functions


SetBrushStyle()

IMPORT_C void SetBrushStyle(CWindowGc::TBrushStyle aBrushStyle);

Description

Sets the brush style.

Parameters

CWindowGc::TBrushStyle aBrushStyle

The brush style to be used for drawing.


SetBrushColor()

IMPORT_C void SetBrushColor(TRgb aColor);

Description

Sets the brush colour.

Parameters

TRgb aColor

The brush colour.


SetBrushBitmap()

IMPORT_C void SetBrushBitmap(const CFbsBitmap &aBitmap);

Description

Sets the drawing brush pattern bitmap.

When a bitmap has been set, a patterned style brush is selected automatically.

Parameters

const CFbsBitmap &aBitmap

The pattern bitmap.


SetPenColor()

IMPORT_C void SetPenColor(TRgb aColor);

Description

Sets the pen colour.

Parameters

TRgb aColor

The pen colour.


BrushStyle()

IMPORT_C CWindowGc::TBrushStyle BrushStyle() const;

Description

Gets the brush style.

Return value

CWindowGc::TBrushStyle

The current brush style.


BrushColor()

IMPORT_C TRgb BrushColor() const;

Description

Gets the brush colour.

Return value

TRgb

The current brush colour.


BrushBitmap()

IMPORT_C const CFbsBitmap &BrushBitmap() const;

Description

Gets a reference to the bitmap used to pattern the drawing brush.

Return value

const CFbsBitmap &

The pattern bitmap.


PenColor()

IMPORT_C TRgb PenColor() const;

Description

Gets the pen colour.

Return value

TRgb

The current pen colour.


PrepareContext()

protected: virtual IMPORT_C void PrepareContext(CWindowGc &aGc) const;

Description

Prepares the graphics context for drawing the control in its normal state.

The function uses the brush and pen properties which have been set, or uses a black pen and a black solid brush by default. When a bitmap has been set a patterned style brush is selected

Parameters

CWindowGc &aGc

The window graphics context.