[453] | 1 | //kt -- Modified with SourceScanner on 7/17/2007
|
---|
| 2 | unit fEffectDate;
|
---|
| 3 |
|
---|
| 4 | interface
|
---|
| 5 |
|
---|
| 6 | uses
|
---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
| 8 | fAutoSz, Grids, Calendar, ORDtTmCal, StdCtrls, ORDtTm, ORFn, DKLang;
|
---|
| 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 | DKLanguageController2: TDKLanguageController;
|
---|
| 19 | procedure FormCreate(Sender: TObject);
|
---|
| 20 | procedure cmdOKClick(Sender: TObject);
|
---|
| 21 | procedure cmdCancelClick(Sender: TObject);
|
---|
| 22 | private
|
---|
| 23 | OKPressed: Boolean;
|
---|
| 24 | end;
|
---|
| 25 |
|
---|
| 26 | function ObtainEffectiveDate(var ADate: TFMDateTime): Boolean;
|
---|
| 27 |
|
---|
| 28 | implementation
|
---|
| 29 |
|
---|
| 30 | {$R *.DFM}
|
---|
| 31 |
|
---|
| 32 | function ObtainEffectiveDate(var ADate: TFMDateTime): Boolean;
|
---|
| 33 | var
|
---|
| 34 | frmEffectDate: TfrmEffectDate;
|
---|
| 35 | begin
|
---|
| 36 | Result := False;
|
---|
| 37 | frmEffectDate := TfrmEffectDate.Create(Application);
|
---|
| 38 | try
|
---|
| 39 | ResizeFormToFont(TForm(frmEffectDate));
|
---|
| 40 | if ADate <> 0 then frmEffectDate.calEffective.FMDateTime := ADate;
|
---|
| 41 | frmEffectDate.ShowModal;
|
---|
| 42 | if frmEffectDate.OKPressed then
|
---|
| 43 | begin
|
---|
| 44 | ADate := frmEffectDate.calEffective.FMDateTime;
|
---|
| 45 | Result := True;
|
---|
| 46 | end;
|
---|
| 47 | finally
|
---|
| 48 | frmEffectDate.Release;
|
---|
| 49 | end;
|
---|
| 50 | end;
|
---|
| 51 |
|
---|
| 52 | procedure TfrmEffectDate.FormCreate(Sender: TObject);
|
---|
| 53 | begin
|
---|
| 54 | inherited;
|
---|
| 55 | OKPressed := False;
|
---|
| 56 | end;
|
---|
| 57 |
|
---|
| 58 | procedure TfrmEffectDate.cmdOKClick(Sender: TObject);
|
---|
| 59 | begin
|
---|
| 60 | inherited;
|
---|
| 61 | OKPressed := True;
|
---|
| 62 | Close;
|
---|
| 63 | end;
|
---|
| 64 |
|
---|
| 65 | procedure TfrmEffectDate.cmdCancelClick(Sender: TObject);
|
---|
| 66 | begin
|
---|
| 67 | inherited;
|
---|
| 68 | Close;
|
---|
| 69 | end;
|
---|
| 70 |
|
---|
| 71 | end.
|
---|