Difference between revisions of "CalLite"

From Lazarus wiki
Jump to navigationJump to search
(Initial version of CalLite wiki page)
 
(→‎Changing colors: Calendar Options)
Line 39: Line 39:
 
* '''BackgroundColor''': the background color of the entire calendar (default: clWhite)
 
* '''BackgroundColor''': the background color of the entire calendar (default: clWhite)
 
* '''BorderColor''': the color of an optional border around the calenard (default: clSilver). Add <code>coShowBorder</code> to the calendar's <code>Options</code> to display the border.
 
* '''BorderColor''': the color of an optional border around the calenard (default: clSilver). Add <code>coShowBorder</code> to the calendar's <code>Options</code> to display the border.
* '''DayLineColor''': the color of an optional separating line between the top navigation pane and the calandar's day area (default: clSilver). Add <code>coDayLine</code> to the calendar's <code>Options</code> to display the line.
+
* '''DayLineColor''': the color of an optional separating line between the top navigation pane and the calendar's day area (default: clSilver). Add <code>coDayLine</code> to the calendar's <code>Options</code> to display the line.
 
* '''HolidayColor''': the text color used to display holidays (default: clRed). Add an event handler to <code>OnGetHolidays</code> to define which days are holidays.
 
* '''HolidayColor''': the text color used to display holidays (default: clRed). Add an event handler to <code>OnGetHolidays</code> to define which days are holidays.
 
* '''PastMonthColor''': the text color used to display the days of the previous or next month (default: clSilver).
 
* '''PastMonthColor''': the text color used to display the days of the previous or next month (default: clSilver).
Line 48: Line 48:
 
* '''TopRowTextColor''': text color used in the top navigation line (default: clHighlightText)
 
* '''TopRowTextColor''': text color used in the top navigation line (default: clHighlightText)
 
* '''WeekendColor''': text color used for painting weekend days (default: clRed)
 
* '''WeekendColor''': text color used for painting weekend days (default: clRed)
 +
 +
===Using the calendar's Options===
 +
The display of the calendar can be modified by changing the calendar's Options, an enumeration of flags:
 +
<syntaxhighlight>
 +
type
 +
  TCalOption = (coBoldDayNames, coBoldHolidays, coBoldToday, coBoldTopRow,
 +
                coBoldWeekend, coDayLine, coShowBorder, coShowHolidays,
 +
                coShowTodayFrame, coShowTodayName, coShowTodayRow,
 +
                coShowWeekend, coUseTopRowColors);
 +
</syntaxhighlight>
 +
* '''coBoldDayNames''': Draws the line with the day names using bold characters
 +
* '''coBoldHolidays''': Draws the day number of holidays using bold characters. Holidays are normally off, but you an add an event handler to <code>OnGetHolidays</code> in order to define holidays.
 +
* '''coBoldToday''': Draws today's cell using bold characters
 +
* '''coBoldTopRow''': Draws the month name and year number in the top row using bold characters
 +
* '''coBoldWeekend''': Draws the cells of weekend days using bold characters
 +
* '''coDayLine''': Adds a separating line between the top navigation line and the calendar's day area.
 +
* '''coShowBorder''': Paints a thin border rectangle around the calendar
 +
* '''coShowHolidays''': Activate highlighting holidays. Note that there must be also an event handler for <code>OnGetHolidays</code> which defines the holidays.
 +
* '''coShowTodayFrame''': Draws a rectangle around the "today" cell.
 +
* '''coShowTodayName''': Adds the day name to the line displaying today's date (see also: <code>coShowTodayRow</code>)
 +
* '''coShowTodayRow''': Shows a line at the bottom of the calendar to display today's date (see also: <code>coShowTodayName</code>).
 +
* '''coShowWeekend''': Highlights weekend days (see also: <code>Colors.WeekendColor</code>).
 +
* '''coUseTopRowColors''': Paints background and text of the top navigation row using the colors defined by <code>Colors.TopRowColor</code> and <code>Colors.TopRowTextColor</code>

Revision as of 12:28, 10 November 2016

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

About

CalLite

TCalendarLite is a light-weight calendar component, a TGraphicControl 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. A variety of property gives 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.2

Development version

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

Installation

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.

Usage

Simply drop a TCalendarLite component on the form and get a functional month-calendar.

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.

Changing colors

The property Colors of the calendar collects all settings affecting the colors used for the various items:

  • ArrowBorderColor: the color of the border of the arrows above the calendar (default: clSilver)
  • ArrowColor: the fill color of the arrows above the calendar (default: clSilver)
  • BackgroundColor: the background color of the entire calendar (default: clWhite)
  • BorderColor: the color of an optional border around the calenard (default: clSilver). Add coShowBorder to the calendar's Options to display the border.
  • DayLineColor: the color of an optional separating line between the top navigation pane and the calendar's day area (default: clSilver). Add coDayLine to the calendar's Options to display the line.
  • HolidayColor: the text color used to display holidays (default: clRed). Add an event handler to OnGetHolidays to define which days are holidays.
  • PastMonthColor: the text color used to display the days of the previous or next month (default: clSilver).
  • SelectedDateColor: fill color of the currently selected day (default: clMoneyGreen)
  • TextColor: text color used for paint the regular calendar days (default: clBlack)
  • TodayFrameColor: color used to draw a rectangular line around the "today" cell (default: clLime)
  • TopRowColor: background color used for the top navigation line (default: clHighlight)
  • TopRowTextColor: text color used in the top navigation line (default: clHighlightText)
  • WeekendColor: text color used for painting weekend days (default: clRed)

Using the calendar's Options

The display of the calendar can be modified by changing the calendar's Options, an enumeration of flags:

type
  TCalOption = (coBoldDayNames, coBoldHolidays, coBoldToday, coBoldTopRow,
                coBoldWeekend, coDayLine, coShowBorder, coShowHolidays,
                coShowTodayFrame, coShowTodayName, coShowTodayRow,
                coShowWeekend, coUseTopRowColors);
  • coBoldDayNames: Draws the line with the day names using bold characters
  • coBoldHolidays: Draws the day number of holidays using bold characters. Holidays are normally off, but you an add an event handler to OnGetHolidays in order to define holidays.
  • coBoldToday: Draws today's cell using bold characters
  • coBoldTopRow: Draws the month name and year number in the top row using bold characters
  • coBoldWeekend: Draws the cells of weekend days using bold characters
  • coDayLine: Adds a separating line between the top navigation line and the calendar's day area.
  • coShowBorder: Paints a thin border rectangle around the calendar
  • coShowHolidays: Activate highlighting holidays. Note that there must be also an event handler for OnGetHolidays which defines the holidays.
  • coShowTodayFrame: Draws a rectangle around the "today" cell.
  • coShowTodayName: Adds the day name to the line displaying today's date (see also: coShowTodayRow)
  • coShowTodayRow: Shows a line at the bottom of the calendar to display today's date (see also: coShowTodayName).
  • coShowWeekend: Highlights weekend days (see also: Colors.WeekendColor).
  • coUseTopRowColors: Paints background and text of the top navigation row using the colors defined by Colors.TopRowColor and Colors.TopRowTextColor