[453] | 1 | //kt -- Modified with SourceScanner on 8/8/2007
|
---|
| 2 | unit fODRadImType;
|
---|
| 3 |
|
---|
| 4 | interface
|
---|
| 5 |
|
---|
| 6 | uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
|
---|
| 7 | Buttons, ORCtrls, ORfn, ExtCtrls, DKLang;
|
---|
| 8 |
|
---|
| 9 | type
|
---|
| 10 | TfrmODRadImType = class(TForm)
|
---|
| 11 | cmdOK: TButton;
|
---|
| 12 | cmdCancel: TButton;
|
---|
| 13 | cboImType: TORComboBox;
|
---|
| 14 | SrcLabel: TLabel;
|
---|
| 15 | pnlBase: TORAutoPanel;
|
---|
| 16 | DKLanguageController1: TDKLanguageController;
|
---|
| 17 | procedure cmdOKClick(Sender: TObject);
|
---|
| 18 | procedure cmdCancelClick(Sender: TObject);
|
---|
| 19 | procedure cboImTypeDblClick(Sender: TObject);
|
---|
| 20 | private
|
---|
| 21 | FImagingType: string ;
|
---|
| 22 | FChanged: Boolean;
|
---|
| 23 | end;
|
---|
| 24 |
|
---|
| 25 | procedure SelectImagingType(FontSize: Integer; var ImagingType: string) ;
|
---|
| 26 |
|
---|
| 27 | implementation
|
---|
| 28 |
|
---|
| 29 | {$R *.DFM}
|
---|
| 30 |
|
---|
| 31 | uses rODRad, rCore, uCore;
|
---|
| 32 |
|
---|
| 33 | //const
|
---|
| 34 | //TX_RAD_TEXT = 'Select imaging type or press Cancel.'; <-- original line. //kt 8/8/2007
|
---|
| 35 | //TX_RAD_CAP = 'No imaging type Selected'; <-- original line. //kt 8/8/2007
|
---|
| 36 |
|
---|
| 37 | var
|
---|
| 38 | TX_RAD_TEXT : string; //kt
|
---|
| 39 | TX_RAD_CAP : string; //kt
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 | procedure SetupVars;
|
---|
| 43 | //kt Added entire function to replace constant declarations 8/8/2007
|
---|
| 44 | begin
|
---|
| 45 | TX_RAD_TEXT := DKLangConstW('fODRadImType_Select_imaging_type_or_press_Cancelx');
|
---|
| 46 | TX_RAD_CAP := DKLangConstW('fODRadImType_No_imaging_type_Selected');
|
---|
| 47 | end;
|
---|
| 48 |
|
---|
| 49 | procedure SelectImagingType(FontSize: Integer; var ImagingType: string) ;
|
---|
| 50 | { displays imaging type selection form and returns a record of the selection }
|
---|
| 51 | var
|
---|
| 52 | frmODRadImType: TfrmODRadImType;
|
---|
| 53 | W, H: Integer;
|
---|
| 54 | begin
|
---|
| 55 | frmODRadImType := TfrmODRadImType.Create(Application);
|
---|
| 56 | try
|
---|
| 57 | with frmODRadImType 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 | FChanged := False;
|
---|
| 66 | cboImType.Items.Assign(SubsetOfImagingTypes);
|
---|
| 67 | if cboImType.Items.Count > 1 then
|
---|
| 68 | ShowModal
|
---|
| 69 | else
|
---|
| 70 | FImagingType := cboImType.Items[0] ;
|
---|
| 71 | ImagingType:= FImagingType ;
|
---|
| 72 | end; {with frmODRadImType}
|
---|
| 73 | finally
|
---|
| 74 | frmODRadImType.Release;
|
---|
| 75 | end;
|
---|
| 76 | end;
|
---|
| 77 |
|
---|
| 78 | procedure TfrmODRadImType.cmdCancelClick(Sender: TObject);
|
---|
| 79 | begin
|
---|
| 80 | FImagingType := '-1';
|
---|
| 81 | Close;
|
---|
| 82 | end;
|
---|
| 83 |
|
---|
| 84 | procedure TfrmODRadImType.cmdOKClick(Sender: TObject);
|
---|
| 85 | begin
|
---|
| 86 | SetupVars; //kt added 8/8/2007 to replace constants with vars.
|
---|
| 87 | with cboImType do
|
---|
| 88 | begin
|
---|
| 89 | if ItemIEN = 0 then
|
---|
| 90 | begin
|
---|
| 91 | InfoBox(TX_RAD_TEXT, TX_RAD_CAP, MB_OK or MB_ICONWARNING);
|
---|
| 92 | FChanged := False ;
|
---|
| 93 | FImagingType := '-1';
|
---|
| 94 | Exit;
|
---|
| 95 | end;
|
---|
| 96 | FChanged := True;
|
---|
| 97 | FImagingType := Items[ItemIndex];
|
---|
| 98 | Close;
|
---|
| 99 | end ;
|
---|
| 100 | end;
|
---|
| 101 |
|
---|
| 102 | procedure TfrmODRadImType.cboImTypeDblClick(Sender: TObject);
|
---|
| 103 | begin
|
---|
| 104 | cmdOKClick(Self);
|
---|
| 105 | end;
|
---|
| 106 |
|
---|
| 107 | end.
|
---|