DateTime: Several elemets for date and time handling: Flexible calendar (TLLCalendar) and DateTimeCombo, TTimeSelector, TPanelClock.

Version Information
Version: 0.4, updated: 2005-06-01
Developed with Delphi5, ready for use in a package.
Download 0.3 source code plus demo application.
Download the 0.4 package, which includes a bias property for TPanelClock, which has not been tested.
Content
TPanelClock: A clock to display and select time.
TLLCalendar and TDateTimeCombo: Two components thought to replace the system calendar and TDateTimePicker. More flexible.
TTimeSelector: Radio group to select time
Licence
uDateTime.pas is freeware that comes without any warranty or support. Thus you use it at your own risk. You may even use it in commercial products as long as you mention me as original author somewhere. If you make modifications to the source code, you must maintain the original copyright notice and publish it under the same licence. For the exact conditions, see LICENCE.txt that is contained in the download package.
I am looking forward to feedback via eMail.

If it doesn’t compile: Make sure you either download TLLSlider as well or disable the compiler directive {$DEFINE USESLIDER} in uDateTime.pas (and live without this cool way to select time).

TPanelClockpanelclock

PanelClock offers three modes of working: pcmClock displays time as an analoguous watch. In pcmSelect mode you can drag the minute and hour pointer around and select a specific time. In pcmStopwatch mode, you can either set a time and then count down to zero or just start it from 00:00:00 and have the clock count seconds.

  • Display analoguous watch. Optional: digits and digital clock
  • Apply a bias (in minutes) to your local time to emulate time zones (starting with v0.4)
  • Specifiy radii for inner area (hour pointer) and outer area (minute pointer) in percent of overall radius
  • Specify colours
  • Customize or let scale widths of pointers and dots
  • Use background image
  • Bevel width, border width respected. Additional: padding of clock from inner bevel (the background image is not affected)
  • With the events OnChange and OnHourChange you can react to the clock
  • The event OnAlarm triggers when you use the clock as countdown (Mode=pcmStopwatch, set a time and start it)
  • Prepared for being compiled into a package (and appear in the object inspector)

There is at least one issue: Loading of Images does not work yet. Currently, you have to use another image.

TLLCalendartllcalendar

TLLCalendar was created because I was so fed up with Microsoft’s system calendar. I searched the Internet for other components, of course. Some of them were great, but only for Germany (local holidays and the like). So I decided to create a calendar that is a bit more flexible. Here are the features:

  • Does not need MS’s common controls
  • OnGetMonthInfo returns the complete date so that you can react more precisely
  • Far better keyboard usage
  • Mousewheel support
  • Scales with the parent
  • Range select
  • Using local month names and date format
  • More colours to specify

There are some issues which I will probably not fix. But if anyone wants to do it:

  • Monday is always the first day of the week
  • Multi select

TDateTimeCombo tdatetimecombo

TDateTimeCombo is thought as a replacement for TDateTimePicker. It uses my TLLCalendar and the TPanelClock or TTimeSelector classes.

Hint: If you enable the compiler directive {$DEFINE USESLIDER}, this component will also use my TLLSlider component for selecting time. You have to download TLLSlider separately.

  • Does not need Microsoft’s common controls
  • Improved keyboard handling
  • Mousewheel support
  • Uses my TLLCalendar and the two time selectors (TPanelClock or TTimeSelector)
  • Using local month names and date format

There is one big, yet unresolved issue:

  • Long date format does not work when using keyboard input (parising is way more difficult than the short one)

TTimeSelector ttimeselector

This class is being used in the TDateTimeCombo component (as well as PanelClock) to select time. It does not have many features but offers a simple and quick way to select a specific time of the day in 5 minute steps.

The titles of the radio groups can be named as you like (translate them, for instance).

Hint: If you enable the compiler directive {$DEFINE USESLIDER}, this component will also use my TLLSlider component for selecting time. You have to download TLLSlider separately.

Changelog

v0.4 — 2005-06-01

  • implemented bias for displaying time
  • Metaentry: Merged code from my lost implementations

v0.3 — 2003-11-11

  • Fixed TPanelClock’s time selection algorithm
  • Added SingleClickClosesCalendar to TDateTimeCombo
  • Adapted interfaces of TLLCalendar and TDateTimeCombo to better match the common controls
  • Cleaned up code: Do not trigger OnChange events too often
  • Introduced Austrian calendar as default
  • Fixed order of drawing in TCalGrid
  • Introduced TCalColors for TDateTimeCombo
  • Introduced more colours for TCalColors
  • Some bug fixes