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
TcwWeekView

Unit: cwWeek

Ancestor: TCustomgwGrid

Properties
Date, DayTitleFormats, FocusStyle, Manager, MultiSelection, SelectionStyle, WeekdayColor, WeekdayFont, WeekendColor, WeekendFont,
Inherited from TCustomgwGrid
Align, Anchors, BorderStyle, Cell, Column, ColumnCount, ColumnIndex, Ctl3D, DragCursor, DragMode, PopupMenu, Row, RowCount, RowIndex, Scrollbars, Visible,

Methods
GetCell,

Events
OnInitialize,
Inherited from TCustomgwGrid
OnAnchorClick, OnBeforeDraw, OnClick, OnDblClick, OnDeSelectCell, OnDragOver, OnDragDrop, OnEnter, OnEnterCell, OnExit, OnExitCell, OnKeyDown, OnKeyPress, OnKeyUp, OnMouseDown, OnMouseUp, OnMouseMove, OnSelectCell, OnSelectionComplete, OnStartDrag, OnEndDrag,



Properties
Date

property Date : FDate;

Description Use Date to change the selected date.

Example Select New Years Day 1999

cwWeekView1.Date := EncodeDate(1999, 1, 1);

DayTitleFormats

property DayTitleFormats : string;

FocusStyle

property FocusStyle : TSelectionStyle;

See also Grid options

Manager

property Manager : TcwManager;

See also TcwManager

MultiSelection

property MultiSelection : boolean;

See also Grid options

SelectionStyle

property SelectionStyle : TSelectionStyle;

See also Grid options

WeekdayColor

property WeekdayColor : TColor;

Description Use WeekdayColor to change the background color of week days (Monday through to Friday).

Example Display week days with a white background

cwWeekView1.WeekdayColor := clWhite;

WeekdayFont

property WeekdayFont : TFont;

Description Use WeekdayFont to change the font used to display week days (Monday through to Friday).

WeekendColor

property WeekendColor : TColor;

Description Use WeekendColor to change the background color of weekends (Saturday and Sunday).

Example Display weekends with a yellow background

cwWeekView1.WeekendColor := clYellow;

WeekendFont

property WeekendFont : TFont;

Description Use WeekendFont to change the font used to display week ends (Saturday and Sunday).


Methods
GetCell

function GetCell(Date : TDate) : TcwWeekViewCell;

Description Use GetCell to retrieve the cell that represents a given date.

If the date is not currently displayed on the weekview component GetCell will return nil.


Example Change the background color of 1st January 1999 to red

var
   Cell : TcwWeekViewCell;
begin
   Cell := cwWeekView1.GetCell(EncodeDate(1999, 1, 1));
   if Cell <> nil then
      Cell.Color := clRed;
end;


Events
OnInitialize

Description OnInitialize is called whenever any of the following properties are changed :-

WeekdayColor, WeekdayFont, WeekendColor or WeekendFont.

It is also called if the WeekView is "scrolled" by changing the date.

If you wish to customize the appearance of your WeekView component do so within this event.


Example Append "Public Holiday" to the cell displaying January 1st 1999

procedure TcwWeekView1.OnInitialise(Sender : TObject);
var
   Cell : TcwWeekViewCell;
begin
   Cell := cwWeekView1.GetCell(EncodeDate(1999, 1, 1));
   if Cell <> nil then
      Cell.Text := Cell.Text + ' Public Holiday';
end;



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