The duration editor allows a time duration to be displayed and edited. The editor has a clock icon and an edit field with separators for hours, minutes, and seconds. These fields can all be suppressed using the appropriate flags in the resource declaration.
Unlike the time editor control, the duration editor has no am or pm text. This is because the duration is a length of time (from 0 to 24 hours), rather than a point in time.
The minimum and maximum values are set, and values outside these limits are invalid.
The editor has an associated resource struct DURATION_EDITOR and control factory identifier EEikCtDurationEditor.
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.
The function reads the maximum and minimum duration values, and the flags settings, from a DURATION_EDITOR resource. It sets the initial duration to be the same as the maximum value and honours the locale's time separators.
Parameters:
aResourceReader
A resource file reader.
IMPORT_C void CEikDurationEditor::ConstructL
(
const TTimeIntervalSeconds &
aMinimumDuration,
const TTimeIntervalSeconds &
aMaximumDuration,
const TTimeIntervalSeconds &
aInitialDuration,
TUint32
aFlags
)
Second phase construction.
This function completes the construction of a newly-allocated duration editor. This function should be used instead of ConstructFromResourceL() when not initialising from a resource file.
The function sets the editor's minimum, maximum and initial values. The time separator characters specified in class TLocale are honoured. If the initial duration is less than the minimum value the minimum value is used as the initial setting. If the initial duration is greater than the maximum value the maximum value is used as the initial setting.
The aFlags parameter is used to determine whether the seconds or hours fields are not required. The minutes field is always present. Regardless of the value specified in aFlags, 24 hour time format is set, overriding the locale's setting.
This function should be called when an attempt is made to remove focus from a duration editor. If the editor value is not within the bounds specified by the minimum and maximum duration values, it is reset to the nearest allowable value - the function will leave.