Difference between revisions of "CalLite"

From Free Pascal wiki
Jump to navigationJump to search
 
(6 intermediate revisions by 2 users not shown)
Line 20: Line 20:
 
====Development version====
 
====Development version====
 
Use an svn client to download the current trunk version from [svn://svn.code.sf.net/p/lazarus-ccr/svn/components/callite/ svn://svn.code.sf.net/p/lazarus-ccr/svn/components/callite/]
 
Use an svn client to download the current trunk version from [svn://svn.code.sf.net/p/lazarus-ccr/svn/components/callite/ svn://svn.code.sf.net/p/lazarus-ccr/svn/components/callite/]
 +
 +
====Version Notes====
 +
* '''v0.3.10''' breaks existing code relying on <tt>TDayOfWeek</tt> starting at value 1. This had to be changed to start at 0 to fix compilation with FPC 3.3.1.
  
 
====Installation====
 
====Installation====
 +
[[Image:tcalendarlite_150.png|left]]
 
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_tab|Misc]]'''.
 
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_tab|Misc]]'''.
 +
 +
== Navigation ==
 +
* 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.
 +
 +
== Multi-selection ==
 +
If the property <code>MultiSelect</code> is set to <code>true</code> 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 {{keypress|CTRL}} 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 {{keypress|SHIFT}} 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 {{keypress|CTRL}} or {{keypress|SHIFT}} 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 {{keypress|CTRL}} 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:
 +
* <tt>procedure AddSelectedDate(ADate: TDate)</tt> - adds the specified date to the list of selected dates
 +
* <tt>procedure ClearSelectedDates</tt> - clears all selected dates
 +
* <tt>function IsSelected(ADate: TDate): Boolean</tt> - returns <tt>true</tt> when the given date is selected, <tt>false</tt> otherwise.
 +
* <tt>function SelectedDates: TCalDateArray</tt> - returns an array of TDate elements which contains the selected dates.
  
 
==Documentation==
 
==Documentation==
  
 
* [[CalLite: Usage]]
 
* [[CalLite: Usage]]
 +
* [[CalLite: Flag days in Finland]]
  
 
== See also ==
 
== See also ==
 
*[[Turbopower_Visual_PlanIt|TurboPower Visual PlanIt]]
 
*[[Turbopower_Visual_PlanIt|TurboPower Visual PlanIt]]
 
*[[DateTimeCtrls_Package|DateTimeCtrls Package]]
 
*[[DateTimeCtrls_Package|DateTimeCtrls Package]]

Latest revision as of 19:58, 18 December 2022

English (en) suomi (fi) русский (ru)

About

CalLite

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.

Authors

Howard Page-Clark, Ariel Rodriguez and Werner Pamler

License

Modified LGPL (with linking exception, like Lazarus LCL)

Download and Installation

Release version

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

Development version

Use an svn client to download the current trunk version from svn://svn.code.sf.net/p/lazarus-ccr/svn/components/callite/

Version Notes

  • 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.

Installation

tcalendarlite 150.png

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.

Navigation

  • 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.

Multi-selection

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 CTRL 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 Shift 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 CTRL or Shift 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 CTRL 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.

Documentation

See also