1 | unit fEffectDate;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
7 | fAutoSz, Grids, Calendar, ORDtTmCal, StdCtrls, ORDtTm, ORFn,
|
---|
8 | VA508AccessibilityManager;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TfrmEffectDate = class(TfrmAutoSz)
|
---|
12 | calEffective: TORDateBox;
|
---|
13 | Label2: TLabel;
|
---|
14 | Label3: TStaticText;
|
---|
15 | Label4: TStaticText;
|
---|
16 | cmdOK: TButton;
|
---|
17 | cmdCancel: TButton;
|
---|
18 | procedure FormCreate(Sender: TObject);
|
---|
19 | procedure cmdOKClick(Sender: TObject);
|
---|
20 | procedure cmdCancelClick(Sender: TObject);
|
---|
21 | private
|
---|
22 | OKPressed: Boolean;
|
---|
23 | end;
|
---|
24 |
|
---|
25 | function ObtainEffectiveDate(var ADate: TFMDateTime): Boolean;
|
---|
26 |
|
---|
27 | implementation
|
---|
28 |
|
---|
29 | {$R *.DFM}
|
---|
30 |
|
---|
31 | function ObtainEffectiveDate(var ADate: TFMDateTime): Boolean;
|
---|
32 | var
|
---|
33 | frmEffectDate: TfrmEffectDate;
|
---|
34 | begin
|
---|
35 | Result := False;
|
---|
36 | frmEffectDate := TfrmEffectDate.Create(Application);
|
---|
37 | try
|
---|
38 | ResizeFormToFont(TForm(frmEffectDate));
|
---|
39 | if ADate <> 0 then frmEffectDate.calEffective.FMDateTime := ADate;
|
---|
40 | frmEffectDate.ShowModal;
|
---|
41 | if frmEffectDate.OKPressed then
|
---|
42 | begin
|
---|
43 | ADate := frmEffectDate.calEffective.FMDateTime;
|
---|
44 | Result := True;
|
---|
45 | end;
|
---|
46 | finally
|
---|
47 | frmEffectDate.Release;
|
---|
48 | end;
|
---|
49 | end;
|
---|
50 |
|
---|
51 | procedure TfrmEffectDate.FormCreate(Sender: TObject);
|
---|
52 | begin
|
---|
53 | inherited;
|
---|
54 | OKPressed := False;
|
---|
55 | end;
|
---|
56 |
|
---|
57 | procedure TfrmEffectDate.cmdOKClick(Sender: TObject);
|
---|
58 | begin
|
---|
59 | inherited;
|
---|
60 | OKPressed := True;
|
---|
61 | Close;
|
---|
62 | end;
|
---|
63 |
|
---|
64 | procedure TfrmEffectDate.cmdCancelClick(Sender: TObject);
|
---|
65 | begin
|
---|
66 | inherited;
|
---|
67 | Close;
|
---|
68 | end;
|
---|
69 |
|
---|
70 | end.
|
---|