1{ 2 ***************************************************************************** 3 * WSCalendar.pp * 4 * ------------- * 5 * * 6 * * 7 ***************************************************************************** 8 9 ***************************************************************************** 10 This file is part of the Lazarus Component Library (LCL) 11 12 See the file COPYING.modifiedLGPL.txt, included in this distribution, 13 for details about the license. 14 ***************************************************************************** 15} 16unit WSCalendar; 17 18{$mode objfpc}{$H+} 19{$I lcl_defines.inc} 20 21interface 22//////////////////////////////////////////////////// 23// I M P O R T A N T 24//////////////////////////////////////////////////// 25// 1) Only class methods allowed 26// 2) Class methods have to be published and virtual 27// 3) To get as little as posible circles, the uses 28// clause should contain only those LCL units 29// needed for registration. WSxxx units are OK 30// 4) To improve speed, register only classes in the 31// initialization section which actually 32// implement something 33// 5) To enable your XXX widgetset units, look at 34// the uses clause of the XXXintf.pp 35//////////////////////////////////////////////////// 36uses 37//////////////////////////////////////////////////// 38// To get as little as posible circles, 39// uncomment only when needed for registration 40//////////////////////////////////////////////////// 41 Types, Calendar, 42//////////////////////////////////////////////////// 43 WSLCLClasses, WSControls, WSFactory; 44 45type 46 { TWSCustomCalendar } 47 48 TWSCustomCalendar = class(TWSWinControl) 49 published 50 class function GetDateTime(const ACalendar: TCustomCalendar): TDateTime; virtual; 51 class function HitTest(const ACalendar: TCustomCalendar; const APoint: TPoint): TCalendarPart; virtual; 52 class function GetCurrentView(const ACalendar: TCustomCalendar): TCalendarView; virtual; 53 class procedure SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime); virtual; 54 class procedure SetDisplaySettings(const ACalendar: TCustomCalendar; 55 const ADisplaySettings: TDisplaySettings); virtual; 56 end; 57 TWSCustomCalendarClass = class of TWSCustomCalendar; 58 59 { WidgetSetRegistration } 60 61 procedure RegisterCustomCalendar; 62 63implementation 64 65uses 66 LResources; 67 68class function TWSCustomCalendar.GetDateTime(const ACalendar: TCustomCalendar): TDateTime; 69begin 70 Result := 0.0; 71end; 72 73class function TWSCustomCalendar.HitTest(const ACalendar: TCustomCalendar; const APoint: TPoint): TCalendarPart; 74begin 75 Result := cpNoWhere; 76end; 77 78class function TWSCustomCalendar.GetCurrentView(const ACalendar: TCustomCalendar 79 ): TCalendarView; 80begin 81 Result := cvMonth; 82end; 83 84class procedure TWSCustomCalendar.SetDateTime(const ACalendar: TCustomCalendar; const ADateTime: TDateTime); 85begin 86end; 87 88class procedure TWSCustomCalendar.SetDisplaySettings(const ACalendar: TCustomCalendar; 89 const ADisplaySettings: TDisplaySettings); 90begin 91end; 92 93{ WidgetSetRegistration } 94 95procedure RegisterCustomCalendar; 96const 97 Done: Boolean = False; 98begin 99 if Done then exit; 100 WSRegisterCustomCalendar; 101 RegisterPropertyToSkip(TCalendar, 'ReadOnly', 'Obsoleted property', ''); 102// if not WSRegisterCustomCalendar then 103// RegisterWSComponent(TCustomCalendar, TWSCustomCalendar); 104 Done := True; 105end; 106 107end. 108