Index: cprs/trunk/CPRS-Chart/Orders/fOMVerify.pas
===================================================================
--- cprs/trunk/CPRS-Chart/Orders/fOMVerify.pas	(revision 829)
+++ cprs/trunk/CPRS-Chart/Orders/fOMVerify.pas	(revision 1679)
@@ -5,5 +5,5 @@
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
-  fAutoSz, StdCtrls, ComCtrls, VA508AccessibilityManager;
+  fAutoSz, StdCtrls, ComCtrls, VA508AccessibilityManager, VA508AccessibilityRouter;
 
 type
@@ -13,4 +13,5 @@
     cmdCancel: TButton;
     memText: TRichEdit;
+    VA508ComponentAccessibility1: TVA508ComponentAccessibility;
     procedure cmdAcceptClick(Sender: TObject);
     procedure cmdEditClick(Sender: TObject);
@@ -20,4 +21,10 @@
     procedure memTextKeyUp(Sender: TObject; var Key: Word;
       Shift: TShiftState);
+    procedure FormDestroy(Sender: TObject);
+    procedure VA508ComponentAccessibility1StateQuery(Sender: TObject;
+      var Text: string);
+    procedure FormShow(Sender: TObject);
+    procedure memTextKeyDown(Sender: TObject; var Key: Word;
+      Shift: TShiftState);
   private
     FLevel: Integer;
@@ -26,4 +33,6 @@
 procedure ShowVerifyText(var QuickLevel: Integer; var VerifyText: string; InptDispGrp: boolean = False);
 
+var
+ frmOMVerify: TfrmOMVerify;
 implementation
 
@@ -34,5 +43,5 @@
 procedure ShowVerifyText(var QuickLevel: Integer; var VerifyText: string; InptDispGrp: boolean);
 var
-  frmOMVerify: TfrmOMVerify;
+  //frmOMVerify: TfrmOMVerify;
   tempStrs,prompts: TStringList;
   flag: boolean;
@@ -68,5 +77,4 @@
   prompts.Add('priority');
   frmOMVerify := TfrmOMVerify.Create(Application);
-  try
     ResizeFormToFont(TForm(frmOMVerify));
     if InptDispGrp then
@@ -79,17 +87,16 @@
       SetString(VerifyText, tempStrs.GetText, StrLen(tempStrs.GetText))
     end;
-
-    with frmOMVerify do
-    begin
-      SetBounds(frmFrame.Left, frmFrame.Top + frmFrame.Height - Height, Width, Height);
       SetFormPosition(frmOMVerify);
       ExpandOrderObjects(VerifyText, HasObjects);
-      memText.Lines.SetText(PChar(VerifyText));
-      ShowModal;
-      QuickLevel := FLevel;
-    end;
-  finally
-    frmOMVerify.Release;
-  end;
+      frmOMVerify.memText.Lines.SetText(PChar(VerifyText));
+      frmOMVerify.ShowModal;
+      if frmOMVerify.ModalResult = mrOK then
+        begin
+          QuickLevel := frmOMVerify.FLevel;
+        end;
+      //agp on CPRS timeout ModalResult equal mrCancel this prevent starting a new order
+      //when the chart is timing out.
+      if frmOMVerify.ModalResult = mrCancel then QuickLevel := QL_CANCEL;      
+     frmOMVerify.Free;
 end;
 
@@ -98,5 +105,24 @@
 begin
   inherited;
+  frmOMVerify := nil;
   FLevel := QL_CANCEL;
+  ModalResult := mrNone;
+end;
+
+
+procedure TfrmOMVerify.FormDestroy(Sender: TObject);
+begin
+  inherited;
+  frmOMVerify := nil;
+end;
+
+procedure TfrmOMVerify.FormShow(Sender: TObject);
+begin
+  inherited;
+  if ScreenReaderSystemActive then
+  begin
+    memText.TabStop := true;
+    memText.SetFocus;
+  end;
 end;
 
@@ -105,5 +131,5 @@
   inherited;
   FLevel := QL_AUTO;
-  Close;
+  ModalResult := mrOK;
 end;
 
@@ -112,5 +138,5 @@
   inherited;
   FLevel := QL_DIALOG;
-  Close;
+  ModalResult := mrOK;
 end;
 
@@ -119,5 +145,5 @@
   inherited;
   FLevel := QL_CANCEL;
-  Close;
+  ModalResult := mrOK;
 end;
 
@@ -129,9 +155,29 @@
 end;
 
+procedure TfrmOMVerify.memTextKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  inherited;
+  if ShiftTabIsPressed() then
+  begin
+    FindNextControl(Sender as TWinControl, False, True, False).SetFocus; //previous control
+    Key := 0;
+  end;
+  if TabIsPressed() then
+  begin
+    FindNextControl(Sender as TWinControl, True, True, False).SetFocus; //next control
+    Key := 0;
+  end;
+  if (key = VK_ESCAPE) then begin
+    FindNextControl(Sender as TWinControl, False, True, False).SetFocus; //previous control
+    key := 0;
+  end;
+end;
+
 procedure TfrmOMVerify.memTextKeyUp(Sender: TObject; var Key: Word;
   Shift: TShiftState);
 begin
   inherited;
-  if (Key = VK_TAB) then
+  {if (Key = VK_TAB) then
   begin
     if ssShift in Shift then
@@ -149,5 +195,12 @@
     FindNextControl(Sender as TWinControl, False, True, False).SetFocus; //previous control
     key := 0;
-  end;
+  end; }
+end;
+
+procedure TfrmOMVerify.VA508ComponentAccessibility1StateQuery(Sender: TObject;
+  var Text: string);
+begin
+  inherited;
+  Text := memText.Text;
 end;
 
