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 -
This commit is contained in:
vincents 2007-10-15 11:25:12 +00:00
parent 19df9e9b0f
commit b045ebb09a

View File

@ -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 }