![]()  | 
![]()  | 
![]()  | 
![]()  | 
![]()  | 
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. | 
A calendar
PtWidget --> PtBasic --> PtCalendar
For more information, see the diagram of the widget hierarchy.

<photon/PtCalendar.h>
PtCalendar draws a calendar showing the day of the week, month and year. You can interactively change the date and browse other months and years. The calendar is drawn on a per-month basis and can be drawn with or without a grid.

A PtCalendar widget.
| Resource | C type | Pt type | Default | 
|---|---|---|---|
| Pt_ARG_CALENDAR_COLOR1 | PgColor_t | Scalar | Pg_BLACK | 
| Pt_ARG_CALENDAR_COLOR2 | PgColor_t | Scalar | Pg_DGREY | 
| Pt_ARG_CALENDAR_COLOR3 | PgColor_t | Scalar | Pg_BLACK | 
| Pt_ARG_CALENDAR_COLOR4 | PgColor_t | Scalar | Pg_BLACK | 
| Pt_ARG_CALENDAR_COLOR5 | PgColor_t | Scalar | Pg_BLUE | 
| Pt_ARG_CALENDAR_DATE | PtCalendarDate_t | Struct | Current date | 
| Pt_ARG_CALENDAR_FLAGS | ulong_t | Flag | See below. | 
| Pt_ARG_CALENDAR_FONT1 | char * | String | "TextFont09" | 
| Pt_ARG_CALENDAR_FONT2 | char * | String | "TextFont09i" | 
| Pt_ARG_CALENDAR_FONT3 | char * | String | "TextFont09" | 
| Pt_ARG_CALENDAR_FONT4 | char * | String | "TextFont09b" | 
| Pt_ARG_CALENDAR_FONT5 | char * | String | "TextFont09b" | 
| Pt_ARG_CALENDAR_HIGHLIGHT | ulong_t | Flag | 0 | 
| Pt_ARG_CALENDAR_MONTH_BTN_COLOR | PgColor_t | Scalar | Pg_GREY | 
| Pt_ARG_CALENDAR_MONTH_NAMES | char *, short | Array | See below. | 
| Pt_ARG_CALENDAR_SEL_COLOR | PgColor_t | Scalar | Pg_YELLOW | 
| Pt_ARG_CALENDAR_TIME_T | time_t | Scalar | Current date | 
| Pt_ARG_CALENDAR_WDAY_NAMES | char *, short | Array | See below. | 
| Pt_ARG_CALENDAR_YEAR_BTN_COLOR | PgColor_t | Scalar | Pg_GREY | 
| Pt_CB_CALENDAR_SELECT | PtCallback_t * | Link | NULL | 
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_BLACK | 
The color used to display the current month's days. See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_DGREY | 
The color used to display the next and previous month's days. See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_BLACK | 
The color used for the year and month name. See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_BLACK | 
The color used for any highlighted days in the calendar (see Pt_ARG_CALENDAR_HIGHLIGHT).
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_BLUE | 
The color used for the names of the days of the week (see Pt_ARG_CALENDAR_WDAY_NAMES). See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| PtCalendarDate_t | Struct | Current date | 
The current date shown on the calendar.
![]()  | 
    You might find it easier to use Pt_ARG_CALENDAR_TIME_T
    instead of Pt_ARG_CALENDAR_DATE.
    They both specify the date, but Pt_ARG_CALENDAR_DATE
    uses a custom data structure.
     You can't set either of these resources in PhAB.  | 
This date is stored in a PtCalendarDate_t structure that contains:
| C type | Pt type | Default | 
|---|---|---|
| ulong_t | Flag | Pt_CALENDAR_YEAR_BTNS | Pt_CALENDAR_MONTH_BTNS | Pt_CALENDAR_SHOW_PREV | Pt_CALENDAR_SHOW_NEXT | Pt_CALENDAR_SHOW_GRID | 
Calendar-specific flags. This can be a combination of:
| C type | Pt type | Default | 
|---|---|---|
| char * | String | "TextFont09" | 
The font used for the current month's days.
| C type | Pt type | Default | 
|---|---|---|
| char * | String | "TextFont09i" | 
The font used for the next and previous month's days.
| C type | Pt type | Default | 
|---|---|---|
| char * | String | "TextFont09" | 
The font used for the year and month name.
| C type | Pt type | Default | 
|---|---|---|
| char * | String | "TextFont09b" | 
The font used for any highlighted days in the calendar (see Pt_ARG_CALENDAR_HIGHLIGHT).
| C type | Pt type | Default | 
|---|---|---|
| char * | String | "TextFont09b" | 
The font used for the names of the days of the week (see Pt_ARG_CALENDAR_WDAY_NAMES).
| C type | Pt type | Default | 
|---|---|---|
| ulong_t | Flag | 0 | 
A set of up to 32 bits that specify the days of the current month to highlight. For example, 0x1 means that day 1 is highlighted and 0x3 means that days 1 and 2 are highlighted.
The highlighted days are displayed using the values of Pt_ARG_CALENDAR_COLOR4 and Pt_ARG_CALENDAR_FONT4.
![]()  | 
You can't edit Pt_ARG_CALENDAR_HIGHLIGHT in PhAB. | 
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_GREY | 
The color used for the buttons for moving to the next and previous months. See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| char *, short | Array | See below | 
An array of names to be used for the months of the year. By default these values are:
| Element | Value | 
|---|---|
| 0 | January | 
| 1 | February | 
| 2 | March | 
| 3 | April | 
| 4 | May | 
| 5 | June | 
| 6 | July | 
| 7 | August | 
| 8 | September | 
| 9 | October | 
| 10 | November | 
| 11 | December | 
The array should contain 12 elements. If you set more, the extras are discarded. If you set fewer, the above elements are used for the missing ones.
![]()  | 
You can't edit Pt_ARG_CALENDAR_MONTH_NAMES in PhAB. | 
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_YELLOW | 
The color of the currently selected day of the month. See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| time_t | Scalar | Current date | 
The current date shown on the calendar. This date is stored in a time_t structure.
![]()  | 
You can't edit Pt_ARG_CALENDAR_TIME_T in PhAB. | 
| C type | Pt type | Default | 
|---|---|---|
| char *, short | Array | See below. | 
An array of names to be used for the days of the week. By default these values are:
| Element | Value | 
|---|---|
| 0 | Su | 
| 1 | Mo | 
| 2 | Tu | 
| 3 | We | 
| 4 | Th | 
| 5 | Fr | 
| 6 | Sa | 
The array should contain 7 elements. If you set more, the extras are discarded. If you set fewer, the above elements are used for the missing ones.
![]()  | 
You can't edit Pt_ARG_CALENDAR_WDAY_NAMES in PhAB. | 
| C type | Pt type | Default | 
|---|---|---|
| PgColor_t | Scalar | Pg_GREY | 
The color used for the buttons for moving to next and previous years. See PgColor_t in the Photon Library Reference.
| C type | Pt type | Default | 
|---|---|---|
| PtCallback_t * | Link | NULL | 
A list of PtCallback_t structures that define the callbacks invoked when a date is selected. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
The PtCalendarSelectCallback_t structure contains at least:
These callbacks should return Pt_CONTINUE.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
![]()  | 
![]()  | 
![]()  | 
![]()  |