descriptionrcdataresourceform.pas

来自「學習資料網上下載」· PAS 代码 · 共 62 行

PAS
62
字号
unit DescriptionRCDataResourceForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ResourceForm, StdCtrls;

type
  TfmRCDataDescriptionResource = class(TfmResource)
    Label1: TLabel;
    edDescription: TEdit;
    procedure edDescriptionExit(Sender: TObject);
  private
    procedure SaveResource (const undoDetails : string);
  protected
    procedure SetObject(const Value: TObject); override;
  public
    { Public declarations }
  end;

var
  fmRCDataDescriptionResource: TfmRCDataDescriptionResource;

implementation

uses unitResourceRCData;

{$R *.DFM}

resourcestring
  rstChangeDescription = 'change description';

{ TfmRCDataDescriptionResource }

procedure TfmRCDataDescriptionResource.SetObject(const Value: TObject);
var
  details : TRCDataDescriptionResourceDetails;
begin
  inherited;

  details := Obj as TRCDataDescriptionResourceDetails;
  edDescription.Text := details.Description
end;

procedure TfmRCDataDescriptionResource.edDescriptionExit(Sender: TObject);
begin
  if edDescription.CanUndo then
    SaveResource (rstChangeDescription);
end;

procedure TfmRCDataDescriptionResource.SaveResource (const undoDetails : string);
var
  details : TRCDataDescriptionResourceDetails;
begin
  AddUndoEntry (undoDetails);
  details := Obj as TRCDataDescriptionResourceDetails;
  details.Description := edDescription.Text
end;

end.

⌨️ 快捷键说明

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