forked from motaz/turbobird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalen.pas
66 lines (49 loc) · 1.15 KB
/
calen.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
unit Calen;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Calendar, Buttons;
type
{ TfmCalen }
TfmCalen = class(TForm)
BitBtn1: TBitBtn;
bbOk: TBitBtn;
BitBtn3: TBitBtn;
Calendar1: TCalendar;
edTime: TEdit;
Label1: TLabel;
procedure bbOkClick(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
DateTimeValue: TDateTime;
{ public declarations }
end;
var
fmCalen: TfmCalen;
implementation
{ TfmCalen }
procedure TfmCalen.BitBtn1Click(Sender: TObject);
begin
edTime.Text:= TimeToStr(Time);
Calendar1.DateTime:= Date;
end;
procedure TfmCalen.FormActivate(Sender: TObject);
begin
edTime.Text:= TimeToStr(DateTimeValue);
Calendar1.DateTime:= DateTimeValue;
end;
procedure TfmCalen.FormCreate(Sender: TObject);
begin
end;
procedure TfmCalen.bbOkClick(Sender: TObject);
begin
DateTimeValue:= StrToTime(edTime.Text) + Trunc(Calendar1.DateTime);
end;
initialization
{$I calen.lrs}
end.