This control allows a time value to be displayed and edited. By default the editor has hours, minutes and seconds fields, although the seconds and hours fields may be omitted. 12 and 24-hour format are supported. When 12-hour format is used, am or pm text will be included as another field, either before or after the time. Locale information is used to determine the time separator characters. Locale information is set and retrieved using class TLocale.
The upper and lower field bounds are set depending on the format, and times outside these bounds are invalid.
The editor has an associated resource struct TIME_EDITOR and control factory identifier EEikCtTimeEditor.
This function should be used as the first stage in two stage construction, followed by a call to either: ConstructFromResourceL() to initialise the editor's field values from a resource file, or ConstructL() if no resource file is used.
virtual IMPORT_C CEikTimeEditor::~CEikTimeEditor
(
)
[virtual]
Destructor.
This frees the resources owned by the time editor, prior to its destruction.
This function completes the construction of a newly-allocated time editor from a TIME_EDITOR resource. The minimum and maximum times, and the flags settings are read from the resource, and ConstructL() is called with these settings. The initial time is set to the maximum time value. Honours the locale's AM/PM text setting and time separators.
Parameters:
aResourceReader
A resource file reader.
IMPORT_C void CEikTimeEditor::ConstructL
(
const TTime &
aMinimumTime,
const TTime &
aMaximumTime,
const TTime &
aInitialTime,
TUint32
aFlags
)
Second phase construction.
This function completes the construction of a newly-allocated time editor, by setting its minimum, maximum and initial values, and the AM/PM text settings - the AM/PM settings and time separator characters specified in class TLocale are honoured. It should be called by the container only if the control is not constructed from a resource file.
If the initial time is outside the bounds specified, it is reset to the nearest available setting.
The aFlags parameter is used to determine whether the seconds or hours fields are required. The minutes field is always present. It may also be used to specify whether or not to force 24 hour time format, overriding the locale's setting.
A panic will occur if the minimum time is later than the maximum time.
Parameters:
aMinimumTime
The minimum allowable time.
aMaximumTime
The maximum allowable time.
aInitialTime
The initial time.
aFlags
Determines which fields are required and whether or not to force 24 hour formatting. See eikon.hrh EEiktime etc.
This function should be called to validate the editor's contents when an attempt is made to remove focus from the control. If the control value is not within the bounds specified by the minimum and maximum time values, it is reset to the nearest allowable value, the function will leave and will display an appropriate message.