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
TcwManager

Unit: cwMan

TcwManager acts as a datasource for the GUI components (day, week and month views).

Events are stored in the Events property.

Properties
EventBeingDragged, Events, SiteIDs, ResourceIDs, EventTypeIDs, EntityIDs,

Methods
MouseToEvent, BeginUpdate, EndUpdate, Refresh,

Events
OnFilterEvent, OnHideEvent, OnShowEvent, OnSynchronized,



Properties
EventBeingDragged

property EventBeingDragged : TcwEvent Read only


Description Use EventBeingDragged to determine which event is being dragged during a drag and drop operation

Please note Nil is returned if no event is being dragged

Example Prevent any event which contains "Public Holiday" in its Data property from being dragged and dropped
procedure TForm1.cwDayView1DragOver(Sender, Source: TObject;
   X, Y: Integer;
   State: TDragState; var Accept: Boolean);
begin
   if cwManager1.EventBeingDragged <> nil then
      if Pos('Public Holiday',
             cwManager1.EventBeingDragged.Data) > 0
      then
         Accept := false;
end;

Events

property Events : TcwEvents

Description The TcwEvents component wich stores events.

See also TcwEvents
TcwMemoryEvents

SiteIDs

property SiteIDs : string

Description Use SiteIDs to display events for given sites. To display events for all sites set SiteIDs to '' (empty string)

Please note SiteIDs is a comma delimited list

See also TcwEvent
ResourceIDs
EventTypeIDs
EntityIDs

Example Display events for site IDs "1" and "2"
cwManager1.SiteIDs := '1,2';

ResourceIDs

property ResourceIDs : string

Description Use ResourceIDs to display events for given resources. To display events for all resources set ResourceIDs to '' (empty string)

Please note ResourceIDs is a comma delimited list

See also TcwEvent
SiteIDs
EventTypeIDs
EntityIDs

Example Display events for resources with IDs of "35" and "99"
cwManager1.ResourceIDs := '35,99';

EventTypeIDs

property EventTypeIDs : string

Description Use EventTypeIDs to display events for given event types. To display events for all event types set EventIDs to '' (empty string)

Please note EventIDs is a comma delimited list

See also TcwEvent
SiteIDs
ResourceIDs
EntityIDs

EntityIDs

property EntityIDs : string

Description Use EntityIDs to display events for given entities. To display events for all entities set EntityIDs to '' (empty string)

Please note EntityIDs is a comma delimited list

See also TcwEvent
SiteIDs
ResourceIDs
EventTypeIDs

Example Display events for entities
cwManager1.EntityIDs := '';


Methods
MouseToEvent

function MouseToEvent(Component : TComponent; X, Y : integer) : TcwEvent;

Description Returns the event at position X, Y in the Component. Component must be a day, week or month view.

Please note NIL is returned if there is no event at position X, Y

BeginUpdate

procedure BeginUpdate;

Description Use BeginUpdate to call BeginUpdate of attached day, week and month view components.

You would typically call BeginUpdate to prevent flicker prior to making multiple changes to events.


Please note Make sure you call EndUpdate after calling BeginUpdate to resume screen updates.

See also EndUpdate

Example Delete all events. Use BeginUpdate and EndUpdate to prevent flicker
// Suspend screen updates
cwManager1.BeginUpdate;

// Delete all events
with TcwEventIterator.Create(cwManager1.Events) do begin
   if First then
      repeat
         Event.Delete
      until not Next;
   Free;
end;

// Resume screen updates
cwManager1.EndUpdate;

EndUpdate

procedure EndUpdate;

Description Use EndUpdate to call EndUpdate of attached day, week and month view components.

See also BeginUpdate

Refresh

procedure Refresh;

Description Call Refresh to ensure the day, view, and month view components are updated.

You would need to call refresh if you change a filter and want to redisplay events that match the new filter criteria



Events
OnFilterEvent

property OnFilterEvent; TcwFilterEventEvent

Description Use OnFilterEvent to filter out unwanted TcwEvents

Example Display events only where the data property is "Meeting"
procedure TForm1.cwManager1FilterEvent(Sender: TObject;
   Event : TcwEvent; Cell : TCell; var Allow : boolean);
begin
   if Event.Data <> 'Meeting' then
      Allow := false;
end;

OnHideEvent

property OnHideEvent; TcwHideEventEvent

Description This event occurs when a TcwEvent needs to be hidden

OnShowEvent

property OnShowEvent; TcwShowEventEvent

Description This event occurs when a TcwEvent needs to be shown

Please note To prevent the event from being displayed set Allow to false.

Example Do not display events in the cwMonthView1 component.
procedure TForm1.cwManager1ShowEvent(Sender: TObject;
  Event: TcwEvent; Cell: TCell;
  var Text: String; var Allow : boolean);
begin
  if Cell.Grid = cwMonthView1 then
     Allow := false;
end;

OnSynchronized

property OnSynchronized; TcwSynchronizedEvent

Description This event occurs after attached day, week or month view components have been "scrolled" in response the the user selecting a date (or date range) in an attached month or week view.



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