A date editor has five fields: day, month and year, and two separator characters. The order of the fields varies depending on the locale's date format setting. Locale information, which is set and retrieved using class TLocale, is used to determine field order and the characters used to separate the date components. The upper and lower field bounds are set, and dates outside these bounds are invalid.
The editor can be configured to launch a pop-out calendar dialog, CEikCalendar. This may be used to directly set the day, month and year values.
The editor has an associated resource struct DATE_EDITOR and control factory identifier EEikCtDateEditor.
The function reads the maximum and minimum date values and whether or not the editor should support a pop-out calendar and/or date icon from a DATE_EDITOR resource. It sets the initial date to be the same as the maximum date and honours the locale's date format and separators.
Parameters:
aResourceReader
A resource file reader.
IMPORT_C void CEikDateEditor::ConstructL
(
const TTime &
aMinimumDate,
const TTime &
aMaximumDate,
const TTime &
aInitialDate,
TBool
aWithoutPopoutCalendar
)
Handles 2nd phase construction.
This function completes the construction of a newly-allocated date editor. This function should be used instead of ConstructFromResourceL() when not initialising from a resource file. The editor's minimum, maximum and initial date values are set and the date format and date separator characters specified in class TLocale are honoured.
Parameters:
aMinimumDate
The minimum allowable date.
aMaximumDate
The maximum allowable date.
aInitialDate
The initial value.
aWithoutPopoutCalendar
If ETrue the editor will not have a pop-out calendar dialog / icon. If EFalse the editor will have a pop-out calendar dialog / icon.
This function should be called before an attempt is made to remove focus from a date editor. If the control value is not within the bounds specified by the minimum and maximum date values, it is reset to the nearest allowable value, the function then leaves.