#include <mw/eikfpne.h>
class CEikFixedPointEditor : public CAknNumericEdwin |
Public Member Functions | |
---|---|
CEikFixedPointEditor() | |
virtual 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 &) |
virtual IMPORT_C void | HandlePointerEventL(const TPointerEvent &) |
virtual IMPORT_C void | HandleResourceChange(TInt) |
virtual IMPORT_C TCoeInputCapabilities | InputCapabilities() |
virtual IMPORT_C TKeyResponse | OfferKeyEventL(const TKeyEvent &, TEventCode) |
virtual 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() |
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.
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [virtual] |
Reimplemented from CEikEdwin::ConstructFromResourceL(TResourceReader &)
From resource constructor. Refer to eikon.rh for the FIXPTED resource structure
Parameter | Description |
---|---|
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.
Returns: TInt number of decimal places displayed
IMPORT_C TValidationStatus | GetValueAsInteger | ( | TInt & | aValue | ) |
Read out the value from the editor as a integer.
Returns: Validation status of the current value
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
Reimplemented from CAknNumericEdwin::HandlePointerEventL(const TPointerEvent &)
From CCoeControl. Handles pointer events
Parameter | Description |
---|---|
aPointerEvent | The pointer event. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
Reimplemented from CEikEdwin::HandleResourceChange(TInt)
Update contents of editor on certain resource change events
IMPORT_C TCoeInputCapabilities | InputCapabilities | ( | ) | const [virtual] |
Reimplemented from CEikEdwin::InputCapabilities()const
Sets the input capabilities of the editor
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Reimplemented from CEikEdwin::OfferKeyEventL(const TKeyEvent &,TEventCode)
Specific Key handling for numeric editor
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
Reimplemented from CCoeControl::PrepareForFocusLossL()
Called by framework when focus is being taken off editor. May be called by client code.
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.
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.
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
Returns: TInt current value in the editor.