Enumerations #
Name | Values |
---|---|
NavigationButtons | Today |
PreviousPeriod | |
NextPeriod | |
PreviousYear | |
NextYear | |
Views | Month |
Agenda | |
AgendaWeek | |
AgendaDay | |
Basic | |
BasicWeek | |
BasicDay | |
List | |
ListYear | |
ListMonth | |
ListWeek | |
ListDay |
Events #
Definition | Parameters | Return Type | Description |
---|---|---|---|
DateDoubleClick | theDate as Date | None | Raised when the user double clicks a date/time. |
DateSelected | DateStart as Date | None | Raised when the user clicks on a day/time on the calendar. |
DateEnd as Date = nil | |||
StartTime as Boolean = False | |||
EndTime as Boolean = False | |||
EventChanged | theEvent as GraffitiCalendarEvent | None | Fires when the user changes an event (such as by dragging). |
EventDoubleClick | theEvent as GraffitiCalendarEvent | None | Raised when the user double-clicks an event. |
atDate as Date | |||
EventFromRowSet | newEvent as GraffitiCalendarEvent | None | Raised when a new event is created from a RowSet. |
EventMouseEnter | theEvent as GraffitiCalendarEvent | None | Raised when the user moves their mouse in to an event. |
X as Integer | |||
Y as Integer | |||
EventMouseLeave | theEvent as GraffitiCalendarEvent | None | Raised when the user moves their mouse out of an event. |
EventSelected | theEvent as GraffitiCalendarEvent | None | Raised when the user clicks an event. |
atDate as Date | |||
EventToRowSet | theEvent as GraffitiCalendarEvent | None | Raised when an event is modified. |
LanguagesLoaded | CalLanguages() as String | None | This event is raised once the calendar has completely loaded the list of available languages, and facilitates dynamic locale selection. |
NavigationButtonPressed | button as GraffitiCalendar.NavigationButtons | None | Raised when the user clicks one of the navigation buttons in the toolbar. Does not cancel the default action. |
ViewChanged | NewView as Integer | None | Fired when the user changes the view (IE: from Month to Week to Day). |
StartDate as Date | |||
EndDate as Date |
Methods #
Definition | Description |
---|---|
AddEvent( newEvent as GraffitiCalendarEvent ) | Add a new event to the calendar. |
AddExternalSource( URL as String, BGColor as Color = &c3a87ad, BorderColor as Color = &c3a87ad, TextColor as Color = &cFFFFFF ) | Add an external source to the calendar, such as a Google Calendar feed. |
AddRowSet( rs as RowSet ) | Adds a RowSet’s entries to the calendar. See nots for schema. |
AddRestriction( theRestriction as GraffitiCalendarRestriction ) | Adds a view restriction. |
AddRowSet( rs as RowSet ) | Adds a RowSet’s entries to the calendar. See nots for schema. |
AddViewButton(View as Views) | Adds a new view button to the right-hand side of the header. |
DayStyle( day as DateTime) as GraffitiStyle | Returns the GraffitiStyle assigned to the specified day slot. |
DayStyle( day as DateTime, assigns style as GraffitiStyle ) | Assigns the provided GraffitiStyle to the specified day slot. |
DayTitle(Day as Date) as String | Returns the title set for the specified date. |
DayTitle(Day as Date, Title as String, Style as WebStyle = Nil) | Sets the day title with optional style for a date. |
DeselectAll() | Deselect all selected dates and events. |
EventsAtDate( theDate as Date) As GraffitiCalendarEvent() | Returns an array of GraffitiCalendarEvents that fall on the specified date, including recurring events. |
FindEvent( theID as Integer ) As GraffitiCalendarEvent | Used to find an event by ID, and return the event object. |
FindEventIndex( theID as Integer ) as Integer | Used to find an event by ID, and return an integer index. |
ICSExport( Domain as String ) as String | Exports all current events to ICS format. |
ICSImport( theICS as String ) | Imports ICS-formatted event data to GraffitiCalendar events. |
MoveNext() | Move to the next Month/Week/Day |
MoveNextYear() | Move to the next year. |
MovePrev() | Move to the previous Month/Week/Day |
MovePrevYear() | Move to the previous year. |
MoveToDate( theDate as Date ) | Bring theDate in to view. |
MoveToToday() | Move the view to show the current date. |
Print() | Opens a print dialog with print-save version of the current view. |
RefetchEvents() | Causes the calendar to refetch all events. Useful if changes are made to an external source. |
RemoveAllEvents() | Removes all events from the calendar. |
RemoveAllRestrictions() | Removes all restrictions from the calendar view. |
RemoveAllViewButtons() | Removes all view buttons. |
RemoveEvent( theEvent as GraffitiCalendarEvent ) | Remove the supplied event object from the calendar. |
RemoveExternalSource( URL as String ) | Remove the external source signified by URL. |
RemoveRestriction( theID as String ) | Removes a restriction from the calendar view. |
RemoveViewButton(index as Integer) | Removes the specified view button. |
RerenderEvents() | Forces the calendar to rerender all events. Useful if you notice any weirdness. |
SelectDates( StartDate as Date, EndDate as Date ) | Selects a range of dates in the view. |
UpdateEvent( theEvent as GraffitiCalendarEvent ) | Updates theEvent. The GraffitiCalendarEvent object passed should be the same one that has been modified. |
ViewButton(index as Integer) as Views | Returns the view button at the specified index. |
ViewButtonCount() as Integer | Returns the number of View buttons. |
Properties #
Name | Type | Default Value | Description |
---|---|---|---|
CalendarView | Integer | 0 | The current view state. |
DatabaseAutoUpdate | Boolean | True | When True and an Event has been loaded using AddRowSet, GraffitiCalendar will attempt to update the database row for that Event. |
DisplayEventTime | Boolean | True | Controls the visibility of time in the event display. |
Editable | Boolean | True | Determines if events are editable in the display by, for example, dragging. |
Events() | GraffitiCalendarEventItem | Nil | The array of events that the calendar currently contains. |
Language | String | “en” | The short language string which determines the locale of the calendar. Currently contains: “en”, “ar-ma”, “ar-sa”, “ar”, “bg”, “ca”, “cs”, “da”, “de-at”, “de”, “el”, “en-au”, “en-gb”, “es”, “fa”, “fi”, “fr-ca”, “fr”, “hi”, “hr”, “hu”, “id”, “is”, “it”, “ja”, “ko”, “lt”, “lv”, “nl”, “pl”, “pt-br”, “pt”, “ro”, “ru”, “sk”, “sl”, “sr-cyrl”, “sr”, “sv”, “th”, “tr”, “uk”, “vi”, “zh-cn”, “zh-tw” |
RestrictView | Boolean | False | Restricts the view to the restrictions provided via AddRestriction. |
ShowDayButton | Boolean | True | Determines if the “Day” view selector is visible. |
ShowDayNames | Boolean | True | Determines whether the bar containing the names of the days of the week is visible. |
ShowMonthButton | Boolean | True | Determines if the “Month” view selector is visible. |
ShowNavButtons | Boolean | True | Determines if the Prev/Next navigation buttons are visible. |
ShowNavButtonsAtToday | Boolean | True | When True, shows the navigation buttons on either side of the Today button. |
ShowTitle | Boolean | True | Whether the calendar shows the title (IE: October 2014). |
ShowTodayButton | Boolean | True | Determines if the Today button is displayed. |
ShowWeekButton | Boolean | True | Determines if the Week button is displayed. |
ShowYearButtons | Boolean | True | Determines if the Year navigation buttons are displayed. |
StyleDayFuture | GraffitiStyle | Nil | GraffitiStyle for a day following Today. |
StyleDayPast | GraffitiStyle | Nil | GraffitiStyle for a day the precedes today. |
StyleToday | GraffitiStyle | Nil | GraffitiStyle for the current day. |
StyleFridayHeader | GraffitiStyle | Nil | GraffitiStyle for the Friday header. |
StyleMondayHeader | GraffitiStyle | Nil | GraffitiStyle for the MondayHeader. |
StyleSaturdayHeader | GraffitiStyle | Nil | GraffitiStyle for the SaturdayHeader. |
StyleSundayHeader | GraffitiStyle | Nil | GraffitiStyle for the SundayHeader. |
StyleThursdayHeader | GraffitiStyle | Nil | GraffitiStyle for the ThursdayHeader. |
StyleTitle | GraffitiStyle | Nil | GraffitiStyle applied to the title of the view, for example July 2022 in a month view. |
StyleToolbar | GraffitiStyle | Nil | GraffitiStyle for the toolbar area. |
StyleToolbarButtons | GraffitiStyle | Nil | GraffitiStyle for the toolbar buttons. |
StyleTuesdayHeader | GraffitiStyle | Nil | GraffitiStyle for the TuesdayHeader. |
StyleWednesdayHeader | GraffitiStyle | Nil | GraffitiStyle for the WednesdayHeader. |
TimeMinimum | Date | Nil | Restricts new event creation to time between TimeMinimum and TimeMaximum. Both must be set for effect. |
TimeMaximum | Date | Nil | Restricts new event creation to time between TimeMinimum and TimeMaximum. Both must be set for effect. |
TitleFormat | String | “” | When empty, the locale-specific default string will be displayed. Accepts moment.js formats or arbitrary text inside brackets: [Hello World]. |
ViewDate | Date | Nil | The starting day of the view, if set internally. Otherwise, any date may be provided to update the view. |
Examples #
Google Calendar Events #
Using the AddExternalSource method, it is possible to import the events from a public Google Calendar as a single series:
myCalendar.AddExternalSource( "en.usa#holiday@group.v.calendar.google.com", "yourAPIkey" )
GraffitiCalendar does not currently support updating Google Calendar events when changed in GraffitiCalendar. In order to support this functionality, users may implement the Google Calendar RESTful API.
Notes #
Custom Styling #
To apply custom styles to your GraffitiCalendar instance, there are a number of Style*
properties provided.
AddRowSet Support #
AddRowSet is supported on all Xojo Database types.
Database Writing Support #
Automatic writing of changes to the database of GraffitiCalendarEvents added via AddRowSet is currently limited to SQLiteDatabase and OracleDatabase. Using a different database type will require writing updates to the database using the events provided.
Table Schema for AddRowSet #
+-----------------+-------------+------+-------------------------+
| Field | Primary Key | NULL | Type |
+-----------------+-------------+------+-------------------------+
| id | Yes | No | Integer (auto-increment)|
| title | No | No | String |
| description | No | Yes | String |
| start | No | No | DateTime Equiv |
| end | No | No | DateTime Equiv |
| all_day | No | Yes | Boolean |
| background_color| No | Yes | String (#rrggbbaa) |
| text_color | No | Yes | String (#rrggbbaa) |
| border_color | No | Yes | String (#rrggbbaa) |
| can_move | No | Yes | Boolean |
| can_resize | No | Yes | Boolean |
| location | No | Yes | String |
| repeat_frequency| No | No | Integer (default '-1') |
| repeat_period | No | No | Integer (default '-1') |
| tooltip | No | Yes | String |
| url | No | Yes | String |
+-----------------+-------------+------+-------------------------+