Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:

Inherited from CBase:

Inherited from MCoeControlContext:


Construction and destruction


NewL()

IMPORT_C 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


SetBrushStyle(CWindowGc::TBrushStyle)

IMPORT_C void SetBrushStyle(CWindowGc::TBrushStyle aBrushStyle);

Description

Sets the brush style.

Parameters

CGraphicsContext::TBrushStyle aBrushStyle

The brush style to be used for drawing.


SetBrushColor(TRgb)

IMPORT_C void SetBrushColor(TRgb aColor);

Description

Sets the brush colour.

Parameters

TRgb aColor

The brush colour.


SetBrushBitmap(const CFbsBitmap &)

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

IMPORT_C void SetPenColor(TRgb aColor);

Description

Sets the pen colour.

Parameters

TRgb aColor

The pen colour.


BrushStyle()const

IMPORT_C CWindowGc::TBrushStyle BrushStyle() const;

Description

Gets the brush style.

Return value

CGraphicsContext::TBrushStyle

The current brush style.


BrushColor()const

IMPORT_C TRgb BrushColor() const;

Description

Gets the brush colour.

Return value

TRgb

The current brush colour.


BrushBitmap()const

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

IMPORT_C TRgb PenColor() const;

Description

Gets the pen colour.

Return value

TRgb

The current pen colour.


PrepareContext(CWindowGc &)const

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