Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

MBS Xojo Plugin Tutorial Videos

iCal Source

Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete
End Class

Class Window1
Inherits Window
// Controls
ControlInstance
End ControlInstance
ControlInstance
End ControlInstance
ControlInstance
Sub Action() Handles Event
dim c as new CalCalendarStoreMBS

dim e as new CalEventMBS
dim error as NSErrorMBS

dim d as date

d=new date
d.Hour=d.Hour+1
e.endDate=d

d=new date
e.startDate=d

e.Title="Just a test event"
e.location="here and now"
e.calendar=c.calendars.Item(0) // first calendar

if c.saveEvent(e, c.CalSpanAllEvents, error) then
MsgBox "ok"
else
MsgBox "failed"
MsgBox error.localizedDescription
end if

End Sub
End ControlInstance

// Event implementations
Sub Open()
dim c as new CalCalendarStoreMBS
dim count, i as integer
dim a as CalCalendarArrayMBS

a=c.calendars
count=a.Count-1
for i=0 to count
listbox1.AddRow a.Item(i).Title
next

dim ce as CalEventMBS
dim ca as CalEventArrayMBS
dim sd,ed as date

sd=new date
sd.Month=sd.Month-1

ed=new date
ed.Month=ed.Month+1

ca=c.events(sd,ed)

count=Ca.Count-1
for i=0 to count
ce=ca.Item(i)

listbox2.AddRow ce.Title+" "+ce.calendar.Title+" "+ce.startDate.ShortTime
next
End Sub
End Class


All movies




Links
MBS Xojo PDF Plugins