Index: cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCSession.pas
===================================================================
--- cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCSession.pas	(revision 459)
+++ cprs/branches/foia-cprs/CPRS-Chart/Orders/fOCSession.pas	(revision 460)
@@ -5,11 +5,12 @@
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
-  fAutoSz, StdCtrls, ORFn, uConst, ORCtrls;
+  fAutoSz, StdCtrls, ORFn, uConst, ORCtrls, ExtCtrls;
 
 type
   TfrmOCSession = class(TfrmAutoSz)
-    lstChecks: TListBox;
+    lstChecks: TCaptionListBox;
+    pnlBottom: TPanel;
+    lblJustify: TLabel;
     txtJustify: TCaptionEdit;
-    lblJustify: TLabel;
     cmdCancelOrder: TButton;
     cmdContinue: TButton;
@@ -20,4 +21,9 @@
     procedure lstChecksDrawItem(Control: TWinControl; Index: Integer;
       Rect: TRect; State: TOwnerDrawState);
+    procedure FormClose(Sender: TObject; var Action: TCloseAction);
+    procedure FormShow(Sender: TObject);
+    procedure FormResize(Sender: TObject);
+    procedure txtJustifyKeyDown(Sender: TObject; var Key: Word;
+      Shift: TShiftState);
   private
     FCritical: Boolean;
@@ -36,5 +42,5 @@
 {$R *.DFM}
 
-uses rOrders, uCore;
+uses rOrders, uCore, rMisc;
 
 type
@@ -49,4 +55,5 @@
 var
   uCheckedOrders: TList;
+  FOldHintHidePause: integer;
 
 constructor TOCRec.Create(const AnID: string);
@@ -54,8 +61,10 @@
   OrderID := AnID;
   Checks := TStringList.Create;
+  FOldHintHidePause := Application.HintHidePause;
 end;
 
 destructor TOCRec.Destroy;
 begin
+  Application.HintHidePause := FOldHintHidePause;
   Checks.Free;
   inherited Destroy;
@@ -141,4 +150,5 @@
         frmOCSession.SetReqJustify;
         MessageBeep(MB_ICONASTERISK);
+        if frmOCSession.Visible then frmOCSession.SetFocus;
         frmOCSession.ShowModal;
       finally
@@ -166,8 +176,8 @@
   lblJustify.Visible := FCritical;
   txtJustify.Visible := FCritical;
-end;
-
-procedure TfrmOCSession.lstChecksMeasureItem(Control: TWinControl; Index: Integer;
-  var Height: Integer);
+
+end;
+
+procedure TfrmOCSession.lstChecksMeasureItem(Control: TWinControl; Index: Integer; var Height: Integer);
 var
   i, AHt, TotalHt: Integer;
@@ -177,28 +187,28 @@
 begin
   inherited;
+
   with lstChecks do
-  begin
-    if Index >= uCheckedOrders.Count then Exit;
-    OCRec := TOCRec(uCheckedOrders.Items[Index]);
-    ARect := ItemRect(Index);
-    ARect.Left := ARect.Left + 2;
-    AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect,
-                    DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK) + 2;
-    TotalHt := AHt;
-    for i := 0 to OCRec.Checks.Count - 1 do
-    begin
-      ARect := ItemRect(Index);
-      ARect.Left := ARect.Left + 10;
-      x := Piece(OCRec.Checks[i], U, 3);
-      AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect,
-                      DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
-      TotalHt := TotalHt + AHt;
-    end;
-  end;
+     begin
+       if Index >= uCheckedOrders.Count then Exit;
+       OCRec := TOCRec(uCheckedOrders.Items[Index]);
+       ARect := ItemRect(Index);
+       ARect.Left := ARect.Left + 2;
+       AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect, DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING) + 2; //CQ7178: added DT_EXTERNALLEADING
+       TotalHt := AHt;
+
+       for i := 0 to OCRec.Checks.Count - 1 do
+          begin
+            ARect := ItemRect(Index);
+            ARect.Left := ARect.Left + 10;
+            x := Piece(OCRec.Checks[i], U, 3);
+            AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, DT_CALCRECT or DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING); //CQ7178: added DT_EXTERNALLEADING
+            TotalHt := TotalHt + AHt;
+          end;
+     end;
   Height := TotalHt + 2; // add 2 for focus rectangle
-end;
-
-procedure TfrmOCSession.lstChecksDrawItem(Control: TWinControl; Index: Integer; Rect: TRect;
-  State: TOwnerDrawState);
+  if Height > 255 then Height := 255; //CQ7178
+end;
+
+procedure TfrmOCSession.lstChecksDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
 var
   i, AHt: Integer;
@@ -208,32 +218,31 @@
 begin
   inherited;
+
   with lstChecks do
-  begin
-    if Index >= uCheckedOrders.Count then Exit;
-    OCRec := TOCRec(uCheckedOrders.Items[Index]);
-    ARect := ItemRect(Index);
-    AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect,
-                    DT_LEFT or DT_NOPREFIX or DT_WORDBREAK) + 2;
-    ARect.Left := ARect.Left + 10;
-    ARect.Top  := ARect.Top + AHt;
-    for i := 0 to OCRec.Checks.Count - 1 do
-    begin
-      x := Piece(OCRec.Checks[i], U, 3);
-      if not (odSelected in State) then
-      begin
-        if (Piece(OCRec.Checks[i], U, 2) = '1')
-          then
+     begin
+       if Index >= uCheckedOrders.Count then Exit;
+       OCRec := TOCRec(uCheckedOrders.Items[Index]);
+       ARect := ItemRect(Index);
+       AHt := DrawText(Canvas.Handle, PChar(OCRec.OrderText), Length(OCRec.OrderText), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING) + 2; //CQ7178: added DT_EXTERNALLEADING
+       ARect.Left := ARect.Left + 10;
+       ARect.Top  := ARect.Top + AHt;
+       for i := 0 to OCRec.Checks.Count - 1 do
           begin
-            if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then
-              Canvas.Font.Color := clBlue;
-            Canvas.Font.Style := [fsUnderline];
-          end
-          else Canvas.Font.Color := clWindowText;
-      end;
-      AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect,
-                      DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
-      ARect.Top  := ARect.Top + AHt;
-    end;
-  end;
+            x := Piece(OCRec.Checks[i], U, 3);
+            if not (odSelected in State) then
+               begin
+                 if (Piece(OCRec.Checks[i], U, 2) = '1') then
+                   begin
+                     if ColorToRGB(clWindowText) = ColorToRGB(clBlack) then
+                       Canvas.Font.Color := clBlue;
+                     Canvas.Font.Style := [fsUnderline];
+                   end
+                 else Canvas.Font.Color := clWindowText;
+               end;
+            AHt := DrawText(Canvas.Handle, PChar(x), Length(x), ARect, DT_LEFT or DT_NOPREFIX or DT_WORDBREAK or DT_EXTERNALLEADING); //CQ7178: added DT_EXTERNALLEADING
+            ARect.Top  := ARect.Top + AHt;
+        end;
+     end;
+
 end;
 
@@ -268,5 +277,5 @@
   if FCritical and ((Length(txtJustify.Text) < 2) or not ContainsVisibleChar(txtJustify.Text)) then
   begin
-    InfoBox('A justification for overriding critical order checks is required.',
+     InfoBox('A justification for overriding critical order checks is required.',
             'Justification Required', MB_OK);
     Exit;
@@ -278,3 +287,31 @@
 end;
 
+procedure TfrmOCSession.FormClose(Sender: TObject;
+  var Action: TCloseAction);
+begin
+  inherited;
+  SaveUserBounds(Self); //Save Position & Size of Form
+end;
+
+procedure TfrmOCSession.FormShow(Sender: TObject);
+begin
+  inherited;
+  SetFormPosition(Self); //Get Saved Position & Size of Form
+end;
+
+
+procedure TfrmOCSession.FormResize(Sender: TObject);
+begin
+  //TfrmAutoSz has defect must call inherited Resize for the resize to function.
+  inherited;
+end;
+
+procedure TfrmOCSession.txtJustifyKeyDown(Sender: TObject; var Key: Word;
+  Shift: TShiftState);
+begin
+  inherited;
+  //GE CQ9540  activate Return key, behave as "Continue" buttom clicked.
+  if Key = VK_RETURN then cmdContinueClick(self);
+end;
+
 end.
