Difference between revisions of "CalendarView"

From Jeremie Leroy - XOJO Controls Wiki
Jump to: navigation, search
m (159 revisions imported)
 
(116 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
Displays a Calendar in several formats (Year, Month, Week, Day, ...) that presents CalendarEvents.<br/>
 +
This custom control based on a Canvas is similar to iCal on Mac OS and Google Calendar.
  
{{Description
+
{| class=eventTable
| text=
+
|-
Description
+
|class=titleClass colspan=2|Events
 
+
|-
Displays a Calendar in several formats (Year, Month, Week, Day, ...) that presents CalendarEvents.
+
|width=50%|{{Event | name=CalendarEventFilter | params=cEvent As CalendarEvent | description= | returntype=Boolean | newinversion=1.4.0}}
This custom control based on a Canvas is similar to iCal on Mac OS and Google Calendar.}}
+
|width=50%|{{Event | name=NewEvent | params=StartDate As Date, EndDate As Date | description= | newinversion=}}
 +
|-
 +
|width=50%|{{Event | name=ConstructContextualMenu | params=base As MenuItem, x As Integer, y As Integer, cEvent As CalendarEvent | description= | returntype=Boolean | newinversion=1.1.1}}
 +
|width=50%|{{Event | name=Open | description= | newinversion=}}
 +
|-
 +
|width=50%|{{Event | name=DateSelected | params=D As Date | description= | newinversion=}}
 +
|width=50%|{{Event | name=ShowHelptag | params=Str As String, cEvent As CalendarEvent | description= | returntype=Boolean | newinversion=}}
 +
|-
 +
|width=50%|{{Event | name=DoubleClick | params=X As Integer, Y As Integer | description= | newinversion=}}
 +
|width=50%|{{Event | name=ViewChange | params=StartDate As Date, EndDate As Date | description= | newinversion=}}
 +
|-
 +
|width=50%|{{Event | name=DragEvent | params=cEvent As CalendarEvent | description= | newinversion=}}
  
 +
|-
 +
|width=50%|{{Event | name=EditEvent | params=cEvent As CalendarEvent | description= | returntype=CalendarEvent | newinversion=}}
  
 +
|-
 +
|}
  
  
Line 14: Line 31:
 
|class=titleClass colspan=3|Properties
 
|class=titleClass colspan=3|Properties
 
|-
 
|-
|width=33%|{{Property | name=AdaptWeeksPerMonth | type=Boolean | description=If True, in ViewType Month and Picker, the CalendarView will automatically calculate how many weeks are needed to display the whole month.If False, 6 weeks will always be displayed. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=AdaptWeeksPerMonth | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=FirstDate | type=Date | description=The first date displayed in the CalendarView. | readonly=yes | newinversion=}}
+
|width=33%|{{Property | name=FirstDate | type=Date | description= | readonly=yes | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=ScrollPosition | type=Double | description=Vertical ScrollPosition used in Week and Day view. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=ScrollPosition | type=Double | description= | readonly=no | newinversion= | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=Border | type=Boolean | description=If true a Border is displayed around the CalendarView.The default value is False. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=Animate | type=Boolean | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
|width=33%|{{Property | name=FirstDayOfWeek | type=Byte | description=The first day of week displayed in the CalendarView.1 = Sunday7 = Saturday | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=FirstDayOfWeek | type=Byte | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=SelEnd | type=Date | description=Selection end date. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=SelEnd | type=Date | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=ColorWeekend | type=Boolean | description=If True, the Weekend will be colored with MyColors.Weekend color. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=Border | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=ForceAM_PM | type=Boolean | description=If True, Hours in Week view and Day view will always be displayed with AM and PM.If False, the Calendarview tries to get the system default's hour format. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=ForceAM_PM | type=Boolean | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
|width=33%|{{Property | name=SelStart | type=Date | description=Selection start Date. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=SelStart | type=Date | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=CreateWithDrag | type=Boolean | description=If True, the user can create a CalendarEvent by dragging the mouse. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=ColorWeekend | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=LastDate | type=Date | description=The first date displayed in the CalendarView. | readonly=yes | newinversion=}}
+
|width=33%|{{Property | name=Freeze | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=Style | type=Integer | description=Style currently used in the CalendarView.See the Style constants of [[CalendarView]]. | readonly=yes | newinversion=}}
+
|width=33%|{{Property | name=Style | type=Integer | description= | readonly=yes | newinversion= | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=DayEndHour | type=Single | description=If this property is different than 0.0, the remaining hours from DayEndHour to midnight will be darkened.The default value is 18.0==Example==This example sets the DayEndHour to 18:45.<rbcode>me.DayEndHour=18.75</rbcode> | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=CreateWithDrag | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=minHGap | type=Integer | description=The minimum horizontal Gap in pixels between months in Year view. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=HelpTagFormat | type=String | description= | readonly=no | newinversion=1.2.0 | version=1.4.1}}
|width=33%|{{Property | name=ViewDays | type=Integer | description=Amount of days to display for ViewType = TypeOther. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=TextFont | type=String | description= | readonly=no | newinversion=1.2.1 | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=DayNames | type=String | description=The n | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=DayEndHour | type=Single | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
|width=33%|{{Property | name=minHourHeight | type=Integer | description=The minimum hour height in pixels for Week and Day view. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=HiDPI | type=Boolean | description= | readonly=yes | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=ViewType | type=Integer | description= | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=TransparentBackground | type=Boolean | description= | readonly=no | newinversion=1.4.1 | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=DayStartHour | type=Single | description=If this property is different than 0.0, the hours from midnight to DayStartHour will be darkened.The default value is 6.0==Example==This example sets the DayStartHour to 8 AM.<rbcode>me.DayStartHour=8.0</rbcode> | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=DayEventsHeight | type=Integer | description= | readonly=no | newinversion=1.2.0 | version=1.4.1}}
|width=33%|{{Property | name=minVGap | type=Integer | description=The minimum vertical Gap in pixels between months in Year view. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=LastDate | type=Date | description= | readonly=yes | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=WeekHeaderTextFormat | type=String | description=Date format to display over each day in Week and Day view.This string property takes the same format parameters as the PHP Date function:http://php.net/manual/en/function.date.phpIf a character needs to be escaped, a backslash "\" can be used.==Examples==<rbcode>//Tuesday 08, Februaryme.WeekHeaderTextFormat = "l d, F"//Feb. 8me.WeekHeaderTextFormat = "M. j"</rbcode> | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=ViewDays | type=Integer | description= | readonly=no | newinversion= | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=DisplayDate | type=Date | description=The currently displayed Date.Change the DisplayDate to change the current view.==Notes==If you assign a date using<rbcode>me.DisplayDate = aDate</rbcode>There is no need to refresh the CalendarView to show the selected date.However if you alter DisplayDate without assigning it a value, the CalendarView needs to be refreshed:<rbcode>//Change the month to Decemberme.DisplayDate.Month = 12me.Redisplay() //This refreshes the CalendarView</rbcode> | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=DayNames | type=String | description= | readonly=no | newinversion= | version=1.4.1}}
|width=33%|{{Property | name=MonthNames | type=String | description=Month names from MonthNames(1)=January to MonthNames(12)=December.On Windows, the MonthNames are automatically retrieved.On Macintosh and Linux, the CalendarView will try to retrieve the MonthNames using Date.LongDate. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=LockDayEventsHeight | type=Boolean | description= | readonly=no | newinversion=1.2.0 | version=1.4.1}}
|width=33%|{{Property | name=YearHeatMap | type=Boolean | description=If True, the Year view will display a "heat map" from yellow to red depending on how many [[CalendarEvent|CalendarEvents]] are on each day.  | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=ViewType | type=Integer | description= | readonly=no | newinversion= | version=1.4.1}}
 
|-
 
|-
|width=33%|{{Property | name=DisplayWeeknumber | type=Boolean | description=If True, the week numbers are displayed in Month view, Week view and Day view. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=DayStartHour | type=Single | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
|width=33%|{{Property | name=MyColors | type=Colors | description=Set of Colors used in the CalendarView.By using SetStyle method, the colors are changed. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=minHGap | type=Integer | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|width=33%|{{Property | name=WeekHeaderTextFormat | type=String | description= | readonly=no | newinversion=1.1.0 | version=1.4.1}}
 +
|-
 +
|width=33%|{{Property | name=DisableScroll | type=Boolean | description= | readonly=no | newinversion=1.2.1 | version=1.4.1}}
 +
|width=33%|{{Property | name=minHourHeight | type=Integer | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|width=33%|{{Property | name=YearHeatMap | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|-
 +
|width=33%|{{Property | name=DisplayDate | type=Date | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|width=33%|{{Property | name=minVGap | type=Integer | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|width=33%|{{Property | name=YearMultipleEvents | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|-
 +
|width=33%|{{Property | name=DisplayWeeknumber | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|width=33%|{{Property | name=MonthNames | type=String | description= | readonly=no | newinversion= | version=1.4.1}}
 +
 
 +
|-
 +
|width=33%|{{Property | name=DragEvents | type=Boolean | description= | readonly=no | newinversion= | version=1.4.1}}
 +
|width=33%|{{Property | name=MyColors | type=Colors | description= | readonly=no | newinversion= | version=1.4.1}}
  
 
|-
 
|-
|width=33%|{{Property | name=DragEvents | type=Boolean | description=If True, CalendarEvent items can be dragged with the mouse to alter the date or start time. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=FilterEvents | type=Boolean | description= | readonly=no | newinversion=1.4.0 | version=1.4.1}}
|width=33%|{{Property | name=MyStyle | type=Styles | description=Set of Styles used in the CalendarView.By using SetStyle method, the style is changed. | readonly=no | newinversion=}}
+
|width=33%|{{Property | name=MyStyle | type=Styles | description= | readonly=no | newinversion= | version=1.4.1}}
  
 
|-
 
|-
 
|}
 
|}
 +
  
  
 
{| class=methodTable
 
{| class=methodTable
 
|-
 
|-
|class=titleClass colspan=2|Methods
+
|class=titleClass colspan=3|Methods
 
|-
 
|-
|width=50%|{{Method | name=AddEvent | description= | newinversion=}}
+
|width=33%|{{Method | name=AddEvent | params=cEvent As CalendarEvent | description= | newinversion=}}
|width=50%|{{Method | name=ImportICS | description= | newinversion=}}
+
|width=33%|{{Method | name=ImportFromDB | params=RS As RecordSet, ID As String = "ID", StartDate As String = "Start", EndDate As String = "End", Title As String = "Title", EventColor As String = "Color", Location As String = "Location", Description As String = "Description", Editable As Boolean = True, AllDay As Boolean = False | description= | returntype=Boolean | newinversion=}}
 +
|width=33%|{{Method | name=Scroll | params=deltaX As Integer, deltaY As Integer = 0 | description= | newinversion=}}
 
|-
 
|-
|width=50%|{{Method | name=DeleteAllEvents | description= | newinversion=}}
+
|width=33%|{{Method | name=DateForXY | params=x As Integer, y As Integer | description= | returntype=Date | newinversion=1.2.1}}
|width=50%|{{Method | name=Redisplay | description= | newinversion=}}
+
|width=33%|{{Method | name=ImportICS | params=f As FolderItem, DefaultColor As Color = &c4986E7, Editable As Boolean = False | description= | newinversion=}}
 +
|width=33%|{{Method | name=Search | params=txt As String, setFocus As Boolean = True, FromBeginning As Boolean = False | description= | returntype=CalendarEvent | newinversion=1.4.0}}
 
|-
 
|-
|width=50%|{{Method | name=ExportICS | description= | returntype=String | newinversion=}}
+
|width=33%|{{Method | name=DeleteAllEvents | description= | newinversion=}}
|width=50%|{{Method | name=Register | description= | returntype=Boolean | newinversion=}}
+
|width=33%|{{Method | name=ImportICS | params=txt As String, DefaultColor As Color = &c4986E7, Editable As Boolean = False | description= | newinversion=}}
 +
|width=33%|{{Method | name=SetStyle | params=StyleType As Integer | description= | newinversion=}}
 
|-
 
|-
|width=50%|{{Method | name=ExportToDB | description= | returntype=Boolean | newinversion=}}
+
|width=33%|{{Method | name=ExportICS | description= | returntype=String | newinversion=}}
|width=50%|{{Method | name=RemoveEvent | description= | newinversion=}}
+
|width=33%|{{Method | name=PrintAdvanced | params=g As Graphics, PrintToday As Boolean = False | description= | newinversion=}}
 +
 
 
|-
 
|-
|width=50%|{{Method | name=GetEvents | description= | returntype=CalendarEvent() | newinversion=}}
+
|width=33%|{{Method | name=ExportToDB | params=DB As Database, TableName As String, ID As String = "ID", StartDate As String = "Start", EndDate As String = "End", Title As String = "Title", EventColor As String = "Color", Location As String = "Location", Description As String = "Description" | description= | returntype=Boolean | newinversion=}}
|width=50%|{{Method | name=Scroll | description= | newinversion=}}
+
|width=33%|{{Method | name=PrintSimple | params=PrintToday As Boolean = False | description= | newinversion=}}
 +
 
 
|-
 
|-
|width=50%|{{Method | name=ImportFromDB | description= | returntype=Boolean | newinversion=}}
+
|width=33%|{{Method | name=FocusOn | params=cEvent As CalendarEvent | description= | newinversion=1.4.0}}
|width=50%|{{Method | name=SetStyle | description= | newinversion=}}
+
|width=33%|{{Method | name=Redisplay | description= | newinversion=}}
|-
+
|width=50%|{{Method | name=ImportICS | description= | newinversion=}}
+
  
 
|-
 
|-
 +
|width=33%|{{Method | name=GetEvents | description= | returntype=CalendarEvent() | newinversion=}}
 +
|width=33%|{{Method | name=RemoveEvent | params=cEvent As CalendarEvent, RemoveFromDB As Boolean = True | description= | newinversion=}}
 
|}
 
|}
  
  
==ToDo list==
+
{| class=methodTable
 +
|-
 +
|class=titleClass colspan=1|Shared Methods
 +
|-
 +
|{{Method | name=Register | params=Name As String, SerialKey As String | description= | returntype=Boolean | newinversion=}}
 +
|-
  
ToDo list
+
|-
#Ignore in LR
+
|}
  
Month view
 
-Setting for Month title position in Month view
 
-Select element and delete it with Backspace or Delete ??
 
  
Week view
+
==Class Constants==
-limit amount of day events
+
-Force AM/PM
+
-DayStart time
+
-DayEnd time
+
-> NightColor
+
-minHourHeight <-> DisplayXXHours
+
  
Year view
+
===Style===
-Double click on month to display it in month view
+
The following class constants are to be used to specify the [[CalendarView.Style|Style]] to use with [[CalendarView.SetStyle|SetStyle]] function.
-Color days with amount of events per day (Yellow to red)
+
  
==History==
+
{| class="genericTable"
 +
! width=15% | Class Constant
 +
! width=55% | Description
 +
|-
 +
|StyleDefault
 +
|The default style.
 +
|-
 +
|StyleICal
 +
|Macintosh iCal style.
 +
|-
 +
|StyleGoogle
 +
|Google Calendar style.
 +
|-
 +
|StyleDark
 +
|A dark style (black, grey and green).
 +
|-
 +
|StyleOutlook2010
 +
|Office Outlook 2010 style.
 +
|-
 +
|StyleOutlook2013
 +
|Office Outlook 2013 (beta) style.
 +
|}
  
History
+
===ViewType===
***Version 1.1 - Not yet released***
+
The following class constants are to be used with the [[CalendarView.ViewType|ViewType]] property.
New:
+
-TypePicker
+
-SelStart, SelEnd to set the selected dates in the CalendarPicker
+
-DayStartHour, DayEndHour
+
-ForceAM_PM
+
-Style Property
+
-StyleOutlook2010 constant
+
-WeekHeaderTextFormat
+
-
+
  
Fix:
+
{| class="genericTable"
-Several graphic enhancements
+
! width=15% | Class Constant
-Colors in StyleDark
+
! width=55% | Description
-Day names on Mac OS
+
|-
 +
|TypePicker
 +
|Displays a DatePicker.
 +
|-
 +
|TypeYear
 +
|Displays a whole year.
 +
|-
 +
|TypeMonth
 +
|Displays a Month calendar.
 +
|-
 +
|TypeWeek
 +
|Displays a full week.
 +
|-
 +
|TypeDay
 +
|Displays one day.
 +
|-
 +
|TypeOther
 +
|Use the [[CalendarView.ViewDays|ViewDays]] property to set the amount of days to display. If ViewDays=5 days from Monday to Friday are displayed.
 +
|}
  
 +
==History==
 +
Read on [[CalendarView.History|History page]]
  
***Version 1.0.3 - Released 2012-04-11***
+
==See Also==
New:
+
-StyleDefault, StyleICal, StyleGoogle, StyleDark class constants
+
-ImportFromDB function
+
-ExportToDB function
+
-RemoveEvent now has a RemoveFromDB property.
+
 
+
Fix:
+
-CalendarView not updating after AddEvent
+
 
+
 
+
 
+
***Version 1.0.2 - Released 2012-04-03***
+
New:
+
-StyleDark
+
-DisableDrag is replaced with DragEvents and CreateWithDrag
+
 
+
Fix:
+
-Day background color not filling the box in TypeMonth
+
-Time background color not displaying in TypeWeek
+
-Resizing event to make a 15 minute event in TypeWeek
+
-TypeYear not displaying non-day events
+
-OutOfBoundsException in DrawTime on Mac OS
+
-Drawing long event in TypeMonth that finishes on last day of week
+
  
 +
[[CalendarEvent]]
  
 +
==External Links==
  
***Version 1.0.1 - Released 2012-04-02***
+
Download page:
New:
+
http://www.jeremieleroy.com/products.php
-DisplayWeeknumber As Boolean
+
-MyColors.WeekNumber
+
-MyColors.WeekNumberBackground
+
-Day name is displayed inside the month grid for iCal style.
+
-Drag events in Month and Week view to change start date/time
+
-Resize event in TypeWeek
+
-HeatMap in TypeYear
+
-SetLength Function in CalendarEvent
+
-VerticalGap and HorizontalGap properties for TypeYear
+
-New Event "DragEvent". Fires when a CalendarEvent is dragged or resized
+
 
+
Fix:
+
-Selected background color in month view if MyStyle.MDayNumberPos=1
+
-Day events in TypeWeek not aligned properly
+
 
+
 
+
 
+
 
+
***Version 1.0.0 - Released 2012-03-30***
+
==See Also==
+
 
+
See Also
+
CalendarEvent, CalendarDrawPosition
+

Latest revision as of 14:20, 6 August 2015

Displays a Calendar in several formats (Year, Month, Week, Day, ...) that presents CalendarEvents.
This custom control based on a Canvas is similar to iCal on Mac OS and Google Calendar.

Events
CalendarEventFilter NewEvent
ConstructContextualMenu Open
DateSelected ShowHelptag
DoubleClick ViewChange
DragEvent
EditEvent


Properties
AdaptWeeksPerMonth FirstDate ScrollPosition
Animate FirstDayOfWeek SelEnd
Border ForceAM_PM SelStart
ColorWeekend Freeze Style
CreateWithDrag HelpTagFormat TextFont
DayEndHour HiDPI TransparentBackground   NEW 1.4.1
DayEventsHeight LastDate ViewDays
DayNames LockDayEventsHeight ViewType
DayStartHour minHGap WeekHeaderTextFormat
DisableScroll minHourHeight YearHeatMap
DisplayDate minVGap YearMultipleEvents
DisplayWeeknumber MonthNames
DragEvents MyColors
FilterEvents MyStyle


Methods
AddEvent ImportFromDB Scroll
DateForXY ImportICS Search
DeleteAllEvents ImportICS SetStyle
ExportICS PrintAdvanced
ExportToDB PrintSimple
FocusOn Redisplay
GetEvents RemoveEvent


Shared Methods
Register


Class Constants

Style

The following class constants are to be used to specify the Style to use with SetStyle function.

Class Constant Description
StyleDefault The default style.
StyleICal Macintosh iCal style.
StyleGoogle Google Calendar style.
StyleDark A dark style (black, grey and green).
StyleOutlook2010 Office Outlook 2010 style.
StyleOutlook2013 Office Outlook 2013 (beta) style.

ViewType

The following class constants are to be used with the ViewType property.

Class Constant Description
TypePicker Displays a DatePicker.
TypeYear Displays a whole year.
TypeMonth Displays a Month calendar.
TypeWeek Displays a full week.
TypeDay Displays one day.
TypeOther Use the ViewDays property to set the amount of days to display. If ViewDays=5 days from Monday to Friday are displayed.

History

Read on History page

See Also

CalendarEvent

External Links

Download page: http://www.jeremieleroy.com/products.php