Calendar Works home page

Overview

Components
TcwDayView
TcwWeekView
TcwMonthView
TcwManager
TcwEvents
TcwMemoryEvents

Classes
TcwEvent
TcwEventIterator

Additional Information
Constants & Types
Miscellaneous routines
HTML Reference
FAQ's Frequently asked questions
Tips & Tricks

Help File
Download help file

Feedback
Report a bug with this manual

How do you rate this manual?
Great
OK
Poor

Comments


Best viewed with
Microsoft Internet Explorer
TcwEvent

Unit: cwMan

Represents a Calendar Works event (Appointment, Holiday etc)

Properties
Data, EntityID, EventTypeID, FromDateTime, ID, ResourceID, SiteID, ToDateTime,

Methods
Create, Delete, Save, LoadFromStream, SaveToStream,



Properties
Data

Data : string;

Description Data associated with the event.

This data is formatted and displayed in the day, week and month view components.

To format this data yourself use the OnShowEvent event of the TcwManager component.


See also TcwManager

EntityID

EntityID : string;

Description The identifer of the entity (eg Customer, Patient, Client etc) associated with this event. If there is no entity associated with this event set EntityID to '' (empty string)

EventTypeID

EventTypeID : string;

Description The identifer of the event type associated with this event. If there is event type associated with this event set EventTypeID to '' (empty string)

FromDateTime

FromDateTime : TDateTime;

Description The starting date and time of the event.

ID

ID : string;

Description A unique identifier for the event.

ResourceID

ResourceID : string;

Description The identifer of the resource associated with this event. If there is resource associated with this event set ResourceID to '' (empty string)

SiteID

SiteID : string;

Description The identifer of the site associated with this event. If there is no site associated with this event set SiteID to '' (empty string)

ToDateTime

ToDateTime : TDateTime;

Description The ending date and time of the event.


Methods
Create

constructor Create(AEvents : TcwEvents)

Description Event constructor

Please note Use the CreateEvent method of TcwEvents to create a new event

See also TcwEvents

Example Create and save a new event
var
   Event : TcwEvent;
begin
   Event := cwManager1.Events.CreateEvent;
   with Event do begin
      FromDateTime := Now;
      ToDateTime := FromDateTime;
      Data := 'My sample event';
      Save; // Save it
      Free; // and free memory
   end;
end;

Delete

procedure Delete

Description Use Delete to delete the event.

Example Delete event whose ID is 3
var
   Event : TcwEvent;
begin
   Event := cwManager1.Events.Get(3);
   if Event <> nil then begin
      Event.Delete;  // Delete it
      Event.Free;    // and free memory
   end;
end;

Save

procedure Save

Description Use Save to save the event.

LoadFromStream

protected procedure LoadFromStream(Stream : TStream); virtual

Description Use LoadFromStream to load the event from a stream.

Please note If you are deriving your own event class from TcwEvent you must implement LoadFromStream and SaveToStream in your class

SaveToStream

protected procedure SaveToStream(Stream : TStream); virtual

Description Use SaveToStream to save the event to a stream.

Please note If you are deriving your own event class from TcwEvent you must implement LoadFromStream and SaveToStream in your class



Copyright © 1998-2007 Innova Software ALL RIGHTS RESERVED
All trademarks are the property of their respective owners.
Webmaster webmaster@innovasoftware.com