importfromfolderf.pas

来自「极具实用价值的文件管理系统」· PAS 代码 · 共 69 行

PAS
69
字号
{ *********************************************************************** }
{ Unit Name: ImportFromFolderF
{ Purpose: ImportFromFolderF
{ Author: Cyclone
{ History:
{         2004-12-9 21:59:54 Create the function
{ *********************************************************************** }

unit ImportFromFolderF;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DialogBaseF, Buttons, CycSpeedButton, CycPanel, ExtCtrls,
  {$IFDEF MSWINDOWS} FileCtrl, {$ENDIF} StdCtrls, CycLabeledEdit,
  CycLabeledLookupEdit, CycLabel, PubFuns;

type
  TfmImportFromFolder = class(TfmDialogBase)
    edtPath: TCycLabeledLookupEdit;
    rdgAction: TRadioGroup;
    chkIncludeSubDir: TCheckBox;
    procedure edtPathSubButtonClick(Sender: TObject);
    procedure btnOKClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    Path: String;
    IncludeSubDirectory: Boolean;
    FileExistsAction: TImportFileExistsAction;
  end;

var
  fmImportFromFolder: TfmImportFromFolder;

implementation


{$R *.dfm}

procedure TfmImportFromFolder.edtPathSubButtonClick(Sender: TObject);
var
  APath: String;
begin
  if SelectDirectory('Please Select Import Folder', '', APath) then
  begin
    edtPath.Text := APath;
  end;
end;

procedure TfmImportFromFolder.btnOKClick(Sender: TObject);
begin
  if not DirectoryExists(edtPath.Text) then
  begin
    ShowError('Selected path not exists!');
    edtPath.SetFocus;
    Exit;
  end;
  Path := edtPath.Text;
  IncludeSubDirectory := chkIncludeSubDir.Checked;
  FileExistsAction := TImportFileExistsAction(rdgAction.ItemIndex);

  inherited;
end;

end.

⌨️ 快捷键说明

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