| [459] | 1 | unit fLabInfo; | 
|---|
|  | 2 |  | 
|---|
|  | 3 | interface | 
|---|
|  | 4 |  | 
|---|
|  | 5 | uses | 
|---|
|  | 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, | 
|---|
|  | 7 | StdCtrls, ExtCtrls, fAutoSz, ORFn, ORCtrls; | 
|---|
|  | 8 |  | 
|---|
|  | 9 | type | 
|---|
|  | 10 | TfrmLabInfo = class(TfrmAutoSz) | 
|---|
|  | 11 | Panel1: TPanel; | 
|---|
|  | 12 | btnOK: TButton; | 
|---|
|  | 13 | memInfo: TCaptionMemo; | 
|---|
|  | 14 | cboTests: TORComboBox; | 
|---|
|  | 15 | procedure btnOKClick(Sender: TObject); | 
|---|
|  | 16 | procedure FormCreate(Sender: TObject); | 
|---|
|  | 17 | procedure cboTestsNeedData(Sender: TObject; const StartFrom: string; | 
|---|
|  | 18 | Direction, InsertAt: Integer); | 
|---|
|  | 19 | procedure cboTestsClick(Sender: TObject); | 
|---|
|  | 20 | private | 
|---|
|  | 21 | { Private declarations } | 
|---|
|  | 22 | OKPressed: Boolean; | 
|---|
|  | 23 | public | 
|---|
|  | 24 | { Public declarations } | 
|---|
|  | 25 | end; | 
|---|
|  | 26 |  | 
|---|
|  | 27 | var | 
|---|
|  | 28 | frmLabInfo: TfrmLabInfo; | 
|---|
|  | 29 | function ExecuteLabInfo: Boolean; | 
|---|
|  | 30 |  | 
|---|
|  | 31 | implementation | 
|---|
|  | 32 |  | 
|---|
|  | 33 | uses fLabs, rLabs; | 
|---|
|  | 34 |  | 
|---|
|  | 35 | {$R *.DFM} | 
|---|
|  | 36 |  | 
|---|
|  | 37 | function ExecuteLabInfo: Boolean; | 
|---|
|  | 38 | begin | 
|---|
|  | 39 | Result := False; | 
|---|
|  | 40 | frmLabInfo := TfrmLabInfo.Create(Application); | 
|---|
|  | 41 | try | 
|---|
|  | 42 | ResizeFormToFont(TForm(frmLabInfo)); | 
|---|
|  | 43 | frmLabInfo.ShowModal; | 
|---|
|  | 44 | if frmLabInfo.OKPressed then | 
|---|
|  | 45 | Result := True; | 
|---|
|  | 46 | finally | 
|---|
|  | 47 | frmLabInfo.Release; | 
|---|
|  | 48 | end; | 
|---|
|  | 49 | end; | 
|---|
|  | 50 |  | 
|---|
|  | 51 | procedure TfrmLabInfo.btnOKClick(Sender: TObject); | 
|---|
|  | 52 | begin | 
|---|
|  | 53 | OKPressed := true; | 
|---|
|  | 54 | Close; | 
|---|
|  | 55 | end; | 
|---|
|  | 56 |  | 
|---|
|  | 57 | procedure TfrmLabInfo.FormCreate(Sender: TObject); | 
|---|
|  | 58 |  | 
|---|
|  | 59 | begin | 
|---|
|  | 60 | RedrawSuspend(cboTests.Handle); | 
|---|
|  | 61 | cboTests.InitLongList(''); | 
|---|
|  | 62 | RedrawActivate(cboTests.Handle); | 
|---|
|  | 63 | end; | 
|---|
|  | 64 |  | 
|---|
|  | 65 | procedure TfrmLabInfo.cboTestsNeedData(Sender: TObject; | 
|---|
|  | 66 | const StartFrom: string; Direction, InsertAt: Integer); | 
|---|
|  | 67 | begin | 
|---|
|  | 68 | cboTests.ForDataUse(AllTests(StartFrom, Direction)); | 
|---|
|  | 69 | end; | 
|---|
|  | 70 |  | 
|---|
|  | 71 | procedure TfrmLabInfo.cboTestsClick(Sender: TObject); | 
|---|
|  | 72 | begin | 
|---|
|  | 73 | inherited; | 
|---|
|  | 74 | memInfo.Lines.Assign(TestInfo(cboTests.Items[cboTests.ItemIndex])); | 
|---|
|  | 75 | end; | 
|---|
|  | 76 |  | 
|---|
|  | 77 | end. | 
|---|