| 1 | //kt -- Modified with SourceScanner on 8/25/2007 | 
|---|
| 2 | unit fPtCWAD; | 
|---|
| 3 |  | 
|---|
| 4 | interface | 
|---|
| 5 |  | 
|---|
| 6 | uses | 
|---|
| 7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, | 
|---|
| 8 | fAutoSz, ORCtrls, StdCtrls, ORFn, ExtCtrls, DKLang; | 
|---|
| 9 |  | 
|---|
| 10 | type | 
|---|
| 11 | TfrmPtCWAD = class(TfrmAutoSz) | 
|---|
| 12 | lstAllergies: TORListBox; | 
|---|
| 13 | lstNotes: TORListBox; | 
|---|
| 14 | lblNotes: TOROffsetLabel; | 
|---|
| 15 | pnlBottom: TPanel; | 
|---|
| 16 | btnClose: TButton; | 
|---|
| 17 | lblAllergies: TOROffsetLabel; | 
|---|
| 18 | procedure FormCreate(Sender: TObject); | 
|---|
| 19 | procedure lstAllergiesClick(Sender: TObject); | 
|---|
| 20 | procedure lstNotesClick(Sender: TObject); | 
|---|
| 21 | procedure FormKeyUp(Sender: TObject; var Key: Word; | 
|---|
| 22 | Shift: TShiftState); | 
|---|
| 23 | procedure btnCloseClick(Sender: TObject); | 
|---|
| 24 | private | 
|---|
| 25 | { Private declarations } | 
|---|
| 26 | public | 
|---|
| 27 | { Public declarations } | 
|---|
| 28 | end; | 
|---|
| 29 |  | 
|---|
| 30 | procedure ShowCWAD; | 
|---|
| 31 |  | 
|---|
| 32 | implementation | 
|---|
| 33 |  | 
|---|
| 34 | {$R *.DFM} | 
|---|
| 35 |  | 
|---|
| 36 | uses rCover, fRptBox, uCore, uConst, fAllgyBox, rODAllergy; | 
|---|
| 37 |  | 
|---|
| 38 | //const | 
|---|
| 39 | //TX_LST_ALLG = 'Searching for allergies...';  <-- original line.  //kt 8/25/2007 | 
|---|
| 40 | //TX_LST_POST = 'Searching for postings...';  <-- original line.  //kt 8/25/2007 | 
|---|
| 41 |  | 
|---|
| 42 | var | 
|---|
| 43 | TX_LST_ALLG  : string;  //kt | 
|---|
| 44 | TX_LST_POST  : string;  //kt | 
|---|
| 45 |  | 
|---|
| 46 |  | 
|---|
| 47 | procedure SetupVars; | 
|---|
| 48 | //kt Added entire function to replace constant declarations 8/25/2007 | 
|---|
| 49 | begin | 
|---|
| 50 | TX_LST_ALLG := DKLangConstW('fPtCWAD_Searching_for_allergiesxxx'); | 
|---|
| 51 | TX_LST_POST := DKLangConstW('fPtCWAD_Searching_for_postingsxxx'); | 
|---|
| 52 | end; | 
|---|
| 53 |  | 
|---|
| 54 | procedure ShowCWAD; | 
|---|
| 55 | { displays CWAD notices (future - allow updates of allergy info from here? } | 
|---|
| 56 | var | 
|---|
| 57 | frmPtCWAD: TfrmPtCWAD; | 
|---|
| 58 | begin | 
|---|
| 59 | frmPtCWAD := TfrmPtCWAD.Create(Application); | 
|---|
| 60 | try | 
|---|
| 61 | ResizeFormToFont(TForm(frmPtCWAD)); | 
|---|
| 62 | frmPtCWAD.ShowModal; | 
|---|
| 63 | finally | 
|---|
| 64 | frmPtCWAD.Release; | 
|---|
| 65 | end; | 
|---|
| 66 | end; | 
|---|
| 67 |  | 
|---|
| 68 |  | 
|---|
| 69 | procedure TfrmPtCWAD.FormCreate(Sender: TObject); | 
|---|
| 70 | var | 
|---|
| 71 | i: Integer; | 
|---|
| 72 | begin | 
|---|
| 73 | SetupVars;  //kt added 8/25/2007 to replace constants with vars. | 
|---|
| 74 | inherited; | 
|---|
| 75 | StatusText(TX_LST_ALLG); | 
|---|
| 76 | ListAllergies(lstAllergies.Items); | 
|---|
| 77 | StatusText(TX_LST_POST); | 
|---|
| 78 | ListPostings(lstNotes.Items); | 
|---|
| 79 | with lstNotes do for i := Items.Count - 1 downto 0 do | 
|---|
| 80 | if Items[i]='^Allergies^' then Items.Delete(i); | 
|---|
| 81 | StatusText(''); | 
|---|
| 82 | end; | 
|---|
| 83 |  | 
|---|
| 84 | procedure TfrmPtCWAD.lstAllergiesClick(Sender: TObject); | 
|---|
| 85 | begin | 
|---|
| 86 | inherited; | 
|---|
| 87 | with lstAllergies do | 
|---|
| 88 | if ItemIEN > 0 then | 
|---|
| 89 | begin | 
|---|
| 90 | { TODO -oRich V. -cART/Allergy : Allergy Box to update CWAD allergies list? } | 
|---|
| 91 | (*      if ARTPatchInstalled then | 
|---|
| 92 | AllergyBox(DetailAllergy(ItemIEN), DisplayText[ItemIndex], True, ItemIEN) | 
|---|
| 93 | else*) | 
|---|
| 94 | ReportBox(DetailAllergy(ItemIEN), DisplayText[ItemIndex], True); | 
|---|
| 95 | end; | 
|---|
| 96 | end; | 
|---|
| 97 |  | 
|---|
| 98 | procedure TfrmPtCWAD.lstNotesClick(Sender: TObject); | 
|---|
| 99 | begin | 
|---|
| 100 | inherited; | 
|---|
| 101 | with lstNotes do | 
|---|
| 102 | if ItemID <> '' then | 
|---|
| 103 | begin | 
|---|
| 104 | NotifyOtherApps(NAE_REPORT, 'TIU^' + lstNotes.ItemID); | 
|---|
| 105 | ReportBox(DetailPosting(ItemID), DisplayText[ItemIndex], True); | 
|---|
| 106 | end; | 
|---|
| 107 | end; | 
|---|
| 108 |  | 
|---|
| 109 | procedure TfrmPtCWAD.FormKeyUp(Sender: TObject; var Key: Word; | 
|---|
| 110 | Shift: TShiftState); | 
|---|
| 111 | begin | 
|---|
| 112 | inherited; | 
|---|
| 113 | if Key = VK_ESCAPE then | 
|---|
| 114 | begin | 
|---|
| 115 | Key := 0; | 
|---|
| 116 | Close; | 
|---|
| 117 | end; | 
|---|
| 118 | end; | 
|---|
| 119 |  | 
|---|
| 120 | procedure TfrmPtCWAD.btnCloseClick(Sender: TObject); | 
|---|
| 121 | begin | 
|---|
| 122 | inherited; | 
|---|
| 123 | Close; | 
|---|
| 124 | end; | 
|---|
| 125 |  | 
|---|
| 126 | end. | 
|---|