CEikFixedPointEditor Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcoctl.lib uiklaf.lib form.lib

Capability Information

Required Capabilities

None


#include <eikfpne.h>

Inherits CAknNumericEdwin.


Detailed Description

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

IMPORT_C  CEikFixedPointEditor ()
  C++ constructor.
IMPORT_C void  ConstructL (TInt aMin, TInt aMax)
  2nd stage Constructor
IMPORT_C TInt  Value () const
  Access the value in the editor.
IMPORT_C TValidationStatus  GetValueAsInteger (TInt &aValue)
  Read out the value from the editor as a integer.
IMPORT_C void  SetValueL (const TInt *aValue)
  Set the value in the editor.
IMPORT_C void  SetMinMax (TInt aMin, TInt aMax)
  Set minimum and maximum valid values.
IMPORT_C void  GetMinMax (TInt &aMin, TInt &aMax) const
  Get minimum and maximum valid values.
IMPORT_C void  SetDecimalPlaces (TInt aDecimalPlaces)
  This sets the number of allowed decimal places in the displayed text.
IMPORT_C TInt  DecimalPlaces () const
  This returns the number of allowed decimal places in the displayed text.
virtual IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  From resource constructor.
virtual IMPORT_C void  PrepareForFocusLossL ()
  Called by framework when focus is being taken off editor.
virtual IMPORT_C TCoeInputCapabilities  InputCapabilities () const
  Sets the input capabilities of the editor.
virtual IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  Specific Key handling for numeric editor.
virtual IMPORT_C void  HandleResourceChange (TInt aType)
  Update contents of editor on certain resource change events.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Constructor & Destructor Documentation

IMPORT_C CEikFixedPointEditor::CEikFixedPointEditor  ) 
 

C++ constructor.


Member Function Documentation

virtual IMPORT_C void CEikFixedPointEditor::ConstructFromResourceL TResourceReader &  aReader  )  [virtual]
 

From resource constructor.

Refer to eikon.rh for the FIXPTED resource structure

Parameters:
aReader  Resource reader positioned at FIXPTED resource location

Reimplemented from CEikEdwin.

IMPORT_C void CEikFixedPointEditor::ConstructL TInt  aMin,
TInt  aMax
 

2nd stage Constructor

IMPORT_C TInt CEikFixedPointEditor::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 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)
IMPORT_C TValidationStatus CEikFixedPointEditor::GetValueAsInteger TInt &  aValue  ) 
 

Read out the value from the editor as a integer.

Returns:
Validation status of the current value
IMPORT_C void CEikFixedPointEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CAknNumericEdwin.

virtual IMPORT_C void CEikFixedPointEditor::HandleResourceChange TInt  aType  )  [virtual]
 

Update contents of editor on certain resource change events.

Reimplemented from CEikEdwin.

virtual IMPORT_C TCoeInputCapabilities CEikFixedPointEditor::InputCapabilities  )  const [virtual]
 

Sets the input capabilities of the editor.

Reimplemented from CEikEdwin.

virtual IMPORT_C TKeyResponse CEikFixedPointEditor::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
[virtual]
 

Specific Key handling for numeric editor.

Reimplemented from CEikEdwin.

virtual IMPORT_C void CEikFixedPointEditor::PrepareForFocusLossL  )  [virtual]
 

Called by framework when focus is being taken off editor.

May be called by client code.

IMPORT_C void CEikFixedPointEditor::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.

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:

Copyright © Nokia Corporation 2001-2008
Back to top