Tips and Frequently Asked Questions

 Using TPlannerItem alarms


Through the Alarm property in a TPlannerItem and alarm handlers, all types of alarms can be triggered by the TPlannerItem. Note that alarms are enabled in the TPlanner by the property TPlanner.EnableAlarms. Different alarm handlers that play sound, send email, show a message, run a script, execute a program can be downloaded from https://www.tmssoftware.com/planaddon.htm

Example:

Following example creates a TPlannerItem in a day mode TPlanner that starts at 2AM and triggers an alarm message 30 minutes before the TPlannerItem starts :
with Planner1.CreateItem do 
begin 
  ItemStartTime := EncodeTime(2,0,0,0); // 02:00 AM 
  ItemEndTime := EncodeTime(3,0,0,0); // 03:00 AM 
  CaptionText := 'Item 1'; 
  Text.Text := 'This message tells the item starts in 30 minutes'; 
  CaptionType := ctText; 
  Alarm.Active := True; 
  Alarm.Handler := AlarmMessage1; 
  Alarm.TimeBefore := EncodeTime(0,30,0,0); // 30 minutes 
  Alarm.NotifyType := anNotes; 
end;
The item inserted in the TPlanner will thus trigger an alarm at 1.30AM . The AlarmMessage1 is a simple alarm handler that displays a message box. The selected text for the alarm message is the text of the TPlannerItem itself as selected by the NotifyType which is anNotes. At 1.30AM the message displayed is:

Alarm handlers are easy to write. An alarm handler descends for the TPlannerAlarmHandler class which is defined as:

TPlannerAlarmHandler = class(TComponent) 
public 
  function HandleAlarm(Address,Message:string; Tag, ID: Integer; Item: TPlannerItem): Boolean; virtual; 
end;
One single function should thus be defined. The result of the function indicates whether the alarm has been successfully handled or not. If the user selects for example to snooze the alarm for a given amount of time, return false, update the TPlannerItem.Alarm.TimeBefore property to the new time of the alarm and it will be triggered again. The Address, Message, Tag and ID parameters of this function are taken from the TPlannerItem.Alarm property.

The TAlarmMessage alarm handler defines this function in the following way:
{ TAlarmMessage } 
function TAlarmMessage.HandleAlarm(Address, Message: string; Tag, ID: Integer; Item: TPlannerItem): Boolean; 
begin 
  MessageDlg('Alarm for' +Item.CaptionText+#13+ HTMLStrip(Item.Text.Text),mtInformation,[mbok],0); Result := True; 
end;


TMS VCL UI Pack

check_circle
TPlanner
is part of
TMS VCL UI Pack
info
Windows UI Essentials

Pricing

Single Developer License Small Team License Site License
 

TMS VCL UI Pack


€ 375

150 yearly renewal
license for 1 developer


Includes
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
MOST POPULAR

TMS VCL Subscription


€ 895

450 yearly renewal
license for 1 developer


Includes
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
check  TMS VCL UI Pack
check  All TMS VCL products
more_horiz  Discover more
BEST VALUE

TMS ALL-ACCESS


€ 1,795

575 yearly renewal
license for 1 developer


Includes
check  Full source code
check  Access to the TMS Support Center
check  Free updates and new releases
check  TMS VCL UI Pack
check  All TMS VCL products
check  All TMS products
more_horiz  Discover more
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.

TMS ALL-ACCESS

key
Get unlimited access to all TMS products
local_offer
One money and time saving bundle

Free Trial

Start a free TMS VCL UI Pack evaluation today!
RAD Studio


What our customers say

Thank you Mr. Fierens for your time and assistance. Just want to say your VCL Pack is fabulous.

- Mark Mihevc

Thank you for this superb tool collection!

- Henning Swiboda

Thanks for the effort to create the VCL grid goodies ! These chunks of outcome-oriented teaching-material are very useful. It's unbelievable how powerful the grid is when one knows how to unveil it's countless options...

- Feichtenschlager Thomas

I don''t know how I could have created and managed so many projects without the AdvStringGrid! And although there is already so much functionality in it I''m using my own derived version with automatic column widths, enhanced export to Excel (including text colors, backround colors, comments, merged cells and more), the possibility to fill in static data at design time and more. This often allows me to build a new tool in hours instead of days! Support is also great! Thanks.

- Raß Jacqueline

Keep up the great work...Every new release of TMS Component Pack is like Xmas. Top quality components! :-)

- Aidan Thomson via email

TMS WEB Core

language
Create modern web apps in Delphi & VSC
build_circle
Use Object Pascal code to build JavaScript apps