home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / WIN / Programa / CALNPNL2.ZIP / CALTEST.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-08-31  |  1.6 KB  |  80 lines

  1. // RW: in order to test the modifications
  2. unit caltest;
  3.  
  4. interface
  5.  
  6. uses
  7.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  8.   WinTypes, WinProcs, Calpnl, StdCtrls;
  9.  
  10. type
  11.   TForm1 = class(TForm)
  12.     Button1: TButton;
  13.     procedure FormCreate(Sender: TObject);
  14.     procedure Button1Click(Sender: TObject);
  15.   private
  16.     { Private-Deklarationen }
  17.   public
  18.     { Public-Deklarationen }
  19.     tCal: TCalenPnl;
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.   vDate: TDateTime;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. procedure TForm1.FormCreate(Sender: TObject);
  31. begin
  32.  
  33.   // RW: Create the calendar
  34.   tCal := TCalenPnl.Create(Self);
  35.   tcal.Parent := Self;
  36.  
  37.   with tcal do
  38.   begin
  39.      // RW: set property values
  40.      Left := 1;
  41.      Top := 1;
  42.      Width := 200;
  43.      Height := 200;
  44.      TabOrder := 0;
  45.      UseLongDate := False;
  46.      GermanDate := False;
  47.      ShowDate := True;
  48.  
  49.      // Holidays for german date
  50.      Holidays.Add('6.6.');
  51.      Holidays.Add('1.5.');
  52.      Holidays.Add('3.7.');
  53.      Markdays.Add('1.7.');
  54.      Markdays.Add('5.7.');
  55.  
  56.      // Holidays for english date
  57.      Holidays.Add('6/6/');
  58.      Holidays.Add('5/1/');
  59.      Holidays.Add('7/3/');
  60.      Markdays.Add('7/1/');
  61.      Markdays.Add('7/5/');
  62.  
  63.      // she comes in colors...
  64.      ColMarked := clRed;
  65.      ColHoliday := clAqua;
  66.      ColWeekend := clTeal;
  67.   end;
  68.  
  69. end;
  70.  
  71. procedure TForm1.Button1Click(Sender: TObject);
  72. const toggle: boolean = True;
  73. begin
  74.   tcal.CalendarDate := Date;
  75.   tcal.GermanDate := toggle;
  76.   toggle := not(toggle);
  77. end;
  78.  
  79. end.
  80.