source: cprs/trunk/CPRS-Chart/Orders/fODLabOthSpec.pas

Last change on this file was 829, checked in by Kevin Toppenberg, 14 years ago

Upgrade to version 27

File size: 2.5 KB
Line 
1unit fODLabOthSpec;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 ExtCtrls, ORCtrls, StdCtrls, ORFn, fBase508Form, VA508AccessibilityManager;
8
9type
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
24function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ;
25
26implementation
27
28{$R *.DFM}
29
30uses fODLab, rODLab;
31
32const
33 TX_NOSPEC_TEXT = 'Select a specimen or press Cancel.';
34 TX_NOSPEC_CAP = 'Missing Specimen';
35
36function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ;
37{ displays collection sample select form for lab and returns a record of the selection }
38var
39 frmODLabOthSpec: TfrmODLabOthSpec;
40 W, H: Integer;
41begin
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;
64end;
65
66procedure TfrmODLabOthSpec.cmdCancelClick(Sender: TObject);
67begin
68 FOtherSpec := '-1' ;
69 Close;
70end;
71
72procedure TfrmODLabOthSpec.cmdOKClick(Sender: TObject);
73begin
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;
84end;
85
86procedure TfrmODLabOthSpec.cboOtherSpecDblClick(Sender: TObject);
87begin
88 cmdOKClick(Self);
89end;
90
91procedure TfrmODLabOthSpec.cboOtherSpecNeedData(Sender: TObject;
92 const StartFrom: string; Direction, InsertAt: Integer);
93begin
94 inherited;
95 cboOtherSpec.ForDataUse(SubsetOfSpecimens(StartFrom, Direction));
96end;
97
98end.
Note: See TracBrowser for help on using the repository browser.