
Best viewed with
|
|
Unit: cwMonth
Ancestor: TCustomgwGrid
Properties
Date,
DayTitleColor,
DayTitleFont,
DayTitleFormats,
DayTitleSize,
FocusStyle,
Manager,
MonthsHorizontally,
MonthsVertically,
MonthTitleColor,
MonthTitleFont,
MonthTitleFormats,
MonthTitleSize,
MultiSelection,
NonDayColor,
OriginDate,
SelectionStyle,
StartOfWeek,
WeekdayColor,
WeekdayFont,
WeekendColor,
WeekendFont,
WrapDays,
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,
OnMouseMove,
OnMouseUp,
OnSelectCell,
OnSelectionComplete,
OnStartDrag,
OnEndDrag,
 |
|
Date
|
|
|
property Date : FDate;
|
|
|
Description
|
Use Date to change the selected date.
|
|
|
See also
|
OriginDate
|
|
|
|
Select New Years Day 1999
// Display month of January
cwMonthView1.OriginDate := EncodeDate(1999, 1, 1);
// Now select 1st of January
cwMonthView1.Date := EncodeDate(1999, 1, 1);
|
 |
|
DayTitleColor
|
|
|
property DayTitleColor : TColor;
|
|
|
Description
|
Use DayTitleColor to change the background color for the
day titles (Monday, Tuesday, Wednesday etc).
|
|
|
|
Display day titles with a gray background
cwMonthView1.DayTitleColor := clGray;
|
 |
|
DayTitleFont
|
|
|
property DayTitleFont : TFont;
|
|
|
Description
|
Use DayTitleFont to change the font used to display the
day titles.
|
|
|
|
Display day titles in a bold font
cwMonthView1.DayTitleFont.Style := [fsBold];
|
 |
|
DayTitleFormats
|
|
|
property DayTitleFormats : string;
|
 |
|
DayTitleSize
|
|
|
property DayTitleSize : integer;
|
|
|
Description
|
Use DayTitleSize to change the height of the row
displaying day titles. You can hide day titles by specifying 0
as the size.
|
|
|
|
Hide day titles
cwMonthView1.DayTitleSize := 0;
|
 |
|
FocusStyle
|
|
|
property FocusStyle : TSelectionStyle;
|
|
|
See also
|
Grid options
|
 |
|
Manager
|
|
|
property Manager : TcwManager;
|
|
|
See also
|
TcwManager
|
 |
|
MonthsHorizontally
|
|
|
property MonthsHorizontally : integer;
|
|
|
Description
|
Use MonthsHorizontally to change the number of months
displayed across the month view component.
|
|
|
|
Display 2 months across
cwMonthView1.MonthsAcross := 2;
|
 |
|
MonthsVertically
|
|
|
property MonthsVertically : integer;
|
|
|
Description
|
Use MonthsVertically to change the number of months
displayed down the month view component.
|
|
|
|
Display 3 months down
cwMonthView1.MonthsAcross := 3;
|
 |
|
MonthTitleColor
|
|
|
property MonthTitleColor : TColor;
|
|
|
Description
|
Use MonthTitleColor to change the background color of
the month title.
|
|
|
|
Display month title with a blue background
cwMonthView1.MonthTitleColor := clBlue;
|
 |
|
MonthTitleFont
|
|
|
property MonthTitleFont : TFont;
|
|
|
Description
|
Use MonthTitleFont to change the font used to display
the month title.
|
|
|
|
Display month title with a white text
cwMonthView1.MonthTitleFont.Color := clWhite;
|
 |
|
MonthTitleFormats
|
|
|
property MonthTitleFormats : string;
|
 |
|
MonthTitleSize
|
|
|
property MonthTitleSize : integer;
|
|
|
Description
|
Use MonthTitleSize to change the height of the row
displaying the month title. You can hide the month title by
specifying 0 as the size.
|
|
|
|
Hide the month title
cwMonthView1.MonthTitleSize := 0;
|
 |
|
MultiSelection
|
 |
|
NonDayColor
|
|
|
property NonDayColor : TColor;
|
|
|
Description
|
Use NonDayColor to change the background color of
cells which do not have dates.
|
|
|
|
Display non day cells with a gray
cwMonthView1.NonDayColor := clGray;
|
 |
|
OriginDate
|
|
|
property OriginDate : FDate;
|
|
|
Description
|
Use OriginDate to specify the first month to display in the
month view component.
|
|
|
See also
|
Date
|
|
|
|
Display the month of March 1999
cwMonthView1.OriginDate := EncodeDate(1999, 3, 1);
|
 |
|
SelectionStyle
|
|
|
property SelectionStyle : TSelectionStyle;
|
|
|
See also
|
Grid options
|
 |
|
StartOfWeek
|
 |
|
WeekdayColor
|
|
|
property WeekdayColor : TColor;
|
|
|
Description
|
Use WeekdayColor to change the background color of
week days (Monday through to Friday).
|
|
|
|
Display week days with a white background
cwMonthView1.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).
|
|
|
|
Display weekends with a yellow background
cwMonthView1.WeekendColor := clYellow;
|
 |
|
WeekendFont
|
|
|
property WeekendFont : TFont;
|
|
|
Description
|
Use WeekendFont to change the font used to display week
ends (Saturday and Sunday).
|
 |
|
WrapDays
|
|
|
property WrapDays : boolean;
|
|
|
Description
|
Set WrapDays to true to display each month in a compact 5
row format. Setting WrapDays to false will display each month
using 6 rows.
|
 |
|
GetCell
|
|
|
function GetCell(Date : TDate) : TcwMonthViewCell;
|
|
|
Description
|
Use GetCell to retrieve the cell that represents a given
date.
If the date is not currently displayed on the monthview
component GetCell will return nil.
|
|
|
|
Change the background color of 1st January 1999 to red
var
Cell : TcwMonthViewCell;
begin
Cell := cwMonthView1.GetCell(EncodeDate(1999, 1, 1));
if Cell <> nil then
Cell.Color := clRed;
end;
|
 |
|
OnInitialize
|
|
|
Description
|
OnInitialize is called whenever any of the following
properties are changed :-
DayTitleColor, DayTitleFont, DayTitleSize,
MonthsHorizontally, MonthsVertically, MonthTitleColor,
MonthTitleFont, MonthTitleSize, NonDayColor,
WeekdayColor, WeekdayFont, WeekendColor, WeekendFont or
WrapDays.
It is also called if the MonthView is "scrolled" by changing the date.
If you wish to customize the appearance of your MonthView
component do so within this event.
|
|
|
|
Append "Public Holiday" to the cell displaying January 1st 1999
procedure TcwMonthView1.OnInitialise(Sender : TObject);
var
Cell : TcwMonthViewCell;
begin
Cell := cwMonthView1.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
|