Module

fODLabOthCollSamp

Path

C:\CPRS\CPRS30\Orders\fODLabOthCollSamp.pas

Last Modified

7/15/2014 3:26:42 PM

Units Used in Interface

Name Comments
fBase508Form -

Units Used in Implementation

Name Comments
fODLab -
rODLab -

Classes

Name Comments
TfrmODLabOthCollSamp -

Procedures

Name Owner Declaration Scope Comments
cboOtherCollSampDblClick TfrmODLabOthCollSamp procedure cboOtherCollSampDblClick(Sender: TObject); Public/Published -
cmdCancelClick TfrmODLabOthCollSamp procedure cmdCancelClick(Sender: TObject); Public/Published -
cmdOKClick TfrmODLabOthCollSamp procedure cmdOKClick(Sender: TObject); Public/Published -

Functions

Name Owner Declaration Scope Comments
SelectOtherCollSample - function SelectOtherCollSample(FontSize: Integer; Skip: integer; CollSampList: TList): string ; Interfaced Displays collection sample select form for lab and returns a record of the selection

Constants

Name Declaration Scope Comments
TX_NOCOLLSAMP_CAP 'Missing Collection Sample' Global -
TX_NOCOLLSAMP_TEXT 'Select a collection sample or press Cancel.' Global -


Module Source

1     unit fODLabOthCollSamp;
2     
3     interface
4     
5     uses
6       Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7       ExtCtrls, ORCtrls, StdCtrls, ORFn, fBase508Form, VA508AccessibilityManager;
8     
9     type
10      TfrmODLabOthCollSamp = class(TfrmBase508Form)
11        pnlBase: TORAutoPanel;
12        cboOtherCollSamp: TORComboBox;
13        cmdOK: TButton;
14        cmdCancel: TButton;
15        procedure cmdCancelClick(Sender: TObject);
16        procedure cmdOKClick(Sender: TObject);
17        procedure cboOtherCollSampDblClick(Sender: TObject);
18      private
19        FOtherCollSamp: string;
20      end;
21    
22    function SelectOtherCollSample(FontSize: Integer; Skip: integer; CollSampList: TList): string ;
23    
24    implementation
25    
26    {$R *.DFM}
27    
28    uses fODLab, rODLab;
29    
30    const
31      TX_NOCOLLSAMP_TEXT = 'Select a collection sample or press Cancel.';
32      TX_NOCOLLSAMP_CAP = 'Missing Collection Sample';
33    
34    function SelectOtherCollSample(FontSize: Integer; Skip: integer; CollSampList: TList): string ;
35    { displays collection sample select form for lab and returns a record of the selection }
36    var
37      frmODLabOthCollSamp: TfrmODLabOthCollSamp;
38      W, H, i: Integer;
39      x: string;
40    begin
41      frmODLabOthCollSamp := TfrmODLabOthCollSamp.Create(Application);
42      try
43        with frmODLabOthCollSamp do
44        begin
45          Font.Size := FontSize;
46          W := ClientWidth;
47          H := ClientHeight;
48          ResizeToFont(FontSize, W, H);
49          ClientWidth  := W; pnlBase.Width  := W;
50          ClientHeight := H; pnlBase.Height := H;
51          with CollSampList do for i := Skip to Count-1 do with TCollSamp(Items[i]) do
52            begin
53              x := IntToStr(CollSampID) + '^' + CollSampName;
54              if Length(TubeColor) <> 0 then x := x + ' (' + TubeColor + ')';
55              cboOtherCollSamp.Items.Add(x) ;
56            end;
57          ShowModal;
58          Result := FOtherCollSamp;
59        end;
60      finally
61        frmODLabOthCollSamp.Release;
62      end;
63    end;
64    
65    procedure TfrmODLabOthCollSamp.cmdCancelClick(Sender: TObject);
66    begin
67      FOtherCollSamp := '-1'  ;
68      Close;
69    end;
70    
71    procedure TfrmODLabOthCollSamp.cmdOKClick(Sender: TObject);
72    begin
73      if cboOtherCollSamp.ItemIEN = 0 then
74       begin
75        InfoBox(TX_NOCOLLSAMP_TEXT, TX_NOCOLLSAMP_CAP, MB_OK or MB_ICONWARNING);
76        Exit;
77       end;
78      if cboOtherCollSamp.ItemIEN > 0 then
79         FOtherCollSamp := cboOtherCollSamp.Items[cboOtherCollSamp.ItemIndex]
80      else
81         FOtherCollSamp := '-1'  ;
82      Close;
83    end;
84    
85    procedure TfrmODLabOthCollSamp.cboOtherCollSampDblClick(Sender: TObject);
86    begin
87      cmdOKClick(Self);
88    end;
89    
90    end.

Module Calls (2 levels)


fODLabOthCollSamp
 ├fBase508Form
 │ ├uConst
 │ └uHelpManager
 └fODLab
   ├fODBase
   ├uConst
   ├rODBase
   ├rODLab
   ├uCore
   ├rCore
   ├fODLabOthCollSamp...
   ├fODLabOthSpec
   ├fODLabImmedColl
   ├fLabCollTimes
   ├rOrders
   ├fRptBox
   └fFrame

Module Called-By (2 levels)


       fODLabOthCollSamp
                fODLab┤ 
             uOrders┤ │ 
fODLabOthCollSamp...┘ │ 
              fODBBank┘ 
          uOrders...┘