rm_templ.pas

来自「report machine 2.3 功能强大」· PAS 代码 · 共 84 行

PAS
84
字号

{*****************************************}
{                                         }
{            Report Machine v2.0          }
{            New Template form            }
{                                         }
{*****************************************}

unit RM_templ;

interface

{$I RM.inc}

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

type
  TRMTemplNewForm = class(TForm)
    GroupBox2: TGroupBox;
    Panel1: TPanel;
    Image1: TImage;
    btnOpenBMPFile: TButton;
    btnOK: TButton;
    btnCancel: TButton;
    OpenDialog1: TOpenDialog;
    Memo1: TMemo;
    Label1: TLabel;
    procedure btnOpenBMPFileClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    procedure Localize;
  public
    { Public declarations }
  end;

implementation

uses RM_Utils;

{$R *.DFM}

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

  Caption := RMLoadStr(rmRes + 320);
  Label1.Caption := RMLoadStr(rmRes + 321);
  GroupBox2.Caption := RMLoadStr(rmRes + 322);
  btnOpenBMPFile.Caption := RMLoadStr(rmRes + 323);
  btnOK.Caption := RMLoadStr(SOk);
  btnCancel.Caption := RMLoadStr(SCancel);
end;

procedure TRMTemplNewForm.btnOpenBMPFileClick(Sender: TObject);
begin
  OpenDialog1.Filter := RMLoadStr(SBMPFile) + ' (*.bmp)|*.bmp';
  with OpenDialog1 do
  begin
    if Execute then
      Image1.Picture.LoadFromFile(FileName);
  end;
end;

procedure TRMTemplNewForm.FormCreate(Sender: TObject);
begin
	Localize;
end;

procedure TRMTemplNewForm.FormShow(Sender: TObject);
begin
  Memo1.Lines.Clear;
  Image1.Picture.Assign(nil);
  Memo1.SetFocus;
end;

end.

 

⌨️ 快捷键说明

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