TGulBorder Class Reference

class TGulBorder

Draws a border around a control.

The rectangular areas enclosed by borders are typically working areas of the graphics context so the class supplies a number of methods which describe how it occupies the area.

A distinction between descriptive and logical borders is made. For descriptive borders the appearance of the border is known and fixed. The type of border drawn is determined by flags which describe how it is to be constructed. These flags can be combined to achieve many different effects, and standard combinations have been supplied (see the TBorderType enumeration). For logical borders the use of the border is known and fixed but the appearance is not specified. The appearance and sizing functions must be supplied in custom written code.

Nested Classes and Structures

Public Member Functions
TGulBorder()
TGulBorder(TBorderType)
TGulBorder(TBorderType, TGulAdjacent)
TGulBorder(TInt)
TGulBorder(TInt, TGulAdjacent)
IMPORT_C TIntAdjacent()
IMPORT_C voidDraw(CGraphicsContext &, const TRect &, const TColors &)
IMPORT_C voidDraw(CGraphicsContext &, const TRect &)
IMPORT_C TBoolHasBorder()
IMPORT_C TRectInnerRect(const TRect &)
IMPORT_C TMarginsMargins()
IMPORT_C TRectOuterRect(const TRect &)
IMPORT_C TIntRounding()
IMPORT_C voidSetAdjacent(TInt)
IMPORT_C voidSetType(TInt)
IMPORT_C TSizeSizeDelta()
IMPORT_C TIntThickness()
IMPORT_C TIntType()
Private Member Functions
TRect BorderInnerRect(const TRect &)
TMargins BorderMargins()
TInt BorderRounding()
TInt Depth()
voidDrawBottomRight(CGraphicsContext &, const TRect &, TRgb, const TInt)
voidDrawInline(CGraphicsContext &, const TRect &, TRgb)
voidDrawInvertedTwoStep(CGraphicsContext &, const TRect &, TRgb, TRgb, TRgb, TRgb)
voidDrawOneStep(CGraphicsContext &, const TRect &, TRgb, TRgb)
voidDrawOutline(CGraphicsContext &, const TRect &, TRgb)
voidDrawRectOutline(CGraphicsContext &, const TRect &)
voidDrawRoundedBottomRight(CGraphicsContext &, const TRect &, const TInt)
voidDrawRoundedCorner(CGraphicsContext &, const TPoint &, const TInt, const TBool, const TBool)
voidDrawRoundedTopLeft(CGraphicsContext &, const TRect &, const TInt)
voidDrawThreeStep(CGraphicsContext &, const TRect &, TRgb, TRgb, TRgb, TRgb, TRgb)
voidDrawTopLeft(CGraphicsContext &, const TRect &, TRgb, const TInt)
voidDrawTwoStep(CGraphicsContext &, const TRect &, TRgb, TRgb, TRgb, TRgb)
TMargins InlineMargins()
TInt InlineRounding()
TInt InternalType()
TBool IsSunken()
TRect OutlineInnerRect(const TRect &)
TMargins OutlineMargins()
TInt RoundingMargin(const TInt)
voidTranslateLegacyTypes()
Public Member Enumerations
enumT3DStyle { EFlat = 0x10, ESunken = 0x20, ERaised = 0x40 }
enumTBorderType {
ENone = ENoBorder, ESingleGray = EWithOutline|EGray, ESingleBlack = EWithOutline|EBlack, ESingleDotted = EWithOutline|EDottedOutline, EShallowRaised = ERaised|EOneStep|EAddOnePixel, EShallowSunken = ESunken|EOneStep|EAddOnePixel, EDeepRaised = EWithOutline|ERaised|EOneStep|EAddTwoPixels, EDeepRaisedWithOutline = EWithOutline|ERaised|EOneStep|EAddTwoPixels, EDeepSunken = EWithOutline|ESunken|EOneStep|EAddTwoPixels, EDeepSunkenWithOutline = EWithOutline|ESunken|EOneStep|EAddTwoPixels, EThickDeepRaisedWithOutline = EWithOutline|ERaised|EOneStep|EAddOnePixel|EAddTwoPixels, EVerticalBar = ERaised|EOneStep|EAddTwoPixels|EWithOverlap, EHorizontalBar = ERaised|EOneStep|EAddTwoPixels|EHorizontal|EWithOverlap
}
enumTConstructionStyle { EOneStep = 0x100, ETwoStep = 0x200, EThreeStep = 0x400, EInvertedTwoStep = 0x800 }
enumTInlineStyle { EWithInline = 0x04 }
enumTLogicalFamily { EWindowFamily = ELogical|0x1, EContainerFamily = ELogical|0x2, EControlFamily = ELogical|0x3 }
enumTLogicalType {
EWindow = EWindowFamily|ERaised, EFlatContainer = EContainerFamily|EFlat, ERaisedContainer = EContainerFamily|ERaised, ESunkenContainer = EContainerFamily|ESunken, EFlatControl = EControlFamily|EFlat, ERaisedControl = EControlFamily|ERaised, ESunkenControl = EControlFamily|ESunken, EFocusedRaisedControl = EControlFamily|ERaised|0x100, EFocusedSunkenControl = EControlFamily|ESunken|0x100
}
enumTOutlineStyle { EWithOutline = 0x01, EDottedOutline = 0x02 }
enumTRounding { EAddOneRoundingPixel = 0x10000, EAddTwoRoundingPixels = 0x20000, EAddFourRoundingPixels = 0x40000 }
enumTThickness { EAddOnePixel = 0x1000, EAddTwoPixels = 0x2000, EAddFourPixels = 0x4000 }
Private Member Enumerations
enumTLegacyStyle {
EShallow = EAddOnePixel, EDeep = EAddTwoPixels, EThick = EAddFourPixels, EHorizontal = 0x100000, EWithOverlap = 0x200000, EGray = 0x400000, EBlack = 0x80000
}
enumTLogicalStyle { ELogical = 0x800000 }
enumTNull { ENoBorder = 0x00 }
Private Attributes
TInt iType

Constructor & Destructor Documentation

TGulBorder()

IMPORT_CTGulBorder()

TGulBorder(TBorderType)

IMPORT_CTGulBorder(TBorderTypeaType)

Parameters

TBorderType aType

TGulBorder(TBorderType, TGulAdjacent)

IMPORT_CTGulBorder(TBorderTypeaType,
TGulAdjacentaAdjacent
)

Parameters

TBorderType aType
TGulAdjacent aAdjacent

TGulBorder(TInt)

IMPORT_CTGulBorder(TIntaType)

Parameters

TInt aType

TGulBorder(TInt, TGulAdjacent)

IMPORT_CTGulBorder(TIntaType,
TGulAdjacentaAdjacent
)

Parameters

TInt aType
TGulAdjacent aAdjacent

Member Functions Documentation

Adjacent()

IMPORT_C TIntAdjacent()const

BorderInnerRect(const TRect &)

TRect BorderInnerRect(const TRect &aOuterRect)const [private]

Parameters

const TRect & aOuterRect

BorderMargins()

TMargins BorderMargins()const [private]

BorderRounding()

TInt BorderRounding()const [private]

Depth()

TInt Depth()const [private]

Draw(CGraphicsContext &, const TRect &, const TColors &)

IMPORT_C voidDraw(CGraphicsContext &aGc,
const TRect &aRect,
const TColors &aBorderColors
)const

Parameters

CGraphicsContext & aGc
const TRect & aRect
const TColors & aBorderColors

Draw(CGraphicsContext &, const TRect &)

IMPORT_C voidDraw(CGraphicsContext &aGc,
const TRect &aRect
)const

Parameters

CGraphicsContext & aGc
const TRect & aRect

DrawBottomRight(CGraphicsContext &, const TRect &, TRgb, const TInt)

voidDrawBottomRight(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaColor,
const TIntaRounding
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aColor
const TInt aRounding

DrawInline(CGraphicsContext &, const TRect &, TRgb)

voidDrawInline(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaColor
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aColor

DrawInvertedTwoStep(CGraphicsContext &, const TRect &, TRgb, TRgb, TRgb, TRgb)

voidDrawInvertedTwoStep(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaLight,
TRgbaMidlight,
TRgbaMid,
TRgbaDark
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aLight
TRgb aMidlight
TRgb aMid
TRgb aDark

DrawOneStep(CGraphicsContext &, const TRect &, TRgb, TRgb)

voidDrawOneStep(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaMidlight,
TRgbaMid
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aMidlight
TRgb aMid

DrawOutline(CGraphicsContext &, const TRect &, TRgb)

voidDrawOutline(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaColor
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aColor

DrawRectOutline(CGraphicsContext &, const TRect &)

voidDrawRectOutline(CGraphicsContext &aGc,
const TRect &aRect
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect

DrawRoundedBottomRight(CGraphicsContext &, const TRect &, const TInt)

voidDrawRoundedBottomRight(CGraphicsContext &aGc,
const TRect &aRect,
const TIntaRounding
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
const TInt aRounding

DrawRoundedCorner(CGraphicsContext &, const TPoint &, const TInt, const TBool, const TBool)

voidDrawRoundedCorner(CGraphicsContext &aGc,
const TPoint &aStart,
const TIntaRoundedLength,
const TBoolaUp,
const TBoolaRight
)const [private]

Parameters

CGraphicsContext & aGc
const TPoint & aStart
const TInt aRoundedLength
const TBool aUp
const TBool aRight

DrawRoundedTopLeft(CGraphicsContext &, const TRect &, const TInt)

voidDrawRoundedTopLeft(CGraphicsContext &aGc,
const TRect &aRect,
const TIntaRounding
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
const TInt aRounding

DrawThreeStep(CGraphicsContext &, const TRect &, TRgb, TRgb, TRgb, TRgb, TRgb)

voidDrawThreeStep(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaBack,
TRgbaLight,
TRgbaMidlight,
TRgbaMid,
TRgbaDark
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aBack
TRgb aLight
TRgb aMidlight
TRgb aMid
TRgb aDark

DrawTopLeft(CGraphicsContext &, const TRect &, TRgb, const TInt)

voidDrawTopLeft(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaColor,
const TIntaRounding
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aColor
const TInt aRounding

DrawTwoStep(CGraphicsContext &, const TRect &, TRgb, TRgb, TRgb, TRgb)

voidDrawTwoStep(CGraphicsContext &aGc,
const TRect &aRect,
TRgbaLight,
TRgbaMidlight,
TRgbaMid,
TRgbaDark
)const [private]

Parameters

CGraphicsContext & aGc
const TRect & aRect
TRgb aLight
TRgb aMidlight
TRgb aMid
TRgb aDark

HasBorder()

IMPORT_C TBoolHasBorder()const

InlineMargins()

TMargins InlineMargins()const [private]

InlineRounding()

TInt InlineRounding()const [private]

InnerRect(const TRect &)

IMPORT_C TRectInnerRect(const TRect &aOuterRect)const

Parameters

const TRect & aOuterRect

InternalType()

TInt InternalType()const [private, inline]

IsSunken()

TBool IsSunken()const [private]

Margins()

IMPORT_C TMarginsMargins()const

OuterRect(const TRect &)

IMPORT_C TRectOuterRect(const TRect &aInnerRect)const

Parameters

const TRect & aInnerRect

OutlineInnerRect(const TRect &)

TRect OutlineInnerRect(const TRect &aOuterRect)const [private]

Parameters

const TRect & aOuterRect

OutlineMargins()

TMargins OutlineMargins()const [private]

Rounding()

IMPORT_C TIntRounding()const

RoundingMargin(const TInt)

TInt RoundingMargin(const TIntaRoundedLength)const [private]

Parameters

const TInt aRoundedLength

SetAdjacent(TInt)

IMPORT_C voidSetAdjacent(TIntaAdjacent)

Parameters

TInt aAdjacent

SetType(TInt)

IMPORT_C voidSetType(TIntaType)

Parameters

TInt aType

SizeDelta()

IMPORT_C TSizeSizeDelta()const

Thickness()

IMPORT_C TIntThickness()const

TranslateLegacyTypes()

voidTranslateLegacyTypes()[private]

Type()

IMPORT_C TIntType()const

Member Enumerations Documentation

Enum T3DStyle

Defines the 3D border style.

Enumerators

EFlat = 0x10

A flat border.

ESunken = 0x20

A 3D effect sunken border.

ERaised = 0x40

A 3D effect raised border.

Enum TBorderType

Defines the descriptive border types.

Enumerators

ENone = ENoBorder

No border.

ESingleGray = EWithOutline|EGray

Border is a 1 pixel wide grey outline.

ESingleBlack = EWithOutline|EBlack

Border is a 1 pixel wide black outline.

ESingleDotted = EWithOutline|EDottedOutline

Border is a 1 pixel wide dotted outline.

EShallowRaised = ERaised|EOneStep|EAddOnePixel

A 3D raised border, with 1 pixel thickness.

EShallowSunken = ESunken|EOneStep|EAddOnePixel

A 3D sunken border, with 1 pixel thickness.

EDeepRaised = EWithOutline|ERaised|EOneStep|EAddTwoPixels

A 3D raised border, with outline, and 2 pixel thickness.

EDeepRaisedWithOutline = EWithOutline|ERaised|EOneStep|EAddTwoPixels

The same as EDeepRaised.

EDeepSunken = EWithOutline|ESunken|EOneStep|EAddTwoPixels

A 3D sunken border, with outline, and 2 pixel thickness.

EDeepSunkenWithOutline = EWithOutline|ESunken|EOneStep|EAddTwoPixels

The same as EDeepSunken.

EThickDeepRaisedWithOutline = EWithOutline|ERaised|EOneStep|EAddOnePixel|EAddTwoPixels

A 3D raised border, with outline, and 3 pixel thickness.

EVerticalBar = ERaised|EOneStep|EAddTwoPixels|EWithOverlap

A 3D raised border, with 2 pixels thickness and no outline on the left and right hand sides.

EHorizontalBar = ERaised|EOneStep|EAddTwoPixels|EHorizontal|EWithOverlap

A 3D raised border, with 2 pixels thickness and no outline on the top and bottom.

Enum TConstructionStyle

Defines the border's construction style.

Enumerators

EOneStep = 0x100

One step border construction.

This type of border is drawn using the mid light and mid dark colours on opposite sides of the border.

ETwoStep = 0x200

Two step border construction.

This type of border uses light and dark colours for the main border frame (or mid light for the flat border), and an additional half frame using mid light or mid dark colours.

EThreeStep = 0x400

Three step border construction.

This type of border is drawn with an outer frame, a repeating one pixel band in mid tones, and an inner frame.

EInvertedTwoStep = 0x800

Inverted two step border construction.

This is the same as ETwoStep except that for raised and sunken borders, the additional half frame is drawn on the opposite side to that used in ETwoStep.

Enum TInlineStyle

Defines whether or not the border has a single pixel interior border.

By default it does not.

Enumerators

EWithInline = 0x04

The border has an interior border.

Enum TLegacyStyle

Enumerators

EShallow = EAddOnePixel
EDeep = EAddTwoPixels
EThick = EAddFourPixels
EHorizontal = 0x100000
EWithOverlap = 0x200000
EGray = 0x400000
EBlack = 0x80000

Enum TLogicalFamily

For logical borders, defines whether the border encloses a window, a container control or a control.

Enumerators

EWindowFamily = ELogical|0x1

Logical border around a window.

EContainerFamily = ELogical|0x2

Logical border around a container.

EControlFamily = ELogical|0x3

Logical border around a control.

Enum TLogicalStyle

Enumerators

ELogical = 0x800000

Enum TLogicalType

Defines the logical border types.

Enumerators

EWindow = EWindowFamily|ERaised

Raised border around a window.

EFlatContainer = EContainerFamily|EFlat

Flat border around a container.

ERaisedContainer = EContainerFamily|ERaised

Raised border around a container.

ESunkenContainer = EContainerFamily|ESunken

Sunken border around a container.

EFlatControl = EControlFamily|EFlat

Flat border around a control.

ERaisedControl = EControlFamily|ERaised

Raised border around a control.

ESunkenControl = EControlFamily|ESunken

Sunken border around a control.

EFocusedRaisedControl = EControlFamily|ERaised|0x100

Raised border around a control with focus.

EFocusedSunkenControl = EControlFamily|ESunken|0x100

Sunken border around a control with focus.

Enum TNull

Enumerators

ENoBorder = 0x00

Enum TOutlineStyle

Defines the border outline style.

Note that not all border types have an outline.

Enumerators

EWithOutline = 0x01

The border has a single pixel outline, either solid (by default) or dotted.

EDottedOutline = 0x02

The border outline is drawn using a dotted pen.

Enum TRounding

Defines the number of pixels that are removed to produce rounded corners.

Enumerators

EAddOneRoundingPixel = 0x10000

Border rounded by removing one extra pixel.

EAddTwoRoundingPixels = 0x20000

Border rounded by removing two extra pixels.

EAddFourRoundingPixels = 0x40000

Border rounded by by removing four extra pixels.

Enum TThickness

Defines the number of pixels to add to the border thickness.

The border thickness is the central part of the border, coloured in the mid-tone highlights and lowlights.

For two step-constructed borders, the additional pixels are only added to either the top left or bottom right hand sides.

Enumerators

EAddOnePixel = 0x1000

The border has one extra pixel.

EAddTwoPixels = 0x2000

The border has two extra pixels.

EAddFourPixels = 0x4000

The border has four extra pixels.

Member Data Documentation

TInt iType

TInt iType[private]