EnterEvents:
PUBLIC
INTERNAL
PROCEDURE [ evt: REF Hickory.EventTuple, evl: Hickory.EventList, groups: Hickory.GroupSet] =
BEGIN
to enter the events into calendar and hickory. Conflicts are not detected, since
detecting conflicting events in the case of repeated events is too expensive...
The list of events evl can potentially have the very first elem. with a non nil key,
because an event has been edited. see calFormImplB.TranslateSelection
eventGroups: Hickory.GroupSet; -- in what groups is an edited event?
FOR l: Hickory.EventList ← evl, l.rest
UNTIL l =
NIL
DO
IF l.first.Key =
NIL
THEN
BEGIN
-- it's a new event for hickory
l.first ← Hickory.EnterEvent[ l.first, [ NIL, NIL]];
eventGroups ← [ NIL, NIL];
END
ELSE
IF evt #
NIL
THEN BEGIN
-- the first el. is the edited event...
eventGroups ← Hickory.ListGroups[ l.first.Key];
IF
NOT Hickory.SameEventTuple[ evt^, l.first]
THEN
Hickory.ChangeEvent[ evt^, l.first];
END
ELSE ERROR;
Hickory.InsertToGroup[ ev: l.first.Key, groups: RopeSets.Difference[ groups, eventGroups]];
Hickory.RemoveFromGroup[ ev: l.first.Key, groups: RopeSets.Difference[ eventGroups, groups]];
ENDLOOP;
CalSupport.DisplayMsg[ "Event(s) entered into Hickory", FALSE];
END; -- EnterEvents