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. The user 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 | "lu12" |
Pt_ARG_CALENDAR_FONT2 | char * | String | "lu12i" |
Pt_ARG_CALENDAR_FONT3 | char * | String | "helv12" |
Pt_ARG_CALENDAR_FONT4 | char * | String | "lu12b" |
Pt_ARG_CALENDAR_FONT5 | char * | String | "helv12b" |
Pt_ARG_CALENDAR_HIGHLIGHT | ulong_t | Scalar | 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 | Struct | 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.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_DGREY |
The color used to display the next and previous month's days.
C type | Pt type | Default |
---|---|---|
PgColor_t | Scalar | Pg_BLACK |
The color used for the year and month name.
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).
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 | "lu12" |
The font used for the current month's days.
C type | Pt type | Default |
---|---|---|
char * | String | "lu12i" |
The font used for the next and previous month's days.
C type | Pt type | Default |
---|---|---|
char * | String | "helv12" |
The font used for the year and month name.
C type | Pt type | Default |
---|---|---|
char * | String | "lu12b" |
The font used for any highlighted days in the calendar (see Pt_ARG_CALENDAR_HIGHLIGHT).
C type | Pt type | Default |
---|---|---|
char * | String | "helv12b" |
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 | Scalar | 0 |
A long used to set bits that represent 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 used for moving to the next and previous months.
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.
C type | Pt type | Default |
---|---|---|
time_t | Struct | 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 used for moving to next and previous years.
C type | Pt type | Default |
---|---|---|
PtCallback_t * | Link | NULL |
A list of callbacks invoked when a date is selected. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:
The PtCalenderSelectCallback_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.