source: cprs/trunk/CPRS-Chart/Orders/fODRadImType.pas@ 1008

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

Upgrade to version 27

File size: 2.2 KB
Line 
1unit fODRadImType;
2
3interface
4
5uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
6 Buttons, ORCtrls, ORfn, ExtCtrls, fBase508Form, VA508AccessibilityManager;
7
8type
9 TfrmODRadImType = class(TfrmBase508Form)
10 cmdOK: TButton;
11 cmdCancel: TButton;
12 cboImType: TORComboBox;
13 SrcLabel: TLabel;
14 pnlBase: TORAutoPanel;
15 procedure cmdOKClick(Sender: TObject);
16 procedure cmdCancelClick(Sender: TObject);
17 procedure cboImTypeDblClick(Sender: TObject);
18 private
19 FImagingType: string ;
20 FChanged: Boolean;
21 end;
22
23procedure SelectImagingType(FontSize: Integer; var ImagingType: string) ;
24
25implementation
26
27{$R *.DFM}
28
29uses rODRad, rCore, uCore;
30
31const
32 TX_RAD_TEXT = 'Select imaging type or press Cancel.';
33 TX_RAD_CAP = 'No imaging type Selected';
34
35procedure SelectImagingType(FontSize: Integer; var ImagingType: string) ;
36{ displays imaging type selection form and returns a record of the selection }
37var
38 frmODRadImType: TfrmODRadImType;
39 W, H: Integer;
40begin
41 frmODRadImType := TfrmODRadImType.Create(Application);
42 try
43 with frmODRadImType do
44 begin
45 Font.Size := FontSize;
46 W := ClientWidth;
47 H := ClientHeight;
48 ResizeToFont(FontSize, W, H);
49 ClientWidth := W; pnlBase.Width := W;
50 ClientHeight := H; pnlBase.Height := H;
51 FChanged := False;
52 FastAssign(SubsetOfImagingTypes, cboImType.Items);
53 if cboImType.Items.Count > 1 then
54 ShowModal
55 else
56 FImagingType := cboImType.Items[0] ;
57 ImagingType:= FImagingType ;
58 end; {with frmODRadImType}
59 finally
60 frmODRadImType.Release;
61 end;
62end;
63
64procedure TfrmODRadImType.cmdCancelClick(Sender: TObject);
65begin
66 FImagingType := '-1';
67 Close;
68end;
69
70procedure TfrmODRadImType.cmdOKClick(Sender: TObject);
71begin
72 with cboImType do
73 begin
74 if ItemIEN = 0 then
75 begin
76 InfoBox(TX_RAD_TEXT, TX_RAD_CAP, MB_OK or MB_ICONWARNING);
77 FChanged := False ;
78 FImagingType := '-1';
79 Exit;
80 end;
81 FChanged := True;
82 FImagingType := Items[ItemIndex];
83 Close;
84 end ;
85end;
86
87procedure TfrmODRadImType.cboImTypeDblClick(Sender: TObject);
88begin
89 cmdOKClick(Self);
90end;
91
92end.
Note: See TracBrowser for help on using the repository browser.