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.
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.
Returns:
TInt number of decimal places displayed
IMPORT_C void CEikFixedPointEditor::GetMinMax
(
TInt &
aMin,
TInt &
aMax
)
const
Get minimum and maximum valid values.
Parameters:
aMin
TInt& minimum value multiplied by 10^(number of decimal places)
aMax
TInt& maximum value multiplied by 10^(number of decimal places)
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.
Parameters:
TInt
number of decimal places displayed
IMPORT_C void CEikFixedPointEditor::SetMinMax
(
TInt
aMin,
TInt
aMax
)
Set minimum and maximum valid values.
Parameters:
aMin
TInt minimum value multiplied by 10^(number of decimal places)
aMax
TInt maximum value multiplied by 10^(number of decimal places)
IMPORT_C void CEikFixedPointEditor::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.
Parameters:
TInt*
pointer to value to set
IMPORT_C TInt CEikFixedPointEditor::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
Returns:
TInt current value in the editor.
The documentation for this class was generated from the following file: