#include <mw/gulbordr.h>
class TGulBorder |
Public Member Enumerations | |
---|---|
enum | T3DStyle { EFlat, ESunken, ERaised } |
enum | TBorderType { ENone, ESingleGray, ESingleBlack, ESingleDotted, ..., EHorizontalBar } |
enum | TConstructionStyle { EOneStep, ETwoStep, EThreeStep, EInvertedTwoStep } |
enum | TInlineStyle { EWithInline } |
enum | TLogicalFamily { EWindowFamily, EContainerFamily, EControlFamily } |
enum | TLogicalType { EWindow, EFlatContainer, ERaisedContainer, ESunkenContainer, ..., EFocusedSunkenControl } |
enum | TOutlineStyle { EWithOutline, EDottedOutline } |
enum | TRounding { EAddOneRoundingPixel, EAddTwoRoundingPixels, EAddFourRoundingPixels } |
enum | TThickness { EAddOnePixel, EAddTwoPixels, EAddFourPixels } |
Public Member Functions | |
---|---|
TGulBorder() | |
TGulBorder(TBorderType) | |
TGulBorder(TBorderType, TGulAdjacent) | |
TGulBorder(TInt) | |
TGulBorder(TInt, TGulAdjacent) | |
IMPORT_C TInt | Adjacent() |
IMPORT_C void | Draw(CGraphicsContext &, const TRect &, const TColors &) |
IMPORT_C void | Draw(CGraphicsContext &, const TRect &) |
IMPORT_C TBool | HasBorder() |
IMPORT_C TRect | InnerRect(const TRect &) |
IMPORT_C TMargins | Margins() |
IMPORT_C TRect | OuterRect(const TRect &) |
IMPORT_C TInt | Rounding() |
IMPORT_C void | SetAdjacent(TInt) |
IMPORT_C void | SetType(TInt) |
IMPORT_C TSize | SizeDelta() |
IMPORT_C TInt | Thickness() |
IMPORT_C TInt | Type() |
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.
Defines the descriptive border types.
Defines the border's construction style.
For logical borders, defines whether the border encloses a window, a container control or a control.
Defines the logical border types.
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.
IMPORT_C | TGulBorder | ( | ) |
Default constructor.
The border type is initialised to zero (i.e. no border).
IMPORT_C | TGulBorder | ( | TBorderType | aType | ) |
Constructor with a border type.
Parameter | Description |
---|---|
aType | The border type. |
IMPORT_C | TGulBorder | ( | TBorderType | aType, |
TGulAdjacent | aAdjacent | |||
) |
Constructor with a border type and an adjacency.
Parameter | Description |
---|---|
aType | The border type. |
aAdjacent | Border adjacency. No outline is drawn for border sides that are adjacent. |
IMPORT_C | TGulBorder | ( | TInt | aType | ) |
Constructor with a border type, specified as a TInt.
Parameter | Description |
---|---|
aType | The border type. Possible values are defined in the TBorderType enumeration. |
IMPORT_C | TGulBorder | ( | TInt | aType, |
TGulAdjacent | aAdjacent | |||
) |
Constructor with a border type, specified as a TInt, and a border adjacency.
Parameter | Description |
---|---|
aType | The border type. |
aAdjacent | Border adjacency. No outline is drawn for border sides that are adjacent. |
IMPORT_C TInt | Adjacent | ( | ) | const |
Gets the border adjacency.
No outline is drawn for border sides that are adjacent.
Returns: The border adjacency. For possible values, see the TGulAdjacent enum.
IMPORT_C void | Draw | ( | CGraphicsContext & | aGc, |
const TRect & | aRect, | |||
const TColors & | aBorderColors | |||
) | const |
Draws the border using a graphics context, inside a containing rectangle, and using the border colours specified.
This function does nothing if the border type is ENone. If the border is a logical border, drawing is delegated to its implementation of MGulLogicalBorder::Draw().
See also: MGulLogicalBorder::Draw()
Parameter | Description |
---|---|
aGc | The graphics context to draw through. |
aRect | The containing rectangle. This defines the border's outline, i.e. the border is drawn inside this rectangle. |
aBorderColors | The border colours. |
IMPORT_C void | Draw | ( | CGraphicsContext & | aGc, |
const TRect & | aRect | |||
) | const |
Draws the border using a graphics context, inside a containing rectangle, and using default values for the border colours.
For details of the default border colours, see class TColors.
This function does nothing if the border type is ENone. If the border is a logical border, drawing is delegated to its implementation of MGulLogicalBorder::Draw().
See also: MGulLogicalBorder::Draw()
Parameter | Description |
---|---|
aGc | The graphics context to draw through. |
aRect | The containing rectangle. This defines the border's outline, i.e. the border is drawn inside this rectangle. |
IMPORT_C TBool | HasBorder | ( | ) | const |
Tests whether a border is present.
No border is present if its type is ENoBorder.
Returns: True if a border is present, otherwise false.
IMPORT_C TMargins | Margins | ( | ) | const |
Returns the border margins.
The border margins are four integers that represent the widths in pixels of the top, bottom, left and right hand sides of the border.
If the border is a logical border, then calculating the margins is delegated to its implementation of MGulLogicalBorder::Margins().
Otherwise, the margins are calculated by adding together the single pixel border outline, if present (this is zero for adjacent sides), the border thickness (containing the mid-tone highlights and lowlights), and the single pixel interior outline, if present.
Returns: The border margins.
IMPORT_C void | SetAdjacent | ( | TInt | aAdjacent | ) |
Sets the border adjacency.
No outline is drawn for border sides that are adjacent.
Parameter | Description |
---|---|
aAdjacent | The border adjacency. For possible values, see the TGulAdjacent enum. |
IMPORT_C void | SetType | ( | TInt | aType | ) |
Sets the border type.
Descriptive borders use one of the values from the TBorderType enum. Logical borders use one of the TLogicalType values. Custom border types can be created by selecting one value from each of the enums T3DStyle and TConstructionStyle, one or more values from each of the enums TOutlineStyle and TInlineStyle, one or more values from the enums TThickness and TRounding and ORing all these values together.
Parameter | Description |
---|---|
aType | The border type. |
IMPORT_C TSize | SizeDelta | ( | ) | const |
Returns the size difference between the inner and outer rectangles of the border.
Returns: The size difference between the inner and outer rectangles.
IMPORT_C TInt | Type | ( | ) | const |
Gets the border type.
Returns: The border type. This is one of the values from the TBorderType (for descriptive borders) or TLogicalType (for logical borders) enums.