home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April A / Pcwk4a98.iso / PROGRAM / DELPHI16 / Calmira / Src / VCL / DRAGDROP.PAS < prev    next >
Pascal/Delphi Source File  |  1997-02-15  |  2KB  |  66 lines

  1. {*********************************************************}
  2. {                                                         }
  3. {    Calmira Visual Component Library 1.0                 }
  4. {    by Li-Hsin Huang,                                    }
  5. {    released into the public domain January 1997         }
  6. {                                                         }
  7. {*********************************************************}
  8.  
  9. unit DragDrop;
  10.  
  11. { TDragDrop component }
  12.  
  13. { TDragDrop is an abstract base class for TDropServer and TDropClient.
  14.   It defines the Files and AutoClear properties.  To add more
  15.   funtionality to both TDropServer or TDropClient (e.g., methods to
  16.   process filenames), write the code for TDragDrop instead.
  17. }
  18.  
  19. interface
  20.  
  21. uses
  22.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  23.   Forms, Dialogs;
  24.  
  25. type
  26.   TDragDrop = class(TComponent)
  27.   private
  28.     { Private declarations }
  29.     FFiles : TStrings;
  30.     FAutoClear : Boolean;
  31.     procedure SetFiles(list: TStrings);
  32.   protected
  33.     { Protected declarations }
  34.   public
  35.     { Public declarations }
  36.     constructor Create(AOwner: TComponent); override;
  37.     destructor Destroy; override;
  38.     property Files : TStrings read FFiles write SetFiles;
  39.  
  40.   published
  41.     { Published declarations }
  42.     property AutoClear : Boolean read FAutoClear write FAutoClear default True;
  43.   end;
  44.  
  45. implementation
  46.  
  47. constructor TDragDrop.Create(AOwner: TComponent);
  48. begin
  49.   inherited Create(AOwner);
  50.   FFiles := TStringList.Create;
  51.   FAutoClear := True;
  52. end;
  53.  
  54. destructor TDragDrop.Destroy;
  55. begin
  56.   FFiles.Free;
  57.   inherited Destroy;
  58. end;
  59.  
  60. procedure TDragDrop.SetFiles(list: TStrings);
  61. begin
  62.   FFiles.Assign(list);
  63. end;
  64.  
  65. end.
  66.