source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fODLabOthSpec.pas@ 895

Last change on this file since 895 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 3.0 KB
RevLine 
[453]1//kt -- Modified with SourceScanner on 8/8/2007
2unit fODLabOthSpec;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 ExtCtrls, ORCtrls, StdCtrls, ORFn, DKLang;
9
10type
11 TfrmODLabOthSpec = class(TForm)
12 pnlBase: TORAutoPanel;
13 cboOtherSpec: TORComboBox;
14 cmdOK: TButton;
15 cmdCancel: TButton;
16 DKLanguageController1: TDKLanguageController;
17 procedure cmdCancelClick(Sender: TObject);
18 procedure cmdOKClick(Sender: TObject);
19 procedure cboOtherSpecDblClick(Sender: TObject);
20 procedure cboOtherSpecNeedData(Sender: TObject; const StartFrom: String;
21 Direction, InsertAt: Integer);
22 private
23 FOtherSpec: string;
24 end;
25
26function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ;
27
28implementation
29
30{$R *.DFM}
31
32uses fODLab, rODLab;
33
34//const
35//TX_NOSPEC_TEXT = 'Select a specimen or press Cancel.'; <-- original line. //kt 8/8/2007
36//TX_NOSPEC_CAP = 'Missing Specimen'; <-- original line. //kt 8/8/2007
37
38var
39 TX_NOSPEC_TEXT : string; //kt
40 TX_NOSPEC_CAP : string; //kt
41
42
43procedure SetupVars;
44//kt Added entire function to replace constant declarations 8/8/2007
45begin
46 TX_NOSPEC_TEXT := DKLangConstW('fODLabOthSpec_Select_a_specimen_or_press_Cancelx');
47 TX_NOSPEC_CAP := DKLangConstW('fODLabOthSpec_Missing_Specimen');
48end;
49
50function SelectOtherSpecimen(FontSize: Integer; SpecimenList: TStringList): string ;
51{ displays collection sample select form for lab and returns a record of the selection }
52var
53 frmODLabOthSpec: TfrmODLabOthSpec;
54 W, H: Integer;
55begin
56 frmODLabOthSpec := TfrmODLabOthSpec.Create(Application);
57 try
58 with frmODLabOthSpec do
59 begin
60 Font.Size := FontSize;
61 W := ClientWidth;
62 H := ClientHeight;
63 ResizeToFont(FontSize, W, H);
64 ClientWidth := W; pnlBase.Width := W;
65 ClientHeight := H; pnlBase.Height := H;
66 with cboOtherSpec do
67 begin
68 {MItems.Assign(SpecimenList);
69 InsertSeparator; }
70 InitLongList('');
71 end;
72 ShowModal;
73 Result := FOtherSpec;
74 end;
75 finally
76 frmODLabOthSpec.Release;
77 end;
78end;
79
80procedure TfrmODLabOthSpec.cmdCancelClick(Sender: TObject);
81begin
82 FOtherSpec := '-1' ;
83 Close;
84end;
85
86procedure TfrmODLabOthSpec.cmdOKClick(Sender: TObject);
87begin
88 SetupVars; //kt added 8/8/2007 to replace constants with vars.
89 if cboOtherSpec.ItemIEN = 0 then
90 begin
91 InfoBox(TX_NOSPEC_TEXT, TX_NOSPEC_CAP, MB_OK or MB_ICONWARNING);
92 Exit;
93 end;
94 if cboOtherSpec.ItemIEN > 0 then
95 FOtherSpec := cboOtherSpec.Items[cboOtherSpec.ItemIndex]
96 else
97 FOtherSpec := '-1' ;
98 Close;
99end;
100
101procedure TfrmODLabOthSpec.cboOtherSpecDblClick(Sender: TObject);
102begin
103 cmdOKClick(Self);
104end;
105
106procedure TfrmODLabOthSpec.cboOtherSpecNeedData(Sender: TObject;
107 const StartFrom: string; Direction, InsertAt: Integer);
108begin
109 inherited;
110 cboOtherSpec.ForDataUse(SubsetOfSpecimens(StartFrom, Direction));
111end;
112
113end.
Note: See TracBrowser for help on using the repository browser.