From b045ebb09a1655e38d8155bcb38ee18e9ecd4309 Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 15 Oct 2007 11:25:12 +0000 Subject: [PATCH] IDE: improved goto line dialog * focus editor after showing dialog (#9929) from Gerard Visent * focus editbox when showing the dialog * set key:=0 when handling enter and escape (prevents beep on windows) git-svn-id: trunk@12475 - --- ide/uniteditor.pp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ide/uniteditor.pp b/ide/uniteditor.pp index 200fd5d10a..bda5a28c9b 100644 --- a/ide/uniteditor.pp +++ b/ide/uniteditor.pp @@ -1065,6 +1065,7 @@ begin GotoDialog.SetBounds(NewLeft,NewTop,GotoDialog.Width,GotoDialog.Height); if (GotoDialog.ShowModal = mrOK) then GotoLine(StrToIntDef(GotoDialog.Edit1.Text,1)); + Self.FocusEditor; end; procedure TSourceEditor.GetDialogPosition(Width, Height:integer; @@ -6112,14 +6113,23 @@ end; procedure TfrmGoto.DoShow; begin Edit1.SelectAll; + Edit1.SetFocus; inherited DoShow; end; procedure TfrmGoto.Edit1KeyDown(Sender: TObject; var Key:Word; Shift:TShiftState); begin - if (Key=VK_RETURN) then ModalResult:=mrOk; - if (Key=VK_ESCAPE) then ModalResult:=mrCancel; + if (Key=VK_RETURN) then + begin + ModalResult:=mrOk; + Key := 0; + end; + if (Key=VK_ESCAPE) then + begin + ModalResult:=mrCancel; + Key := 0; + end; end; { TSynEditPlugin1 }