⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fscripteditor.pas

📁 Workflow Studio是一款专为商业进程管理(BPM)设计的Delphi VCL框架。通过Workflow Studio你可以轻易地将工作流与BPM功能添加到你的应用程序里。这样能使你或你的最
💻 PAS
字号:
unit fScriptEditor;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, wsClasses, StdCtrls, wsBlocks, wsScripter;

type
  TfmScriptEditor = class(TForm)
    PageControl1: TPageControl;
    tsScript: TTabSheet;
    btCancel: TButton;
    btOk: TButton;
    mmSourceCode: TMemo;
    procedure btOkClick(Sender: TObject);
    procedure btCancelClick(Sender: TObject);
  private
    { Private declarations }
    FBlock: TWorkflowScriptBlock;
    procedure BlockToInterface;
    procedure InterfaceToBlock;
    procedure Localize;
  protected
    procedure Loaded; override;
  public
    { Public declarations }
    function EditScriptBlock(ABlock: TWorkflowScriptBlock): boolean;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation
uses wsRes, wsMain;

{$R *.DFM}

{ TForm1 }

function TfmScriptEditor.EditScriptBlock(ABlock: TWorkflowScriptBlock): boolean;
begin
  FBlock := ABlock;
  BlockToInterface;
  result := ShowModal = mrOk;
  if result then
    InterfaceToBlock;
end;

procedure TfmScriptEditor.btOkClick(Sender: TObject);
begin
  ModalResult := mrOk;
end;

procedure TfmScriptEditor.btCancelClick(Sender: TObject);
begin
  ModalResult := mrCancel;
end;

procedure TfmScriptEditor.BlockToInterface;
begin
  mmSourceCode.Lines.Text := FBlock.SourceCode;
end;

constructor TfmScriptEditor.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

destructor TfmScriptEditor.Destroy;
begin
  inherited;
end;

procedure TfmScriptEditor.InterfaceToBlock;
begin
  FBlock.SourceCode := mmSourceCode.Lines.Text;
end;

procedure TfmScriptEditor.Localize;
begin
  Self.Caption := _str('fmScriptEditor.Self.Caption');
  tsScript.Caption := _str('fmScriptEditor.tsScript.Caption');
  btCancel.Caption := _str('fmScriptEditor.btCancel.Caption');
  btOk.Caption := _str('fmScriptEditor.btOk.Caption');
end;

procedure TfmScriptEditor.Loaded;
begin
  inherited;
  Localize;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -