source: cprs/trunk/CPRS-Chart/fEffectDate.pas@ 924

Last change on this file since 924 was 830, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

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 VA508AccessibilityManager;
9
10type
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
25function ObtainEffectiveDate(var ADate: TFMDateTime): Boolean;
26
27implementation
28
29{$R *.DFM}
30
31function ObtainEffectiveDate(var ADate: TFMDateTime): Boolean;
32var
33 frmEffectDate: TfrmEffectDate;
34begin
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;
49end;
50
51procedure TfrmEffectDate.FormCreate(Sender: TObject);
52begin
53 inherited;
54 OKPressed := False;
55end;
56
57procedure TfrmEffectDate.cmdOKClick(Sender: TObject);
58begin
59 inherited;
60 OKPressed := True;
61 Close;
62end;
63
64procedure TfrmEffectDate.cmdCancelClick(Sender: TObject);
65begin
66 inherited;
67 Close;
68end;
69
70end.
Note: See TracBrowser for help on using the repository browser.