find, always set the focus on the text field

This commit is contained in:
Basile Burg 2016-12-21 00:32:03 +01:00
parent af5c39689f
commit 91c4e64078
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
1 changed files with 6 additions and 3 deletions

View File

@ -2392,18 +2392,21 @@ var
win: TAnchorDockHostSite; win: TAnchorDockHostSite;
str: string; str: string;
begin begin
if fDoc.isNil then
exit;
win := DockMaster.GetAnchorSite(fFindWidg); win := DockMaster.GetAnchorSite(fFindWidg);
if win.isNil then exit; if win.isNil then
exit;
win.Show; win.Show;
win.BringToFront; win.BringToFront;
if fDoc.isNil then exit;
//
if fDoc.SelAvail then if fDoc.SelAvail then
str := fDoc.SelText str := fDoc.SelText
else else
str := fDoc.Identifier; str := fDoc.Identifier;
ffindwidg.cbToFind.Text := str; ffindwidg.cbToFind.Text := str;
ffindwidg.cbToFindChange(nil); ffindwidg.cbToFindChange(nil);
ffindwidg.cbToFind.SetFocus;
end; end;
procedure TCEMainForm.actEdFindNextExecute(Sender: TObject); procedure TCEMainForm.actEdFindNextExecute(Sender: TObject);