TMargins8 Class Reference

#include <mw/gulutil.h>

Link against: egul.lib

class TMargins8
Public Attributes
TInt8 iBottom
TInt8 iLeft
TInt8 iRight
TInt8 iTop
Public Member Functions
TMargins8()
TMargins8(TInt8, TInt8, TInt8, TInt8)
IMPORT_C TRectInnerRect(const TRect &)
IMPORT_C TRectOuterRect(const TRect &)
IMPORT_C voidSetAllValuesTo(TInt)
IMPORT_C TSizeSizeDelta()

Detailed Description

A set of margins stored as 8 bit integer values which can represent either pixels or twips between -128 and +127.

Member Attribute Documentation

iBottom

TInt8 iBottom

Bottom margin in twips or pixels.

iLeft

TInt8 iLeft

Left margin in twips or pixels.

iRight

TInt8 iRight

Right margin in twips or pixels.

iTop

TInt8 iTop

Top margin in twips or pixels.

Constructor & Destructor Documentation

TMargins8 ( )

IMPORT_CTMargins8()

The constructor initialises all four margins to zero.

TMargins8 ( TInt8, TInt8, TInt8, TInt8 )

IMPORT_CTMargins8(TInt8aLeft,
TInt8aTop,
TInt8aRight,
TInt8aBottom
)

Constructor setting the left, top, right, and bottom margins.

Parameters
aLeftLeft margin (between -128 and +127)
aTopTop margin (between -128 and +127)
aRightRight margin (between -128 and +127)
aBottomBottom margin (between -128 and +127)

Member Function Documentation

InnerRect ( const TRect & )

IMPORT_C TRectInnerRect(const TRect &aOuterRect)const

Calculates and returns an inner rectangle by applying the margins to the specified outer rectangle.

Parameters
aOuterRectThe coordinates of the outer rectangle from which the inner rectangle is calculated.
Return Value
Inner rectangle.

OuterRect ( const TRect & )

IMPORT_C TRectOuterRect(const TRect &aInnerRect)const

Calculates and returns an outer rectangle by applying the margins to the specified inner rectangle.

Parameters
aInnerRectThe coordinates of the inner rectangle from which the outer rectangle is calculated.
Return Value
Outer rectangle.

SetAllValuesTo ( TInt )

IMPORT_C voidSetAllValuesTo(TIntaCommonValue)

Sets all four margins to a common value (between -128 and +127).

Parameters
aCommonValueThe new value for all margins.

SizeDelta ( )

IMPORT_C TSizeSizeDelta()const

Calculates and returns the difference in size between the outer and inner rectangles.

Return Value
Size difference between outer and inner rectangles.