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

📄 mmffprp.pas

📁 一套及时通讯的原码
💻 PAS
字号:
{========================================================================}
{=                (c) 1995-98 SwiftSoft Ronald Dittrich                 =}
{========================================================================}
{=                          All Rights Reserved                         =}
{========================================================================}
{=  D 01099 Dresden             = Tel.: +0351-8012255                   =}
{=  Loewenstr.7a                = info@swiftsoft.de                     =}
{========================================================================}
{=  Actual versions on http://www.swiftsoft.de/mmtools.html             =}
{========================================================================}
{=  This code is for reference purposes only and may not be copied or   =}
{=  distributed in any format electronic or otherwise except one copy   =}
{=  for backup purposes.                                                =}
{=                                                                      =}
{=  No Delphi Component Kit or Component individually or in a collection=}
{=  subclassed or otherwise from the code in this unit, or associated   =}
{=  .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed     =}
{=  without express permission from SwiftSoft.                          =}
{=                                                                      =}
{=  For more licence informations please refer to the associated        =}
{=  HelpFile.                                                           =}
{========================================================================}
{=  $Date: 13.02.98 - 17:04:35 $                                        =}
{========================================================================}
unit MMFFPrp;

{$I COMPILER.INC}

interface

uses
{$IFDEF WIN32}
    Windows,
{$ELSE}
    WinTypes,
    WinProcs,
{$ENDIF}

{$IFDEF DELPHI6}
    DesignIntf,
    DesignEditors,
{$ELSE}
    DsgnIntf,
{$ENDIF}

    SysUtils,
    Classes,
    Dialogs,
    Forms,
    Controls,
    StdCtrls,
    ComCtrls,
    Graphics,
    MMObj,
    MMUtils,
    MMFFile,
    MMFFEdit;

type
  {-- TMMFastFileNameProperty -------------------------------------------}
  TMMFastFileNameProperty = class(TStringProperty)
  public
    procedure Edit; override;
    function  GetAttributes: TPropertyAttributes; override;
  end;

  {-- TMMFastFileEditor -------------------------------------------------}
  TMMFastFileEditor = class(TComponentEditor)
  public
    procedure ExecuteVerb(Index: Integer); override;
    function  GetVerb(Index: Integer): string; override;
    function  GetVerbCount: Integer; override;
  end;

implementation

{== TMMFastFileNameProperty =============================================}
procedure TMMFastFileNameProperty.Edit;
begin
   with TOpenDialog.Create(nil) do
   try
      FileName := GetStrValue;
      Filter := 'FastFiles (*.ff)|*.ff';
      Options := Options + [ofPathMustExist, ofHideReadOnly];
      Title := LoadResStr(IDS_SELECTFILE);
      if Execute then SetValue(FileName);
   finally
      Free;
   end;
end;

{-- TMMFastFileNameProperty ---------------------------------------------}
function TMMFastFileNameProperty.GetAttributes: TPropertyAttributes;
begin
   Result := [paDialog];
end;

{== TMMFastFileEditor ===================================================}
procedure TMMFastFileEditor.ExecuteVerb(Index: Integer);
begin
   with TMMFastFileDialog.Create(nil) do
   try
      Source := (Component as TMMFastFile);

      if Execute and (Designer <> nil) then Designer.Modified;

   finally
      Free;
   end;
end;

{-- TMMFastFileEditor ---------------------------------------------------}
function TMMFastFileEditor.GetVerb(Index: Integer): string;
begin
   Result := 'FastFile Editor...';
end;

{-- TMMFastFileEditor ---------------------------------------------------}
function TMMFastFileEditor.GetVerbCount: Integer;
begin
   Result := 1;
end;

end.

⌨️ 快捷键说明

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