sysparaunit.pas

来自「三层的通用架构」· PAS 代码 · 共 107 行

PAS
107
字号
unit SysParaUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, ExtCtrls, ExtDlgs, Buttons;

type
  TSysParaForm = class(TForm)
    Button1: TButton;
    Button2: TButton;
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Edit2: TEdit;
    OpenPictureDialog1: TOpenPictureDialog;
    Label3: TLabel;
    Edit3: TEdit;
    Label4: TLabel;
    Edit4: TEdit;
    OpenDialog1: TOpenDialog;
    Label5: TLabel;
    Edit5: TEdit;
    Label6: TLabel;
    Edit6: TEdit;
    Label7: TLabel;
    ComboBoxEx1: TComboBoxEx;
    Button3: TButton;
    Button4: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  SysParaForm: TSysParaForm;

implementation

uses
  MainUnit;

{$R *.dfm}

procedure TSysParaForm.FormCreate(Sender: TObject);
begin
  OpenDialog1.InitialDir := ExtractFilePath(Application.ExeName);
  OpenPictureDialog1.InitialDir := ExtractFilePath(Application.ExeName);
end;

procedure TSysParaForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action := caFree;
  SysParaForm := nil;
end;

procedure TSysParaForm.Button3Click(Sender: TObject);
begin
  with OpenPictureDialog1 do
  begin
    InitialDir := ExtractFilePath(Edit3.Text);
    FileName := ExtractFileName(Edit3.text);
    FilterIndex := 2;
    if (FileName = '') or (Pos(UpperCase(ExtractFileExt(FileName)) + '/', '.ICO/') > 0) then
      FilterIndex := 1;
    if Execute then
      Edit3.Text := FileName;
  end;
end;

procedure TSysParaForm.Button4Click(Sender: TObject);
begin
  with OpenDialog1 do
  begin
    InitialDir := ExtractFilePath(Edit4.Text);
    FileName := ExtractFileName(Edit4.text);
    FilterIndex := 4;
    if (FileName = '') or (Pos(UpperCase(ExtractFileExt(FileName)) + '/', '.HLP/.CHM/') > 0) then
      FilterIndex := 1;
    if Execute then
      Edit4.Text := FileName;
  end;
end;

procedure TSysParaForm.Button1Click(Sender: TObject);
begin
  TheMainForm.SetProperty;
  Close;
end;

procedure TSysParaForm.Button2Click(Sender: TObject);
begin
  Close;
end;

end.

⌨️ 快捷键说明

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