source: cprs/branches/tmg-cprs/CPRS-Chart/fNoteST.pas@ 454

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

Initial upload of TMG-CPRS 1.0.26.69

File size: 3.6 KB
RevLine 
[453]1//kt -- Modified with SourceScanner on 7/24/2007
2unit fNoteST;
3{
4Text Search CQ: HDS00002856
5This Unit Contains the Dialog Used to Capture the Text that will be
6searched for in the current notes view.
7}
8
9interface
10
11uses
12 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
13 ExtCtrls, ORCtrls, StdCtrls, ORFn, uTIU, fAutoSz, DKLang;
14
15type
16 TfrmNotesSearchText = class(TfrmAutoSz)
17 lblSearchInfo: TLabel;
18 edtSearchText: TEdit;
19 lblAuthor: TLabel;
20 cmdOK: TButton;
21 cmdCancel: TButton;
22 DKLanguageController1: TDKLanguageController;
23 procedure cmdCancelClick(Sender: TObject);
24 procedure cmdOKClick(Sender: TObject);
25 procedure FormShow(Sender: TObject);
26 procedure FormDestroy(Sender: TObject);
27 procedure FormResize(Sender: TObject);
28 private
29 //kt Begin Mod (change Consts to Vars) 7/24/2007
30 TX_SEARCH_TEXT : string; //kt
31 TX_SEARCH_CAP : string; //kt
32 //kt End Mod -------------------
33 FChanged: Boolean;
34 FSearchString: string;
35 procedure SetupVars; //kt
36 end;
37
38 TSearchContext = record
39 Changed: Boolean;
40 SearchString: string;
41 end;
42
43procedure SelectSearchText(FontSize: Integer; var SearchText: String; var SearchContext: TSearchContext);
44
45implementation
46
47{$R *.DFM}
48
49uses rTIU, rCore, uCore, rMisc;
50
51//const
52//TX_SEARCH_TEXT = 'Select a search string or press Cancel.'; <-- original line. //kt 7/24/2007
53//TX_SEARCH_CAP = 'Missing search string'; <-- original line. //kt 7/24/2007
54
55procedure TfrmNotesSearchText.SetupVars;
56//kt Added entire function to replace constant declarations 7/24/2007
57begin
58 TX_SEARCH_TEXT := DKLangConstW('fNoteST_Select_a_search_string_or_press_Cancelx');
59 TX_SEARCH_CAP := DKLangConstW('fNoteST_Missing_search_string');
60end;
61
62procedure SelectSearchText(FontSize: Integer; var SearchText: String; var SearchContext: TSearchContext);
63{ displays author select form for progress notes and returns a record of the selection }
64var
65 frmNotesSearchText: TfrmNotesSearchText;
66 W, H: integer;
67// CurrentAuthor: Int64;
68begin
69 frmNotesSearchText := TfrmNotesSearchText.Create(Application);
70 try
71 with frmNotesSearchText do
72 begin
73 edtSearchText.Text:=SearchText;
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 Show;
82 edtSearchText.SetFocus;
83 Hide;
84 ShowModal;
85 If edtSearchText.Text<>'' then
86 with SearchContext do
87 begin
88 Changed := FChanged;
89 SearchString := FSearchString;
90 end; {with SearchContext}
91 end; {with frmNotesSearchText}
92 finally
93 frmNotesSearchText.Release;
94 end;
95end;
96
97procedure TfrmNotesSearchText.cmdCancelClick(Sender: TObject);
98begin
99 FChanged:=False;
100 Close;
101end;
102
103procedure TfrmNotesSearchText.cmdOKClick(Sender: TObject);
104begin
105 SetupVars; //kt added 7/24/2007 to replace constants with vars.
106 if edtSearchText.Text = '' then
107 begin
108 InfoBox(TX_SEARCH_TEXT, TX_SEARCH_CAP, MB_OK or MB_ICONWARNING);
109 Exit;
110 end;
111 FChanged := True;
112 FSearchString := edtSearchText.Text;
113 Close;
114end;
115
116procedure TfrmNotesSearchText.FormShow(Sender: TObject);
117begin
118 SetFormPosition(Self);
119end;
120
121procedure TfrmNotesSearchText.FormDestroy(Sender: TObject);
122begin
123 SaveUserBounds(Self);
124end;
125
126procedure TfrmNotesSearchText.FormResize(Sender: TObject);
127begin
128 inherited;
129 lblSearchInfo.Width := edtSearchText.Width;
130end;
131
132end.
Note: See TracBrowser for help on using the repository browser.