source: cprs/branches/tmg-cprs/CPRS-Chart/fNoteBA.pas@ 1806

Last change on this file since 1806 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 3.8 KB
Line 
1//kt -- Modified with SourceScanner on 7/19/2007
2unit fNoteBA;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 ExtCtrls, ORCtrls, StdCtrls, ORFn, uTIU, DKLang;
9
10type
11 TfrmNotesByAuthor = class(TForm)
12 pnlBase: TORAutoPanel;
13 lblAuthor: TLabel;
14 radSort: TRadioGroup;
15 cboAuthor: TORComboBox;
16 cmdOK: TButton;
17 cmdCancel: TButton;
18 DKLanguageController1: TDKLanguageController;
19 procedure cboAuthorNeedData(Sender: TObject; const StartFrom: string;
20 Direction, InsertAt: Integer);
21 procedure cmdCancelClick(Sender: TObject);
22 procedure cmdOKClick(Sender: TObject);
23 private
24 //kt Begin Mod (change Consts to Vars) 7/19/2007
25 TX_AUTH_TEXT : string; //kt
26 TX_AUTH_CAP : string; //kt
27 //kt End Mod -------------------
28 FChanged: Boolean;
29 FAuthor: Int64;
30 FAuthorName: string;
31 FAscending: Boolean;
32 procedure SetupVars; //kt
33 end;
34
35 TAuthorContext = record
36 Changed: Boolean;
37 Author: Int64;
38 AuthorName: string;
39 Ascending: Boolean;
40 end;
41
42procedure SelectAuthor(FontSize: Integer; CurrentContext: TTIUContext; var AuthorContext: TAuthorContext);
43
44implementation
45
46{$R *.DFM}
47
48uses rTIU, rCore, uCore;
49
50//const
51//TX_AUTH_TEXT = 'Select a progress note author or press Cancel.'; <-- original line. //kt 7/19/2007
52//TX_AUTH_CAP = 'Missing Author'; <-- original line. //kt 7/19/2007
53
54
55
56procedure TfrmNotesByAuthor.SetupVars;
57//kt Added entire function to replace constant declarations 7/19/2007
58begin
59 TX_AUTH_TEXT := DKLangConstW('fNoteBA_Select_a_progress_note_author_or_press_Cancelx');
60 TX_AUTH_CAP := DKLangConstW('fNoteBA_Missing_Author');
61end;
62
63procedure SelectAuthor(FontSize: Integer; CurrentContext: TTIUContext; var AuthorContext: TAuthorContext);
64{ displays author select form for progress notes and returns a record of the selection }
65var
66 frmNotesByAuthor: TfrmNotesByAuthor;
67 W, H: integer;
68 CurrentAuthor: Int64;
69begin
70 frmNotesByAuthor := TfrmNotesByAuthor.Create(Application);
71 try
72 with frmNotesByAuthor do
73 begin
74 Font.Size := FontSize;
75 W := ClientWidth;
76 H := ClientHeight;
77 ResizeToFont(FontSize, W, H);
78 ClientWidth := W; pnlBase.Width := W;
79 ClientHeight := H; pnlBase.Height := W;
80 FChanged := False;
81 CurrentAuthor := CurrentContext.Author;
82 with cboAuthor do
83 if CurrentAuthor > 0 then
84 begin
85 InitLongList(ExternalName(CurrentAuthor, 200));
86 SelectByIEN(CurrentAuthor);
87 end
88 else
89 begin
90 InitLongList(User.Name);
91 SelectByIEN(User.DUZ);
92 end;
93 FAscending := CurrentContext.TreeAscending;
94 with radSort do if FAscending then ItemIndex := 0 else ItemIndex := 1;
95 ShowModal;
96 with AuthorContext do
97 begin
98 Changed := FChanged;
99 Author := FAuthor;
100 AuthorName := FAuthorName;
101 Ascending := FAscending;
102 end; {with AuthorContext}
103 end; {with frmNotesByAuthor}
104 finally
105 frmNotesByAuthor.Release;
106 end;
107end;
108
109procedure TfrmNotesByAuthor.cboAuthorNeedData(Sender: TObject; const StartFrom: string;
110 Direction, InsertAt: Integer);
111begin
112 cboAuthor.ForDataUse(SubSetOfActiveAndInactivePersons(StartFrom, Direction));
113end;
114
115procedure TfrmNotesByAuthor.cmdCancelClick(Sender: TObject);
116begin
117 Close;
118end;
119
120procedure TfrmNotesByAuthor.cmdOKClick(Sender: TObject);
121begin
122 SetupVars; //kt added 7/19/2007 to replace constants with vars.
123 if cboAuthor.ItemIEN = 0 then
124 begin
125 InfoBox(TX_AUTH_TEXT, TX_AUTH_CAP, MB_OK or MB_ICONWARNING);
126 Exit;
127 end;
128 FChanged := True;
129 FAuthor := cboAuthor.ItemIEN;
130 FAuthorName := cboAuthor.DisplayText[cboAuthor.ItemIndex];
131 FAscending := radSort.ItemIndex = 0;
132 Close;
133end;
134
135end.
Note: See TracBrowser for help on using the repository browser.