Index: cprs/trunk/CPRS-Chart/fLabTestGroups.pas
===================================================================
--- cprs/trunk/CPRS-Chart/fLabTestGroups.pas	(revision 456)
+++ cprs/trunk/CPRS-Chart/fLabTestGroups.pas	(revision 830)
@@ -5,8 +5,8 @@
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
-  ExtCtrls, Buttons, ORCtrls, StdCtrls;
+  ExtCtrls, Buttons, ORCtrls, StdCtrls, fBase508Form, VA508AccessibilityManager;
 
 type
-  TfrmLabTestGroups = class(TForm)
+  TfrmLabTestGroups = class(TfrmBase508Form)
     pnlLabTestGroups: TORAutoPanel;
     cmdOK: TButton;
@@ -34,5 +34,5 @@
     cmdAdd: TButton;
     cmdAddTest: TButton;
-    lblDefine: TLabel;
+    lblDefine: TVA508StaticText;
     lblTestGroup: TLabel;
     procedure FormCreate(Sender: TObject);
@@ -50,5 +50,4 @@
       Direction, InsertAt: Integer);
     procedure cboUsersClick(Sender: TObject);
-    procedure lstTestGroupsClick(Sender: TObject);
     procedure cmdReplaceClick(Sender: TObject);
     procedure cmdAddClick(Sender: TObject);
@@ -64,4 +63,5 @@
     procedure pnlUpButtonResize(Sender: TObject);
     procedure pnlDownButtonResize(Sender: TObject);
+    procedure lstTestGroupsChange(Sender: TObject);
   private
     { Private declarations }
@@ -76,5 +76,5 @@
 implementation
 
-uses fLabs, ORFn, rLabs, uCore;
+uses fLabs, ORFn, rLabs, uCore, VAUtils, VA508AccessibilityRouter;
 
 {$R *.DFM}
@@ -107,5 +107,5 @@
         AutoSize := True;
       end;
-      lstList.Items.Assign(frmLabs.lstTests.Items);
+      FastAssign(frmLabs.lstTests.Items, lstList.Items);
       if lstList.Items.Count > 0 then lstList.ItemIndex := 0;
       lstListClick(frmLabTestGroups);
@@ -163,8 +163,8 @@
 begin
   if lstList.Items.Count = 0 then
-    ShowMessage('No tests were selected.')
+    ShowMsg('No tests were selected.')
   else
   begin
-    frmLabs.lstTests.Items.Assign(lstList.Items);
+    FastAssign(lstList.Items, frmLabs.lstTests.Items);
     frmLabs.lblSpecimen.Caption := cboSpecimen.Items[cboSpecimen.ItemIndex];
     Close;
@@ -206,4 +206,6 @@
     lstList.ItemIndex := newindex;
     lstListClick(self);
+    if ScreenReaderSystemActive then
+      GetScreenReader.Speak('Test Moved Up');
   end;
 end;
@@ -221,4 +223,6 @@
     lstList.ItemIndex := newindex;
     lstListClick(self);
+    if ScreenReaderSystemActive then
+      GetScreenReader.Speak('Test Moved Down');
   end;
 end;
@@ -261,5 +265,5 @@
 procedure TfrmLabTestGroups.cboUsersClick(Sender: TObject);
 begin
-  lstTestGroups.Items.Assign(TestGroups(cboUsers.ItemIEN));
+  FastAssign(TestGroups(cboUsers.ItemIEN), lstTestGroups.Items);
   TestGroupEnable;
 end;
@@ -290,7 +294,10 @@
 end;
 
-procedure TfrmLabTestGroups.lstTestGroupsClick(Sender: TObject);
-begin
-  AddTests(ATestGroup(lstTestGroups.ItemIEN, cboUsers.ItemIEN));
+procedure TfrmLabTestGroups.lstTestGroupsChange(Sender: TObject);
+begin
+  if lstTestGroups.ItemIEN > 0 then
+  begin
+    AddTests(ATestGroup(lstTestGroups.ItemIEN, cboUsers.ItemIEN));
+  end;
 end;
 
@@ -313,6 +320,11 @@
     text := text + lstList.DisplayText[i] + #13 + '  ';
   if InfoBox(text,'Confirmation', MB_YESNO or MB_ICONQUESTION) = IDYES then
-    UTGReplace(lstList.Items, lstTestGroups.ItemIEN); //ShowMessage('Replace'); //Replace
+  begin
+    UTGReplace(lstList.Items, lstTestGroups.ItemIEN); //Show508Message('Replace'); //Replace
+    if ScreenReaderSystemActive then
+      GetScreenReader.Speak('test group replaced');
+  end;
   cboUsersClick(self);
+  lstTestGroups.SetFocus;  
 end;
 
@@ -328,4 +340,6 @@
   begin
     UTGAdd(lstList.Items);
+    if ScreenReaderSystemActive then
+      GetScreenReader.Speak('New test group created');
     cboUsers.InitLongList(User.Name);
     for i := 0 to cboUsers.Items.Count - 1 do
@@ -337,4 +351,5 @@
   end;
   if cboUsers.ItemIndex > -1 then cboUsersClick(self);
+  lstTestGroups.SetFocus;  
 end;
 
@@ -349,4 +364,6 @@
   begin
     UTGDelete(lstTestGroups.ItemIEN);
+    if ScreenReaderSystemActive then
+      GetScreenReader.Speak('Test group deleted');
     cboUsers.Text := '';
     lstTestGroups.Clear;
@@ -360,4 +377,5 @@
   end;
   if cboUsers.ItemIndex > -1 then cboUsersClick(self);
+  lstTestGroups.SetFocus;
 end;
 
@@ -384,5 +402,5 @@
 procedure TfrmLabTestGroups.pnlUpButtonEnter(Sender: TObject);
 begin
-  pnlUpButton.BevelOuter := bvRaised;
+  pnlUpButton.BevelOuter := bvLowered;
 end;
 
@@ -394,5 +412,5 @@
 procedure TfrmLabTestGroups.pnlDownButtonEnter(Sender: TObject);
 begin
-  pnlDownButton.BevelOuter := bvRaised;
+  pnlDownButton.BevelOuter := bvLowered;
 end;
 
