* May 18th, 2005: Starting to develop AMXX-Edit v2 as a kind of open source
This commit is contained in:
48
editor/editor2/UnitfrmGoToLine.pas
Executable file
48
editor/editor2/UnitfrmGoToLine.pas
Executable file
@ -0,0 +1,48 @@
|
||||
unit UnitfrmGoToLine;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
||||
StdCtrls, ExtCtrls, Forms, TFlatSpeedButtonUnit, TFlatEditUnit;
|
||||
|
||||
type
|
||||
TfrmGoToLine = class(TForm)
|
||||
lblInfo: TLabel;
|
||||
txtLine: TFlatEdit;
|
||||
cmdOK: TFlatSpeedButton;
|
||||
cmdCancel: TFlatSpeedButton;
|
||||
procedure cmdOKClick(Sender: TObject);
|
||||
procedure txtLineKeyPress(Sender: TObject; var Key: Char);
|
||||
end;
|
||||
|
||||
var
|
||||
frmGoToLine: TfrmGoToLine;
|
||||
|
||||
implementation
|
||||
|
||||
uses UnitfrmMain;
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
procedure TfrmGoToLine.cmdOKClick(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
if (StrToInt(txtLine.Text) < 0) or (StrToInt(txtLine.Text) > frmMain.sciEditor.Lines.Count) then
|
||||
raise Exception.Create('Invalid Line')
|
||||
else
|
||||
ModalResult := mrOK;
|
||||
except
|
||||
MessageBox(Handle, 'Invalid value. Check the entered line and press OK again.', 'Error', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmGoToLine.txtLineKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key = #13 then begin
|
||||
cmdOk.Click;
|
||||
Key := #0;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user