加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
editscriptform.pas 2.25 KB
一键复制 编辑 原始数据 按行查看 历史
JiangXiaoDong 提交于 2021-10-07 11:36 . init
unit editscriptform;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, SynEdit, SynHighlighterJScript, Forms, Controls,
Graphics, Dialogs, StdCtrls, ExtCtrls, nkTitleBar, nkResizer, BCLabel,
BCButton;
type
{ TfrmEditScript }
TfrmEditScript = class(TForm)
BCButton2: TBCButton;
BCLabel1: TBCLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
nkResizer1: TnkResizer;
nkTitleBar1: TnkTitleBar;
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
SynEdit1: TSynEdit;
SynJScriptSyn1: TSynJScriptSyn;
procedure BCButton2Click(Sender: TObject);
procedure BCLabel1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
procedure FormShow(Sender: TObject);
procedure SynEdit1Change(Sender: TObject);
procedure SynEdit1ChangeUpdating(ASender: TObject; AnUpdating: Boolean);
private
public
end;
var
frmEditScript: TfrmEditScript;
implementation
{$R *.frm}
{ TfrmEditScript }
procedure TfrmEditScript.BCLabel1Click(Sender: TObject);
begin
ModalResult:=mrCancel;
end;
procedure TfrmEditScript.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin
if ModalResult=mrOK then
begin
if Trim(ComboBox2.Text)='' then
begin
ComboBox2.Text:='其他';
end;
if Trim(Edit1.Text)='' then
begin
MessageDlg('请输入该例程的简要名称或描述。',mtWarning,[mbOK],0);
Edit1.SetFocus;
CanClose:=False;
Exit;
end;
if Trim(Edit2.Text)='' then
begin
MessageDlg('请输入完整的触发地址。',mtWarning,[mbOK],0);
Edit2.SetFocus;
CanClose:=False;
Exit;
end;
end;
end;
procedure TfrmEditScript.BCButton2Click(Sender: TObject);
begin
ModalResult:=mrOK;
end;
procedure TfrmEditScript.FormShow(Sender: TObject);
begin
SynEdit1.SetFocus;
end;
procedure TfrmEditScript.SynEdit1Change(Sender: TObject);
begin
end;
procedure TfrmEditScript.SynEdit1ChangeUpdating(ASender: TObject;
AnUpdating: Boolean);
begin
Label6.Caption:='行:'+inttostr(SynEdit1.CaretY)+' 列:'+inttostr(SynEdit1.CaretX);
end;
end.
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化