unit DataModuleMain;
interface
uses
SysUtils, Classes, ExtCtrls, FormMain;
type
TdmMain =
class(TDataModule)
procedure DataModuleCreate(Sender: TObject);
private
frmRem: TfrmRem;
procedure OnTimerTimeOut(Sender: TObject);
public
end;
var
dmMain: TdmMain;
gTiPostpone: TTimer;
implementation
{$R *.dfm}
type
TMethodePionter =
packed record
pMethod: Pointer;
pObject: TObject;
end;
procedure TdmMain.DataModuleCreate(Sender: TObject);
var
mp: TMethodePionter;
begin
gTiPostpone := TTimer.Create(self);
gTiPostpone.Enabled := false;
mp.pMethod := @TdmMain.OnTimerTimeOut;
mp.pObject :=
nil;
gTiPostpone.OnTimer := TNotifyEvent(mp);
frmRem := TfrmRem.Create(self);
frmRem.PostPoneTimer := gTiPostpone;
frmRem.Show();
end;
procedure TdmMain.OnTimerTimeOut(Sender: TObject);
begin
gTiPostpone.Enabled := false;
if not Assigned(frmRem)
then
frmRem := frmRem.Create(self);
frmRem.PostPoneTimer := gTiPostpone;
frmRem.Show();
end;
end.