Table of Contents

CalendarSet version 6

CalendarSet version 6 includes the original API (no change needed in your existing code) as well as the more recent property-based API and adds new features:


New Constants


New Properties

CS_Area_DrawingMode

“draw”, Boolean, default 0 (False), read/write/persistent, xml name “drawingMode”.
Use Calendar.app - like drawing.
Background color of event is not used, calendar/event color is shaded instead.
Note: does not affect Old month view drawing and all views when Agenda API is used.

CS_Area_ScrollMonthViewWeeks

“smvw”, Boolean, default 0 (False), read/write/persistent, xml name “scrollWeek”.
In Month view: when there are more events than space in a day cell, the whole week row is scrollable instead of showing “+2” (meaning 2 more events are not visible).
Arrows for scrolling are displayed on the right side of the area and in each cell (containing events), number of events is displayed; can be scrolled with mouse wheel.

CS_Area_HoursInDayView

“timH”, integer, default 24, min 1, max 24, read/write/persistent, xml name “hoursInDay”.
In Day/Week view, display specified hours at a time (using scrolling when more hours are to be displayed).

CS_Area_YearViewLayout

“ywla”, integer, default 2, min 0, max 8, read/write/persistent, xml name “yearLayout”.

CS_Area_ShowEventsInYearView

“deyw”, Boolean, default 1 (True), read/write/persistent, xml name “yearEvents”.
When set to 1, days in year view (layout 0 - 5) are colored if there are events.

CS_Area_ShowYearInYearView

“dyyw”, Boolean, default 1 (True), read/write/persistent, xml name “yearYear”.
When set to 1, year is displayed in year view.

CS_Area_ShowInfoText

“info”, Boolean, default 0 (False), read/write/persistent, xml name “showEventInfo”.
When set to 1, new event property CS_Event_InfoText is drawn in day/week view.

CS_Area_DayInfoFormat

“Dinf”, integer, default 0, min 0, max, 6, read/write/persistent, xml name “dayInfoFmt”.
Text drawn above the time column in Day view.

CS_Area_WeekInfoFormat

“Winf”, integer, default 0, min 0, max, 6, read/write/persistent, xml name “weekInfoFmt”.
Text drawn above the time column in Day-range/Week view.
Possible values are identical to CS_Area_DayInfoFormat.

CS_Area_DayHeaderFormat

“Dfmt”, integer, default 0, min 0, max 20, read/write/persistent, xml name “dayFormat”.
Text drawn in day header in Day view.

Adding 8 to selectors 5-12 uses full names, e.g. for 9 + 8 = 17: Saturday, February 29.

CS_Area_WeekHeaderFormat

“Wfmt”, integer, default 0, min 0, max 20, read/write/persistent, xml name “weekFormat”.
Text drawn in day header in Day-range/Week view.
Possible values are identical to CS_Area_DayHeaderFormat.

CS_Area_MonthHeaderFormat

“Mfmt”, integer, default 0, min 0, max 2, read/write/persistent, xml name “monthFormat”.

CS_Area_DayHeaderAlignment

“Dhal”, integer, default 0, min 0, max 3, read/write/persistent, xml name “dayHdrAlignment”.
Modifies header alignment in Day view.

CS_Area_WeekHeaderAlignment

“Dhal”, integer, default 0, min 0, max 3, read/write/persistent, xml name “weekHdrAlignment”.
Modifies header alignment in Day-range/Week view.

CS_Area_NoAllDayHeader

“Dnad”, Boolean, default 0 (False), read/write/persistent, xml name “noAllDayHeader”.
When set to 1, the “all-day” text is not drawn above the time column in Day/Week view.

CS_Area_ScrollDaysWeeks

“MSdw”, Boolean, default 0 (False), read/write/persistent, xml name “scrollDaysWeeks”.
When set to 1, day/week view is “scrollable” with mouse wheel
When (possibly displayed) scrollbar is at the min/max and you scroll with mouse wheel more enough, displayed date range is changed, new CS_Action_DayWeekScroll is reported.

CS_Area_DefaultForNewEvent

“DCal”, integer, default 0, read/write, not persistent.
iCal to use for new events.

CS_Event_UUID

“uid”, text, read/write/persistent, xml name “uid”.
This is the real event ID stored in VEVENT.
Usage is meant for iCal integration: UUID is the unique event identifier.
The CS_Event_UID name can be misleading, it could be eventID or objectID or simply eventKey.
It is actually the event key to internal map entry (key → displayed event in a view → event in a calendar).

CS_Event_InfoText

“info”, text, read/write/persistent, xml name “info”.
Not persistent in VEVENT, only in XML.
This text can be displayed in day/week view, see CS_Area_ShowInfoText.


New Accessors

CS_Objects_Area_MonthNames

“gMNf”, text array.
Get/set full month names (initialized from system).

CS_Objects_Area_MonthNamesAbbrev

“gMNa”, text array.
Get/set abbreviated month names (initialized from system).

CS_Objects_Area_DayNames

“gDNf”, text array.
Get/set full day names (initialized from system).

CS_Objects_Area_DayNamesAbbrev

“gDNa”, text array.
Get/set abbreviated day names (initialized from system).

CS_Objects_Area_DayTimeZones

“TimZ”, longint 2D array.
Get/set time zones per day (e.g. “mark lunch time between 12:00 and 12:30 with yellow on Monday-Friday”).
When using it with CS_GetObjects / CS_SetObjects, a two-dimensional longint array is expected, containing start hour in first column, end hour in second one and (optional in setter) color in third one.
To define colored time range for Sunday, use ?12:00:00? & ?12:30:00?.
For all other days, add 86400 per day, thus for Monday it will be ?12:00:00?+86400.
Don’t forget to include alpha channel in the ARGB color!
If color is zero (or not provided - array having only 2 columns), current non-working hours background color is used when drawn.

Example:

 ARRAY LONGINT($dayTimeZones;3;7)
 For ($i;0;6)
    $dayTimeZones{1}{$i+1}:=?12:00:00?+($i*86400)  // 12:00
    $dayTimeZones{2}{$i+1}:=?12:30:00?+($i*86400)  // 12:30
    $dayTimeZones{3}{$i+1}:=0xFFCCFFCC  // green
 End for 
 $l:=CS_SetObjects (xCalendar;CS_Objects_Area_DayTimeZones;$dayTimeZones)

Result:

CS_Objects_Evt_Icons

“icon”, longint array.
The iconIDs to get/set (no need to parse/create comma separated text with CS_Event_Icon).

CS_Style_Grid

18.
StyleID defining the grid color.
The only usable property is the background color (CS_Style_BackColor), default is gray (0xFF808080).
Used as grid color (horizontal & vertical in Month view, vertical in Day/Week view).
Used as frame color when CS_Area_DrawingMode = 1 (all views except Old month view: Day/Week, Month and Year view).

CS_Style_Month

19.
StyleID defining the color of the month name in year view.
Only text color is used.

CS_iCal_Clear

“clr”, write only, value is unused.
Remove all events from the specified calendar.

CS_Area_ColorTheme

“CALI”, integer.
Currently only allowed value is 1, write only.
When set, many properties are modified to match Calendar.app look: global styles & area properties (including styles).

CS_Area_GoToPrevious

“Vprv”, value is unused, write only.
Change displayed date range to “previous” (depends on the view, e.g. for day it is one day, for year view showing 1 month it is one month).

CS_Area_GoToToday

“Vnow”, value is unused, write only.
Change displayed date range to “now”.

CS_Area_GoToNext

“Vnxt”, value is unused, write only.
Change displayed date range to “next” (depends on the view, e.g. for day it is one day, for year view showing 1 month it is one month).

CS_Area_EventMouseDownModifiers

“evtm”, integer, read-only.
State of the key modifiers (control/option/command/shift/caps-lock) as it was at mouse down event.
Due to the asynchronous mouse handling, CS_Area_EventMouseModifiers can differ from CS_Area_EventMouseDownModifiers, esp. when using right-click (which synthesizes control key at mouse down).

CS_Area_DragSrcArea

“ddSA”, integer, read-only.
>0 means CalendarSet, <0 means AreaList Pro, 0 means other source.

CS_Area_DragDstProcessID

“ddDP”, integer, read-only.
Drop destination process number.

CS_Area_DragSrcEvent

“ddSE”, text, read-only.
Source event key when the drag is from CalendarSet.

CS_Area_DragDstRow

“ddDR”, integer, read-only.
Row in the view where the drop occurred in Day/Week view.

CS_Area_DragDstArea

“ddDA”, integer, read-only.
Destination area in case it is a CalendarSet area.

CS_Area_DragDataType

“ddDT”, integer, read-only.
Destination in CalendarSet:

CS_Area_DragDstDate

“ddDD”, integer, read-only.
Destination day in CalendarSet as POSIX time.

CS_Area_DragDstEvent

“ddDE”, text, read-only.
Destination event key when destination is event/banner in CalendarSet.

CS_Area_DragEventMoved

“ddEM”, Boolean, read-only.
Set to 1 (True) when CalendarSet handled the event move (dragging an event inside one area).


Modified Properties

CS_Area_View

Maximum value = 6 (CS_View_Year).
In Year view, CS_Action_YearMonthClick is reported for click on a month name and CS_Action_YearWeekClick for click on week number (when displayed).

CS_Area_ShowBanners

Type integer (was Boolean), default 0, min 0, max 32.
When value is > 1, it is used as maximum number of events to display in all-day area of Day/Week view (using separate scrollbar if more space is needed).

CS_Area_ShowEventTimes

Type integer (was Boolean), default 1, min 0, max 2.
When set to 2 and CS_Area_DrawingMode = 1 and CS_Area_ViewType is day/week view (1 - 4), event times are displayed as “from - to” when event ends in the same day

CS_Event_RecurrFrequency setter

Values 1-3 are no longer allowed.


Extended CS_Objects_Area_Banners and CS_Objects_Area_Events

Now you can use CS_GetObjects2 and specify a date array containing dates.
This function will return only banners/events for the specified dates (if any), not all banner/events in the view.
If the date array is empty, no events are returned.

ARRAY TEXT($atKeys;0)
ARRAY DATE($aDates;1)
$aDates{1}:=$dateOfInterest // e.g. CS_Area_ClickedDate
$err:=CS_GetObjects2 ($area; CS_Objects_Area_Events; $atKeys; $aDates)

Modified behavior

Modified day/week view

Event created by drag

When not using compatibility API and event is created by drag in day/week view (CS_Area_AllowDragNewEvent = 1 (this is set with CS_Area_ColorTheme!), user clicks in a day and drags), it is not deleted on mouse up.
You can use CS_Area_ClickedEventID in the area method to get the position (date/time/duration/all-day), CS_Area_CSEvent is CS_Action_EventCreated or CS_Action_BannerCreated) to manipulate it.

CS_Event_Recurrence

This value is now sequential inside the view, not the real recurrence number (unless the owning iCal has property CS_iCal_IsBirthday).


Note

→ old API modifies area-specific styles

→ to modify appearance, change CS_Style_Default, CS_Style_Event & CS_Style_Banner with area reference ($1) = 0

Simply:

It is irrelevant whether event (or banner) overrides the style at event level or not.
Other styles used for drawing are always from the area (and area styles are initialized from the global styles).