Procedure
Module
PsForm
Last Modified
2007-05-17 15:55:36
Visibility
Public/Published
Owner
TPSMainForm
Declaration
procedure CmdSearchClick(Sender: TObject);
Calls Hierarchy
TPSMainForm.CmdSearchClick
├TPSMainForm.GeneralSearch
│ ├TPatternSearcher.Create
│ └TPatternSearcher.Search
│ ├TPatternSearcher.SearchWithPos
│ └TPatternSearcher.SearchWithUC
└TPSMainForm.UpdateStatus
Calls
Source
116 procedure TPSMainForm.CmdSearchClick(Sender: TObject);
117 var
118 Idx : integer;
119 S : string;
120 begin
121 Screen.Cursor := crHourGlass;
122
123 try
124 S := cmbPattern.Text;
125 Idx := cmbPattern.Items.IndexOf(S);
126
127 if Idx <> -1 then // existing item modified
128 cmbPattern.Items[Idx] := S
129 else
130 begin // new item added
131 cmbPattern.Items.Add(S);
132 Idx := cmbPattern.Items.Count-1;
133 end;
134
135 cmbPattern.Text := S;
136 cmbPattern.ItemIndex := Idx;
137
138 if chkClearResults.Checked then
139 Memo.Clear;
140
141 SF := [];
142
143 if chkAllFiles.Checked then
144 SF := [sfAll]
145 else
146 begin
147 if chkOnlyInc.Checked then
148 Include(SF, sfOnlyInc);
149
150 if chkOnlyWeb.Checked then
151 Include(SF, sfOnlyWeb);
152
153 if chkOnlySql.Checked then
154 Include(SF, sfOnlySql);
155
156 if chkOnlyDelphi.Checked then
157 Include(SF, sfOnlyDelphi);
158
159 if chkOnlyVB.Checked then
160 Include(SF, sfOnlyVB);
161
162 if chkOnlyTxt.Checked then
163 Include(SF, sfOnlyTxt);
164 end;
165
166 CmdSearch.Enabled := false;
167 CmdSave.Enabled := false;
168 CmdStop.Enabled := true;
169 CmdQuit.Enabled := false;
170
171 PsEngine.gStopped := false;
172 Analyzing := true;
173
174 GeneralSearch;
175
176 Memo.SetFocus;
177 UpdateStatus;
178
179 finally
180 Analyzing := false;
181 CmdSearch.Enabled := true;
182 CmdStop.Enabled := false;
183 CmdQuit.Enabled := true;
184
185 UpdateStatus;
186 Screen.Cursor := crDefault;
187 end;
188 end;