2008-07-06 17:36:37 -04:00
|
|
|
unit fTimeout;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
2010-07-07 16:51:54 -04:00
|
|
|
fAutoSz, ExtCtrls, StdCtrls, ORFn, VA508AccessibilityManager;
|
2008-07-06 17:36:37 -04:00
|
|
|
|
|
|
|
type
|
|
|
|
TfrmTimeout = class(TfrmAutoSz)
|
2015-05-07 12:34:29 -04:00
|
|
|
timCountDown: TTimer;
|
|
|
|
pnlTop: TPanel;
|
2008-07-06 17:36:37 -04:00
|
|
|
Label1: TStaticText;
|
|
|
|
Label2: TStaticText;
|
2015-05-07 12:34:29 -04:00
|
|
|
pnlBottom: TPanel;
|
|
|
|
btnClose: TButton;
|
2008-07-06 17:36:37 -04:00
|
|
|
cmdContinue: TButton;
|
|
|
|
lblCount: TStaticText;
|
2015-05-07 12:34:29 -04:00
|
|
|
pnlWarning: TPanel;
|
|
|
|
imgWarning: TImage;
|
|
|
|
lblWarning: TLabel;
|
|
|
|
lblWarningMultiple: TLabel;
|
|
|
|
lblWarningContinue: TLabel;
|
|
|
|
lblWarningPatient: TLabel;
|
2008-07-06 17:36:37 -04:00
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
procedure cmdContinueClick(Sender: TObject);
|
|
|
|
procedure timCountDownTimer(Sender: TObject);
|
2015-05-07 12:34:29 -04:00
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
procedure btnCloseClick(Sender: TObject);
|
2008-07-06 17:36:37 -04:00
|
|
|
private
|
|
|
|
{ Private declarations }
|
|
|
|
FContinue: Boolean;
|
|
|
|
FCount: Integer;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function AllowTimeout: Boolean;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.DFM}
|
|
|
|
|
|
|
|
uses uCore;
|
|
|
|
|
|
|
|
function AllowTimeout: Boolean;
|
|
|
|
var
|
|
|
|
frmTimeout: TfrmTimeout;
|
|
|
|
begin
|
|
|
|
frmTimeout := TfrmTimeout.Create(Application);
|
|
|
|
try
|
|
|
|
ResizeFormToFont(TForm(frmTimeout));
|
|
|
|
frmTimeout.ShowModal;
|
|
|
|
Result := not frmTimeout.FContinue;
|
|
|
|
finally
|
|
|
|
frmTimeout.Release;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmTimeout.FormCreate(Sender: TObject);
|
|
|
|
begin
|
|
|
|
inherited;
|
2010-07-07 16:51:54 -04:00
|
|
|
Application.Restore;
|
|
|
|
Application.BringToFront;
|
2008-07-06 17:36:37 -04:00
|
|
|
MessageBeep(MB_ICONASTERISK);
|
|
|
|
FCount := User.CountDown;
|
|
|
|
lblCount.Caption := IntToStr(FCount);
|
|
|
|
end;
|
|
|
|
|
2015-05-07 12:34:29 -04:00
|
|
|
procedure TfrmTimeout.FormShow(Sender: TObject);
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
SetForegroundWindow(Handle);
|
|
|
|
lblWarningPatient.Caption := Patient.Name;
|
|
|
|
lblWarning.Font.Size := lblWarningPatient.Font.Size + 4;
|
|
|
|
if CPRSInstances < 2 then
|
|
|
|
begin
|
|
|
|
pnlWarning.Visible := false;
|
|
|
|
Height := Height - pnlWarning.Height;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmTimeout.btnCloseClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
FContinue := False;
|
|
|
|
Close;
|
|
|
|
end;
|
|
|
|
|
2008-07-06 17:36:37 -04:00
|
|
|
procedure TfrmTimeout.cmdContinueClick(Sender: TObject);
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
FContinue := True;
|
|
|
|
Close;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TfrmTimeout.timCountDownTimer(Sender: TObject);
|
|
|
|
begin
|
|
|
|
inherited;
|
|
|
|
if FCount = User.CountDown then
|
|
|
|
begin
|
|
|
|
MessageBeep(MB_ICONASTERISK);
|
|
|
|
timCountDown.Enabled := False;
|
|
|
|
timCountDown.Interval := 1000;
|
|
|
|
timCountDown.Enabled := True;
|
|
|
|
end;
|
|
|
|
Dec(FCount);
|
|
|
|
lblCount.Caption := IntToStr(FCount);
|
2015-05-07 12:34:29 -04:00
|
|
|
if FCount < 1 then
|
2008-07-06 17:36:37 -04:00
|
|
|
begin
|
|
|
|
timCountDown.Enabled := False;
|
|
|
|
Close;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|