Module

fODLabOthSpec

Path

C:\CPRS\CPRS30\Orders\fODLabOthSpec.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
TfrmODLabOthSpec -

Procedures

Name Owner Declaration Scope Comments
cboOtherSpecDblClick TfrmODLabOthSpec procedure cboOtherSpecDblClick(Sender: TObject); Public/Published -
cboOtherSpecNeedData TfrmODLabOthSpec procedure cboOtherSpecNeedData(Sender: TObject; const StartFrom: String; Direction, InsertAt: Integer); Public/Published -
cmdCancelClick TfrmODLabOthSpec procedure cmdCancelClick(Sender: TObject); Public/Published -
cmdOKClick TfrmODLabOthSpec procedure cmdOKClick(Sender: TObject); Public/Published -

Functions

Name Owner Declaration Scope Comments
SelectOtherSpecimen - function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ; Interfaced Displays collection sample select form for lab and returns a record of the selection

Constants

Name Declaration Scope Comments
TX_NOSPEC_CAP 'Missing Specimen' Global -
TX_NOSPEC_TEXT 'Select a specimen or press Cancel.' Global -


Module Source

1     unit fODLabOthSpec;
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      TfrmODLabOthSpec = class(TfrmBase508Form)
11        pnlBase: TORAutoPanel;
12        cboOtherSpec: TORComboBox;
13        cmdOK: TButton;
14        cmdCancel: TButton;
15        procedure cmdCancelClick(Sender: TObject);
16        procedure cmdOKClick(Sender: TObject);
17        procedure cboOtherSpecDblClick(Sender: TObject);
18        procedure cboOtherSpecNeedData(Sender: TObject; const StartFrom: String;
19          Direction, InsertAt: Integer);
20      private
21        FOtherSpec: string;
22      end;
23    
24    function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ;
25    
26    implementation
27    
28    {$R *.DFM}
29    
30    uses fODLab, rODLab;
31    
32    const
33      TX_NOSPEC_TEXT = 'Select a specimen or press Cancel.';
34      TX_NOSPEC_CAP = 'Missing Specimen';
35    
36    function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ;
37    { displays collection sample select form for lab and returns a record of the selection }
38    var
39      frmODLabOthSpec: TfrmODLabOthSpec;
40      W, H: Integer;
41    begin
42      frmODLabOthSpec := TfrmODLabOthSpec.Create(Application);
43      try
44        with frmODLabOthSpec do
45        begin
46          Font.Size := FontSize;
47          W := ClientWidth;
48          H := ClientHeight;
49          ResizeToFont(FontSize, W, H);
50          ClientWidth  := W; pnlBase.Width  := W;
51          ClientHeight := H; pnlBase.Height := H;
52          with cboOtherSpec do
53            begin
54              {FastAssign(SpecimenList, MItems);
55              InsertSeparator; }
56              InitLongList('');
57            end;
58          ShowModal;
59          Result := FOtherSpec;
60        end;
61      finally
62        frmODLabOthSpec.Release;
63      end;
64    end;
65    
66    procedure TfrmODLabOthSpec.cmdCancelClick(Sender: TObject);
67    begin
68      FOtherSpec := '-1'  ;
69      Close;
70    end;
71    
72    procedure TfrmODLabOthSpec.cmdOKClick(Sender: TObject);
73    begin
74      if cboOtherSpec.ItemIEN = 0 then
75       begin
76        InfoBox(TX_NOSPEC_TEXT, TX_NOSPEC_CAP, MB_OK or MB_ICONWARNING);
77        Exit;
78       end;
79      if cboOtherSpec.ItemIEN > 0 then
80         FOtherSpec := cboOtherSpec.Items[cboOtherSpec.ItemIndex]
81      else
82         FOtherSpec := '-1'  ;
83      Close;
84    end;
85    
86    procedure TfrmODLabOthSpec.cboOtherSpecDblClick(Sender: TObject);
87    begin
88      cmdOKClick(Self);
89    end;
90    
91    procedure TfrmODLabOthSpec.cboOtherSpecNeedData(Sender: TObject;
92      const StartFrom: string; Direction, InsertAt: Integer);
93    begin
94      inherited;
95      cboOtherSpec.ForDataUse(SubsetOfSpecimens(StartFrom, Direction));
96    end;
97    
98    end.

Module Calls (2 levels)


fODLabOthSpec
 ├fBase508Form
 │ ├uConst
 │ └uHelpManager
 └rODLab
   └uCore

Module Called-By (2 levels)


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