mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:50:06 +02:00
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:
parent
19df9e9b0f
commit
b045ebb09a
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user