mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-23 09:23:06 +02:00
69 lines
1.2 KiB
ObjectPascal
69 lines
1.2 KiB
ObjectPascal
unit GotoFrm;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
|
|
StdCtrls, ExtCtrls, Buttons, LazarusIDEStrConsts, LCLType;
|
|
|
|
type
|
|
|
|
{ TfrmGoto }
|
|
|
|
TfrmGoto = class(TForm)
|
|
Label1: TLabel;
|
|
Edit1: TEdit;
|
|
btnOK: TBitbtn;
|
|
btnCancel: TBitBtn;
|
|
procedure Edit1KeyDown(Sender: TObject; var Key:Word; Shift:TShiftState);
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
procedure DoShow; override;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{ TfrmGoto }
|
|
|
|
constructor TfrmGoto.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
|
|
Caption := lisMenuGotoLine;
|
|
Label1.Caption := lisUEGotoLine;
|
|
Edit1.Caption := '';
|
|
|
|
btnOK.LoadGlyphFromLazarusResource('btn_ok');
|
|
btnCancel.LoadGlyphFromLazarusResource('btn_cancel');
|
|
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
|
|
begin
|
|
ModalResult:=mrOk;
|
|
Key := 0;
|
|
end;
|
|
if (Key=VK_ESCAPE) then
|
|
begin
|
|
ModalResult:=mrCancel;
|
|
Key := 0;
|
|
end;
|
|
end;
|
|
|
|
initialization
|
|
{$I gotofrm.lrs}
|
|
|
|
end.
|
|
|