class CEikFixedPointEditor : public CAknNumericEdwin |
This class presents an editor modifying a real. A fixed number of decimal places is permitted, set by API. Exponential notation is not permitted.
Validation, consisting of a check that the contents are parsable as a number (using TLex::Val()) and a range check, is carried out when PrepareForFocusLossL is called. Invalid contents cause a leave of that method.
Value() only returns a value corresponding reliably to the value in the editor after a non-leaving call to PrepareForFocusLossL.
All values, defaults, minima and maxima set by API or resource are TInts. The Real value is obtained by dividing by 10^<number of="" decimal="" places>="">
The number of characters in the editor is calculated from the number of allowed decimal places. TODO but there is a bug - cannot handle + or - signs in front, nor missing leading 0s before the decimal place.
Public Member Functions | |
---|---|
CEikFixedPointEditor() | |
IMPORT_C void | ConstructFromResourceL(TResourceReader &) |
IMPORT_C void | ConstructL(TInt, TInt) |
IMPORT_C TInt | DecimalPlaces() |
IMPORT_C void | GetMinMax(TInt &, TInt &) |
IMPORT_C TValidationStatus | GetValueAsInteger(TInt &) |
IMPORT_C void | HandlePointerEventL(const TPointerEvent &) |
IMPORT_C void | HandleResourceChange(TInt) |
IMPORT_C TCoeInputCapabilities | InputCapabilities() |
IMPORT_C TKeyResponse | OfferKeyEventL(const TKeyEvent &, TEventCode) |
IMPORT_C void | PrepareForFocusLossL() |
IMPORT_C void | SetDecimalPlaces(TInt) |
IMPORT_C void | SetMinMax(TInt, TInt) |
IMPORT_C void | SetValueL(const TInt *) |
IMPORT_C TInt | Value() |
Private Member Functions | |
---|---|
IMPORT_C void * | ExtensionInterface(TUid) |
TInt | RequiredNumberOfCharacters() |
IMPORT_C void | Reserved_3() |
Private Attributes | |
---|---|
TInt | iDecimalPlaces |
TInt | iMax |
TInt | iMin |
TInt | iSpare |
TInt | iValue |
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
From resource constructor. Refer to eikon.rh for the FIXPTED resource structure
TResourceReader & aReader | Resource reader positioned at FIXPTED resource location |
IMPORT_C TInt | DecimalPlaces | ( | ) | const |
This returns the number of allowed decimal places in the displayed text. The number is that used to set the power of 10 by which all integer values in the API are divided by before use, and the power of 10 by which all displayed values are multiplied by when turning them into integers.
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [private, virtual] |
From CAknControl
TUid aInterface |
IMPORT_C void | GetMinMax | ( | TInt & | aMin, |
TInt & | aMax | |||
) | const |
Get minimum and maximum valid values.
IMPORT_C TValidationStatus | GetValueAsInteger | ( | TInt & | aValue | ) |
Read out the value from the editor as a integer.
TInt & aValue |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
From CCoeControl. Handles pointer events
const TPointerEvent & aPointerEvent | The pointer event. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
Update contents of editor on certain resource change events
TInt aType |
IMPORT_C TCoeInputCapabilities | InputCapabilities | ( | ) | const [virtual] |
Sets the input capabilities of the editor
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Specific Key handling for numeric editor
const TKeyEvent & aKeyEvent | |
TEventCode aType |
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
Called by framework when focus is being taken off editor. May be called by client code.
TInt | RequiredNumberOfCharacters | ( | ) | const [private] |
Calculates the maximum number of characters needed by the editor. Returned values is used internally to set CEikEdwin::iTextLimit
IMPORT_C void | SetDecimalPlaces | ( | TInt | aDecimalPlaces | ) |
This sets the number of allowed decimal places in the displayed text. The number is also used to set the power of 10 by which all integer values in the API are divided by before use, and the power of 10 by which all displayed values are multiplied by when turning them into integers.
TInt aDecimalPlaces |
IMPORT_C void | SetMinMax | ( | TInt | aMin, |
TInt | aMax | |||
) |
Set minimum and maximum valid values.
IMPORT_C void | SetValueL | ( | const TInt * | aValue | ) |
Set the value in the editor. The passed value is divided by 10^(decimal places) before formatting to text in the editor.
const TInt * aValue |
IMPORT_C TInt | Value | ( | ) | const |
Access the value in the editor. The returned value is multiplied by 10^(decimal places) before formatting to text in the editor.
The value is reliable only immediately after setting and after a non-leaving call to PrepareForFocusLossL
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.