Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CalAlarmMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Calendar MBS MacFrameworks Plugin 7.7 Yes No No Yes, macOS only No
Function: The class for an Alarm in iCal.
Example:
// start a connection to the calendar database
dim s as new CalCalendarStoreMBS

// needed for the error details
dim e as NSErrorMBS

// create a new calendar
dim c as new CalEventMBS

dim StartDate as date = new date
StartDate.day = StartDate.day +1 // start tomorrow

dim calendars() as CalCalendarMBS = s.calendars

// set properties
c.Title="new Event"
c.startDate=StartDate
c.calendar=calendars(0) // add to first calendar

dim EndDate as new date(StartDate) // one hour after start
EndDate.hour = EndDate.hour + 1
c.endDate=EndDate

dim a as new CalAlarmMBS // Send email one hour earlier
a.action = a.CalAlarmActionEmail
a.relativeTrigger = -3600
a.emailAddress="some@email.address"

c.addAlarm a // attach an alarm

// save event
call s.saveEvent(c,s.CalSpanAllEvents, e)
if e<>nil then
MsgBox e.localizedDescription
else
MsgBox "New event was created."
end if
Notes: Requires Mac OS X 10.5 to work.

Feedback, Comments & Corrections

Alarm Action Constants

Constant Value Description
CalAlarmActionDisplay "DISPLAY" Display the event.
CalAlarmActionEmail "EMAIL" Send an email.
CalAlarmActionProcedure "PROCEDURE"
CalAlarmActionSound "AUDIO" Play a sound.

This class has no sub classes.

Some methods using this class:


The items on this page are in the following plugins: MBS MacFrameworks Plugin.


BZip2FileMBS   -   CalAttendeeMBS




Links
MBS Xojo Plugins