source: cprs/trunk/CPRS-Chart/fLkUpLocation.pas@ 872

Last change on this file since 872 was 830, checked in by Kevin Toppenberg, 14 years ago

Upgrading to version 27

File size: 2.2 KB
Line 
1unit fLkUpLocation;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 fAutoSz, StdCtrls, ORCtrls, ORFn, VA508AccessibilityManager;
8
9type
10 TfrmLkUpLocation = class(TfrmAutoSz)
11 lblInfo: TLabel;
12 cboLocation: TORComboBox;
13 lblLocation: TLabel;
14 cmdOK: TButton;
15 cmdCancel: TButton;
16 procedure cmdCancelClick(Sender: TObject);
17 procedure FormCreate(Sender: TObject);
18 procedure cmdOKClick(Sender: TObject);
19 procedure cboLocationNeedData(Sender: TObject; const StartFrom: String;
20 Direction, InsertAt: Integer);
21 private
22 OKPressed: Boolean;
23 end;
24
25var
26 LocType: integer;
27
28
29procedure LookupLocation(var IEN: Integer; var AName: string; const AType: integer; const HelpInfo: string);
30
31implementation
32
33{$R *.DFM}
34
35uses rCore, uConst;
36
37procedure LookupLocation(var IEN: Integer; var AName: string; const AType: integer; const HelpInfo: string);
38var
39 frmLkUpLocation: TfrmLkUpLocation;
40begin
41 LocType := AType;
42 frmLkUpLocation := TfrmLkUpLocation.Create(Application);
43 try
44 ResizeFormToFont(TForm(frmLkUpLocation));
45 frmLkUpLocation.lblInfo.Caption := HelpInfo;
46 frmLkUpLocation.ShowModal;
47 IEN := 0;
48 AName := '';
49 if frmLkUpLocation.OKPressed then
50 begin
51 IEN := frmLkUpLocation.cboLocation.ItemIEN;
52 AName := frmLkUpLocation.cboLocation.Text;
53 end;
54 finally
55 frmLkUpLocation.Release;
56 end;
57end;
58
59procedure TfrmLkUpLocation.FormCreate(Sender: TObject);
60begin
61 inherited;
62 OKPressed := False;
63 cboLocation.InitLongList('');
64end;
65
66procedure TfrmLkUpLocation.cboLocationNeedData(Sender: TObject; const StartFrom: string;
67 Direction, InsertAt: Integer);
68begin
69 inherited;
70 case LocType of
71 LOC_ALL: cboLocation.ForDataUse(SubSetOfLocations(StartFrom, Direction));
72 LOC_OUTP: cboLocation.ForDataUse(SubSetOfClinics(StartFrom, Direction));
73 LOC_INP: cboLocation.ForDataUse(SubSetOfInpatientLocations(StartFrom, Direction));
74 end;
75
76end;
77
78procedure TfrmLkUpLocation.cmdOKClick(Sender: TObject);
79begin
80 inherited;
81 OKPressed := True;
82 Close;
83end;
84
85procedure TfrmLkUpLocation.cmdCancelClick(Sender: TObject);
86begin
87 inherited;
88 Close;
89end;
90
91end.
Note: See TracBrowser for help on using the repository browser.