| struct TAlfMetric |
A Metric is used to represent a value in a specified unit type. This is to support the definition of Layouts using screen-size independent as well as screen-size dependent measurements.
TAlfMetric metricX(1.0, EAlfUnitNormalized);
TAlfMetric metricY(2.0, EAlfUnitNormalized);
//Set Layout base unit using Metrc
layout->SetBaseUnit(metricX);
//Create XYMetric using Metric
TAlfXYMetric metricXY(metricX, metricY);
//Set Layout base unit using XYMetrc
layout->SetBaseUnit( metricXY );
//Create Anchor offset as boxMetric
TAlfBoxMetric offset(
TAlfMetric(0.1, EAlfUnitMySize),
TAlfMetric(-0.1, EAlfUnitMySize),
TAlfMetric(0.1, EAlfUnitMySize),
TAlfMetric(-0.1, EAlfUnitMySize));
TAlfAnchorAttachmentOrigin attachmentOrigin(EAlfAnchorAttachmentOriginNone);
TInt attachmentOrdinal(EAlfAnchorAttachToParent);
//Attach anchor origin
anchorLayout->Attach(ordinal, offset, attachmentOrigin, attachmentOrdinal);
| Public Member Functions | |
|---|---|
| TAlfMetric ( TReal32 , TInt , TInt ) | |
| TAlfMetric ( TInt ) | |
| Public Attributes | |
|---|---|
| TReal32 | iMagnitude |
| TInt | iReferenceTextStyleId |
| TInt | iUnit |
| IMPORT_C | TAlfMetric | ( | TReal32 | aMagnitude = 1.f, |
| TInt | aUnit = EAlfUnitPixel, | |||
| TInt | aReferenceTextStyleId = EAlfTextStyleNormal | |||
| ) | ||||
Constructor. The constructor defaults to using [1px] units.
| IMPORT_C | TAlfMetric | ( | TInt | aPixels | ) |
Constructor. Allows the compiler to pass integers instead of TAlfMetric in parameters, in place of pixel metrics.
| TInt aPixels | Number of pixels for the metric. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.