source: cprs/branches/foia-cprs/CPRS-Chart/fEffectDate.pas@ 1482

Last change on this file since 1482 was 459, checked in by Kevin Toppenberg, 16 years ago

Adding foia-cprs branch

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