TCalendarLite is a lightweight calendar component, a TCustomControl descendant which consequently is not dependent on any widgetset. It is not a fixed-size component, as are most calendars, but will align and resize as needed. Various properties give access to almost every aspect of its appearance.
Howard Page-Clark, Ariel Rodriguez and Werner Pamler
Modified LGPL (with linking exception, like Lazarus LCL)
Download and Installation
A zip file with the most recent release version can be found at Lazarus CCR at SourceForge. Unzip the file into any folder.
The current release version is 0.3.1
Use an svn client to download the current trunk version from svn://svn.code.sf.net/p/lazarus-ccr/svn/components/callite/
- v0.3.10 breaks existing code relying on TDayOfWeek starting at value 1. This had to be changed to start at 0 to fix compilation with FPC 3.3.1.
In Lazarus, go to "Package" > "Open Package File .lpk". Navigate to the folder with the callite sources, and select callight_pkg.lkp. Click "Compile", then "Use" > "Install". This will rebuild the IDE (it may take some time). When the process is finished the IDE will restart, and you'll find TCalendarLite in the component palette Misc.
- Click on any date
- Use the arrow keys on the keyboard
- Click on the arrow keys above the calendar; the single arrow advances by one month, the double arrow advances by one year
- Click on the month name to open a popdown menu with month names, or click on the year number to open a popdown menu with the last and next ten years.
If the property
MultiSelect is set to
true then several days can be selected in the calendar. All selected days are drawn with a highlighted background. Multi-selection is controlled by holding special keys down while selecting a day either by a mouse click or a key press:
- CTRL: If the key is pressed while selecting another day then this day is added to the selection. This way a non-contiguous array of dates can be selected.
- SHIFT: If the key is held down during day selection then all day between the prevsiously and the currently selected day are added to the selection.
- Double-click: A double click on a workday selects all workdays of the same week. Holding the or key down extends the selection by the workdays of one or more weeks.
- The selection can be extended into neighboring months if the arrow keys of the keyboard are pressed with the key held down.
- Selection is cleared if any date is selected without pressed any of these keys, or if the arrows or dropdown menus in the top bar are used.
- If previously selected days are added for a second time then they are unselected.
At run-time, the selected data can be controlled or queried by these methods of the calendar:
- procedure AddSelectedDate(ADate: TDate) - adds the specified date to the list of selected dates
- procedure ClearSelectedDates - clears all selected dates
- function IsSelected(ADate: TDate): Boolean - returns true when the given date is selected, false otherwise.
- function SelectedDates: TCalDateArray - returns an array of TDate elements which contains the selected dates.