1 | unit fODRadImType;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
---|
6 | Buttons, ORCtrls, ORfn, ExtCtrls, fBase508Form, VA508AccessibilityManager;
|
---|
7 |
|
---|
8 | type
|
---|
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 |
|
---|
23 | procedure SelectImagingType(FontSize: Integer; var ImagingType: string) ;
|
---|
24 |
|
---|
25 | implementation
|
---|
26 |
|
---|
27 | {$R *.DFM}
|
---|
28 |
|
---|
29 | uses rODRad, rCore, uCore;
|
---|
30 |
|
---|
31 | const
|
---|
32 | TX_RAD_TEXT = 'Select imaging type or press Cancel.';
|
---|
33 | TX_RAD_CAP = 'No imaging type Selected';
|
---|
34 |
|
---|
35 | procedure SelectImagingType(FontSize: Integer; var ImagingType: string) ;
|
---|
36 | { displays imaging type selection form and returns a record of the selection }
|
---|
37 | var
|
---|
38 | frmODRadImType: TfrmODRadImType;
|
---|
39 | W, H: Integer;
|
---|
40 | begin
|
---|
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;
|
---|
62 | end;
|
---|
63 |
|
---|
64 | procedure TfrmODRadImType.cmdCancelClick(Sender: TObject);
|
---|
65 | begin
|
---|
66 | FImagingType := '-1';
|
---|
67 | Close;
|
---|
68 | end;
|
---|
69 |
|
---|
70 | procedure TfrmODRadImType.cmdOKClick(Sender: TObject);
|
---|
71 | begin
|
---|
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 ;
|
---|
85 | end;
|
---|
86 |
|
---|
87 | procedure TfrmODRadImType.cboImTypeDblClick(Sender: TObject);
|
---|
88 | begin
|
---|
89 | cmdOKClick(Self);
|
---|
90 | end;
|
---|
91 |
|
---|
92 | end.
|
---|