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

📄 ftransitioneditor.pas

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

interface

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

type
  TfmTransitionEditor = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    Label1: TLabel;
    cbTransition: TComboBox;
    btCancel: TButton;
    btOk: TButton;
    procedure btOkClick(Sender: TObject);
    procedure btCancelClick(Sender: TObject);
  private
    { Private declarations }
    FSourceBlock: TCustomWorkflowBlock;
    FLine: TCustomDiagramLine;
    procedure TransitionToInterface;
    procedure InterfaceToTransition;
    procedure Localize;
  protected
    procedure Loaded; override;
  public
    { Public declarations }
    function EditTransition(ALine: TCustomDiagramLine): boolean;
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  end;

implementation
uses wsMain, wsRes;

{$R *.DFM}

{ TfmDecisionEditor }

function TfmTransitionEditor.EditTransition(ALine: TCustomDiagramLine): boolean;
begin
  result := false;
  FLine := ALine;
  if FLine.SourceLinkPoint.Anchor is TCustomWorkflowBlock then
    FSourceBlock := TCustomWorkflowBlock(FLine.SourceLinkPoint.Anchor)
  else
    exit;

  if not FSourceBlock.HasOutputList then
    exit;
    
  TransitionToInterface;
  result := ShowModal = mrOk;
  if result then
    InterfaceToTransition;
end;

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

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

procedure TfmTransitionEditor.TransitionToInterface;
begin
  FSourceBlock.FillOutputList(cbTransition.Items);
  cbTransition.Items.Insert(0, '');
  cbTransition.ItemIndex := cbTransition.Items.IndexOf(FLine.DefaultTextCell.Text);
end;

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

destructor TfmTransitionEditor.Destroy;
begin
  inherited;
end;

procedure TfmTransitionEditor.InterfaceToTransition;
begin
  FLine.DefaultTextCell.Text := cbTransition.Text;
end;

procedure TfmTransitionEditor.Localize;
begin
  Self.Caption := _str('fmTransitionEditor.Self.Caption');
  TabSheet1.Caption := _str('fmTransitionEditor.TabSheet1.Caption');
  Label1.Caption := _str('fmTransitionEditor.Label1.Caption');
  btCancel.Caption := _str('fmTransitionEditor.btCancel.Caption');
  btOk.Caption := _str('fmTransitionEditor.btOk.Caption');
end;

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

end.

⌨️ 快捷键说明

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