ftaskinstanceview.pas

来自「Workflow Studio是一款专为商业进程管理(BPM)设计的Delphi」· PAS 代码 · 共 73 行

PAS
73
字号
unit fTaskInstanceView;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ExtCtrls, wsControls, wsClasses;

type
  TfrTaskInstanceView = class(TFrame)
    Panel1: TPanel;
    Label1: TLabel;
    lbSubject: TLabel;
    mmDescription: TMemo;
    Panel2: TPanel;
    Label2: TLabel;
    cbTaskStatus: TTaskStatusCombo;
  private
    FTask: TTaskInstance;
    procedure SetTask(const Value: TTaskInstance);
    procedure TaskToInterface;
    procedure Localize;
    { Private declarations }
  protected
    procedure Loaded; override;
  public
    { Public declarations }
    property Task: TTaskInstance read FTask write SetTask;
  end;

implementation
uses wsRes;

{$R *.DFM}

{ TFrame1 }

procedure TfrTaskInstanceView.SetTask(const Value: TTaskInstance);
begin
  FTask := Value;
  TaskToInterface;
end;

procedure TfrTaskInstanceView.TaskToInterface;
begin
  cbTaskStatus.TaskInstance := FTask;
  if FTask <> nil then
  begin
    mmDescription.Lines.Text := FTask.TaskDef.Description;
    lbSubject.Caption := FTask.TaskDef.Subject;
    cbTaskStatus.Enabled := not FTask.Completed;
  end else
  begin
    mmDescription.Lines.Text := '';
    lbSubject.Caption := '';
    cbTaskStatus.Enabled := false;
  end;
end;

procedure TfrTaskInstanceView.Localize;
begin
  Label1.Caption := _str('frTaskInstanceView.Label1.Caption');
  Label2.Caption := _str('frTaskInstanceView.Label2.Caption');
end;

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

end.

⌨️ 快捷键说明

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