Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: coecntx.h
Link against: cone.lib

Class CCoeBrushAndPenContext

CCoeBrushAndPenContext

Support

Supported from 5.1

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

CBaseBase class for all classes to be instantiated on the heap
CCoeBrushAndPenContextBrush and pen graphics context
MCoeControlContextInterface to allow sharing of graphics settings between controls

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

Inherited from CBase:
operator new()

Inherited from MCoeControlContext:
ActivateContext(), ResetContext()


Construction and destruction


NewL()

static 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


BrushBitmap()

const CFbsBitmap& BrushBitmap() const;

Description

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

Return value

CFbsBitmap&

The pattern bitmap.


BrushColor()

TRgb BrushColor() const;

Description

Gets the brush colour.

Return value

TRgb

The current brush colour.


BrushStyle()

CWindowGc::TBrushStyle BrushStyle() const;

Description

Gets the brush style.

Return value

CWindowGc::TBrushStyle

The current brush style.


PenColor()

TRgb PenColor() const;

Description

Gets the pen colour.

Return value

TRgb

The current pen colour.


SetBrushBitmap()

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.


SetBrushColor()

void SetBrushColor(TRgb aColor);

Description

Sets the brush colour.

Parameters

TRgb aColor

The brush colour.


SetBrushStyle()

void SetBrushStyle(CWindowGc::TBrushStyle aBrushStyle);

Description

Sets the brush style.

Parameters

CWindowGc::TBrushStyle aBrushStyle

The brush style to be used for drawing.


SetPenColor()

void SetPenColor(TRgb aColor);

Description

Sets the pen colour.

Parameters

TRgb aColor

The pen colour.


PrepareContext()

protected: 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.