|
|
|
This guide explains the UIQ control Calendar (CEikCalendar).
The Calendar control allows the user to select a date. The control displays a one-month overview and
provides numeric input fields for entering year, month and day.
The CEikCalendar should be used to show a generic calendar or the calendar preferred by
the system. By default the gregorian calendar is used but other calendars can be implemented and used.
The Calendar control is an exception to how you create controls. Instead of using one of the ordinary ways, you simply launch it.
Calendar is often used in combination with the Date Editor, but it can also be used on its own.
See the API documentation for Calendar CEikCalendar.
The Calendar control is similar to the Gregorian Calendar control and it can use the Date Editor control. See the How To guides for Gregorian Calendar and Date Editor.
See even the API documentation for Gregorian Calendar (CQikGregorianCalendar) and
the Date Editor (CQikDateEditor).
Use the following #include directive:
#include <eikcal.h>
Use the following LIBRARY directive in the project's mmp-file:
LIBRARY eikctl.lib
No resource structure is defined for Calendar. For structures used when creating the Gregorian Calendar, see Gregorian Calendar.
The Calendar control is not like an ordinary control. You cannot create it in one of the four ordinary ways, which are construction with view framework using data from a resource file, construction with your own C++ code using data from a resource file, construction solely from C++ code and construction with the dialog framework using data from a resource file.
Instead, the Calendar control is used to create a Calendar Pop-out using the Gregorian calendar or another calendar of your choice. The default calendar is the Gregorian calendar.
This section covers the most common functions used for interacting with Calendar.
To launch a calendar using the Calendar control, use the code below. Note that the observer, which needs to inherit from MEikCalendarObserver, has to be set before calling ExecuteLD.
The ExecuteLD function will launch the calendar pop-out. When execution is completed, the pop-out will be deleted as indicated by the D suffix of the ExcecuteLD function name.
This code launches the default calendar, the Gregorian calendar.
CEikCalendar* calendar = new (ELeave)CEikCalendar();
calendar->SetCalendarObserver(this);
calendar->ExecuteLD();
To change the type of calendar being launched, call the function below. It writes the type of calendar to be used in an ini-file which is then used by ExecuteLD to launch the customized calendar.
calendar->SetCalendarTypeInFileL(calendarControlId);
Subclassing Calendar is not recommended.