source: cprs/branches/HealthSevak-CPRS/CPRS-Chart/fNoteST.pas@ 1727

Last change on this file since 1727 was 1693, checked in by healthsevak, 10 years ago

Committing the files for first time to this new branch

File size: 3.0 KB
Line 
1unit fNoteST;
2{
3Text Search CQ: HDS00002856
4This Unit Contains the Dialog Used to Capture the Text that will be
5searched for in the current notes view.
6}
7
8interface
9
10uses
11 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
12 ExtCtrls, ORCtrls, StdCtrls, ORFn, uTIU, fAutoSz, VA508AccessibilityManager;
13
14type
15 TfrmNotesSearchText = class(TfrmAutoSz)
16 lblSearchInfo: TLabel;
17 edtSearchText: TEdit;
18 lblAuthor: TLabel;
19 cmdOK: TButton;
20 cmdCancel: TButton;
21 procedure cmdCancelClick(Sender: TObject);
22 procedure cmdOKClick(Sender: TObject);
23 procedure FormShow(Sender: TObject);
24 procedure FormDestroy(Sender: TObject);
25 procedure FormResize(Sender: TObject);
26 private
27 FChanged: Boolean;
28 FSearchString: string;
29 end;
30
31 TSearchContext = record
32 Changed: Boolean;
33 SearchString: string;
34 end;
35
36procedure SelectSearchText(FontSize: Integer; var SearchText: String; var SearchContext: TSearchContext; FormCaption: String = 'List Signed Notes by Author');
37
38implementation
39
40{$R *.DFM}
41
42uses rTIU, rCore, uCore, rMisc;
43
44const
45 TX_SEARCH_TEXT = 'Select a search string or press Cancel.';
46 TX_SEARCH_CAP = 'Missing search string';
47
48procedure SelectSearchText(FontSize: Integer; var SearchText: String; var SearchContext: TSearchContext; FormCaption: String = 'List Signed Notes by Author');
49{ displays author select form for progress notes and returns a record of the selection }
50var
51 frmNotesSearchText: TfrmNotesSearchText;
52 W, H: integer;
53// CurrentAuthor: Int64;
54begin
55 frmNotesSearchText := TfrmNotesSearchText.Create(Application);
56 try
57 frmNotesSearchText.Caption := FormCaption;
58 with frmNotesSearchText do
59 begin
60 edtSearchText.Text:=SearchText;
61 Font.Size := FontSize;
62 W := ClientWidth;
63 H := ClientHeight;
64 ResizeToFont(FontSize, W, H);
65// ClientWidth := W; pnlBase.Width := W;
66// ClientHeight := H; pnlBase.Height := W;
67 FChanged := False;
68 Show;
69 edtSearchText.SetFocus;
70 Hide;
71 ShowModal;
72 If edtSearchText.Text<>'' then
73 with SearchContext do
74 begin
75 Changed := FChanged;
76 SearchString := FSearchString;
77 end; {with SearchContext}
78 end; {with frmNotesSearchText}
79 finally
80 frmNotesSearchText.Release;
81 end;
82end;
83
84procedure TfrmNotesSearchText.cmdCancelClick(Sender: TObject);
85begin
86 FChanged:=False;
87 Close;
88end;
89
90procedure TfrmNotesSearchText.cmdOKClick(Sender: TObject);
91begin
92 if edtSearchText.Text = '' then
93 begin
94 InfoBox(TX_SEARCH_TEXT, TX_SEARCH_CAP, MB_OK or MB_ICONWARNING);
95 Exit;
96 end;
97 FChanged := True;
98 FSearchString := edtSearchText.Text;
99 Close;
100end;
101
102procedure TfrmNotesSearchText.FormShow(Sender: TObject);
103begin
104 SetFormPosition(Self);
105end;
106
107procedure TfrmNotesSearchText.FormDestroy(Sender: TObject);
108begin
109 SaveUserBounds(Self);
110end;
111
112procedure TfrmNotesSearchText.FormResize(Sender: TObject);
113begin
114 inherited;
115 lblSearchInfo.Width := edtSearchText.Width;
116end;
117
118end.
Note: See TracBrowser for help on using the repository browser.