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

📄 rm_property.pas

📁 进销存·完整的·有数据库的·非常完整·只得参考
💻 PAS
字号:
unit RM_Property;

interface

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

type
  TRMReportProperty = class(TForm)
    GroupBox1: TGroupBox;
    lblTitle: TLabel;
    lblAuthor: TLabel;
    lblCompany: TLabel;
    lblCopyRight: TLabel;
    lblComment: TLabel;
    edtTitle: TEdit;
    edtAuthor: TEdit;
    edtCompany: TEdit;
    edtCopyRight: TEdit;
    memComment: TMemo;
    btnOK: TButton;
    btnCancel: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    FReportInfo: TRMReportInfo;
    procedure Localize;
  public
    { Public declarations }
    property ReportInfo: TRMReportInfo read FReportInfo;
  end;

implementation

{$R *.DFM}

uses RM_Utils, RM_Const, RM_Const1;

procedure TRMReportProperty.Localize;
begin
  Font.Name := RMLoadStr(SRMDefaultFontName);
  Font.Size := StrToInt(RMLoadStr(SRMDefaultFontSize));
  Font.Charset := StrToInt(RMLoadStr(SCharset));

  RMSetStrProp(Self, 'Caption', rmRes + 820);
  RMSetStrProp(lblTitle, 'Caption', rmRes + 372);
  RMSetStrProp(lblAuthor, 'Caption', rmRes + 816);
  RMSetStrProp(lblCompany, 'Caption', rmRes + 817);
  RMSetStrProp(lblCopyRight, 'Caption', rmRes + 818);
  RMSetStrProp(lblComment, 'Caption', rmRes + 819);

  btnOK.Caption := RMLoadStr(SOk);
  btnCancel.Caption := RMLoadStr(SCancel);
end;

procedure TRMReportProperty.FormCreate(Sender: TObject);
begin
  FReportInfo := TRMReportInfo.Create;
  Localize;
end;

procedure TRMReportProperty.FormShow(Sender: TObject);
begin
  edtTitle.Text := ReportInfo.Title;
  edtAuthor.Text := ReportInfo.Author;
  edtCompany.Text := ReportInfo.Company;
  edtCopyRight.Text := ReportInfo.CopyRight;
  memComment.Lines.Text := ReportInfo.Comment;
end;

procedure TRMReportProperty.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  if ModalResult = mrOK then
  begin
    ReportInfo.Title := edtTitle.Text;
    ReportInfo.Author := edtAuthor.Text;
    ReportInfo.Company := edtCompany.Text;
    ReportInfo.CopyRight := edtCopyRight.Text;
    ReportInfo.Comment := memComment.Lines.Text;
  end;
end;

procedure TRMReportProperty.FormDestroy(Sender: TObject);
begin
  FReportInfo.Free;
end;

end.

⌨️ 快捷键说明

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