source: cprs/branches/tmg-cprs/CPRS-Chart/Orders/fODLabOthCollSamp.pas@ 1156

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

Initial upload of TMG-CPRS 1.0.26.69

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