PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/dropfiles/unit2.pas

http://github.com/graemeg/lazarus
Pascal | 52 lines | 31 code | 15 blank | 6 comment | 1 complexity | 88e8e13e95bd5be742097ea6a21f552e MD5 | raw file
 1unit Unit2; 
 2
 3{$mode objfpc}{$H+}
 4
 5interface
 6
 7uses
 8  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls;
 9
10type
11
12  { TForm2 }
13
14  TForm2 = class(TForm)
15    CheckBox1: TCheckBox;
16    Label1: TLabel;
17    procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
18    procedure CheckBox1Change(Sender: TObject);
19  private
20    { private declarations }
21  public
22    { public declarations }
23  end; 
24
25var
26  Form2: TForm2; 
27
28implementation
29
30{$R unit2.lfm}
31
32uses
33  Unit1;
34
35{ TForm2 }
36
37procedure TForm2.FormDropFiles(Sender: TObject; const FileNames: array of String);
38var
39  I: Integer;
40begin
41  Form1.Memo1.Lines.Add(IntToStr(Length(FileNames)) + ' file(s) dropped on ' + Name + ':');
42  for I := 0 to High(FileNames) do
43    Form1.Memo1.Lines.Add(FileNames[I]);
44end;
45
46procedure TForm2.CheckBox1Change(Sender: TObject);
47begin
48  AllowDropFiles := CheckBox1.Checked;
49end;
50
51end.
52