unit WinForm;

interface

uses
  System.Drawing, System.Collections, System.ComponentModel,
  System.Windows.Forms, System.Data, FileListBox;

type
  TWinForm = class(System.Windows.Forms.Form)
  {$REGION 'Designer Managed Code'}
  strict private
    /// <summary>
    /// Required designer variable.
    /// </summary>
    Components: System.ComponentModel.Container;
    TFileListBox1: FileListBox.TFileListBox;
    Label1: System.Windows.Forms.Label;
    Label2: System.Windows.Forms.Label;
    CheckBox1: System.Windows.Forms.CheckBox;
    CheckBox2: System.Windows.Forms.CheckBox;
    CheckBox3: System.Windows.Forms.CheckBox;
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    procedure InitializeComponent;
    procedure TFileListBox1_SelectedFileChanged(sender: System.Object; e: System.EventArgs);
    procedure TFileListBox1_DirectoryPathChanged(sender: System.Object; e: System.EventArgs);
    procedure TFileListBox1_FileDoubleClicked(sender: System.Object; e: System.EventArgs; 
      filename: string);
    procedure CheckBox1_CheckedChanged(sender: System.Object; e: System.EventArgs);
    procedure CheckBox2_CheckedChanged(sender: System.Object; e: System.EventArgs);
    procedure CheckBox3_CheckedChanged(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict protected
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    procedure Dispose(Disposing: Boolean); override;
  private
    { Private Declarations }
  public
    constructor Create;
  end;

  [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]

implementation

{$AUTOBOX ON}

{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinForm.InitializeComponent;
begin
  Self.TFileListBox1 := FileListBox.TFileListBox.Create;
  Self.Label1 := System.Windows.Forms.Label.Create;
  Self.Label2 := System.Windows.Forms.Label.Create;
  Self.CheckBox1 := System.Windows.Forms.CheckBox.Create;
  Self.CheckBox2 := System.Windows.Forms.CheckBox.Create;
  Self.CheckBox3 := System.Windows.Forms.CheckBox.Create;
  Self.SuspendLayout;
  // 
  // TFileListBox1
  // 
  Self.TFileListBox1.DirectoriesVisible := True;
  Self.TFileListBox1.DirectoryChangeAllowed := True;
  Self.TFileListBox1.DirectoryPath := '.';
  Self.TFileListBox1.DoubleDotVisible := True;
  Self.TFileListBox1.DrivesVisible := True;
  Self.TFileListBox1.FilesVisible := True;
  Self.TFileListBox1.Filter := nil;
  Self.TFileListBox1.Location := System.Drawing.Point.Create(16, 40);
  Self.TFileListBox1.Name := 'TFileListBox1';
  Self.TFileListBox1.Size := System.Drawing.Size.Create(376, 344);
  Self.TFileListBox1.TabIndex := 0;
  Include(Self.TFileListBox1.SelectedFileChanged, Self.TFileListBox1_SelectedFileChanged);
  Include(Self.TFileListBox1.DirectoryPathChanged, Self.TFileListBox1_DirectoryPathChanged);
  Include(Self.TFileListBox1.FileDoubleClicked, Self.TFileListBox1_FileDoubleClicked);
  // 
  // Label1
  // 
  Self.Label1.Location := System.Drawing.Point.Create(16, 400);
  Self.Label1.Name := 'Label1';
  Self.Label1.Size := System.Drawing.Size.Create(376, 16);
  Self.Label1.TabIndex := 1;
  Self.Label1.Text := 'Label1';
  // 
  // Label2
  // 
  Self.Label2.Location := System.Drawing.Point.Create(16, 424);
  Self.Label2.Name := 'Label2';
  Self.Label2.Size := System.Drawing.Size.Create(376, 16);
  Self.Label2.TabIndex := 2;
  Self.Label2.Text := 'Label2';
  // 
  // CheckBox1
  // 
  Self.CheckBox1.Checked := True;
  Self.CheckBox1.CheckState := System.Windows.Forms.CheckState.Checked;
  Self.CheckBox1.Location := System.Drawing.Point.Create(16, 8);
  Self.CheckBox1.Name := 'CheckBox1';
  Self.CheckBox1.Size := System.Drawing.Size.Create(80, 24);
  Self.CheckBox1.TabIndex := 3;
  Self.CheckBox1.Text := 'Katalogi';
  Include(Self.CheckBox1.CheckedChanged, Self.CheckBox1_CheckedChanged);
  // 
  // CheckBox2
  // 
  Self.CheckBox2.Checked := True;
  Self.CheckBox2.CheckState := System.Windows.Forms.CheckState.Checked;
  Self.CheckBox2.Location := System.Drawing.Point.Create(104, 8);
  Self.CheckBox2.Name := 'CheckBox2';
  Self.CheckBox2.Size := System.Drawing.Size.Create(56, 24);
  Self.CheckBox2.TabIndex := 4;
  Self.CheckBox2.Text := 'Pliki';
  Include(Self.CheckBox2.CheckedChanged, Self.CheckBox2_CheckedChanged);
  // 
  // CheckBox3
  // 
  Self.CheckBox3.Checked := True;
  Self.CheckBox3.CheckState := System.Windows.Forms.CheckState.Checked;
  Self.CheckBox3.Location := System.Drawing.Point.Create(168, 8);
  Self.CheckBox3.Name := 'CheckBox3';
  Self.CheckBox3.Size := System.Drawing.Size.Create(64, 24);
  Self.CheckBox3.TabIndex := 5;
  Self.CheckBox3.Text := 'Dyski';
  Include(Self.CheckBox3.CheckedChanged, Self.CheckBox3_CheckedChanged);
  // 
  // TWinForm
  // 
  Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 15);
  Self.ClientSize := System.Drawing.Size.Create(416, 455);
  Self.Controls.Add(Self.CheckBox3);
  Self.Controls.Add(Self.CheckBox2);
  Self.Controls.Add(Self.CheckBox1);
  Self.Controls.Add(Self.Label2);
  Self.Controls.Add(Self.Label1);
  Self.Controls.Add(Self.TFileListBox1);
  Self.Name := 'TWinForm';
  Self.Text := 'FileListBox (Windows Forms)';
  Self.ResumeLayout(False);
end;
{$ENDREGION}

procedure TWinForm.Dispose(Disposing: Boolean);
begin
  if Disposing then
  begin
    if Components <> nil then
      Components.Dispose();
  end;
  inherited Dispose(Disposing);
end;

constructor TWinForm.Create;
begin
  inherited Create;
  //
  // Required for Windows Form Designer support
  //
  InitializeComponent;
  //
  // TODO: Add any constructor code after InitializeComponent call
  //
end;

procedure TWinForm.CheckBox3_CheckedChanged(sender: System.Object; e: System.EventArgs);
begin
  TFileListBox1.DrivesVisible:=CheckBox3.Checked;
end;

procedure TWinForm.CheckBox2_CheckedChanged(sender: System.Object; e: System.EventArgs);
begin
  TFileListBox1.FilesVisible:=CheckBox2.Checked;
end;

procedure TWinForm.CheckBox1_CheckedChanged(sender: System.Object; e: System.EventArgs);
begin
  TFileListBox1.DirectoriesVisible:=CheckBox1.Checked;
end;

procedure TWinForm.TFileListBox1_FileDoubleClicked(sender: System.Object; e: System.EventArgs;
  filename: string);
begin
  Label2.Text:='Podwójne kliknięcie: '+filename;
end;

procedure TWinForm.TFileListBox1_DirectoryPathChanged(sender: System.Object;
  e: System.EventArgs);
begin
  Label1.Text:='Zmiana katalogu: '+TFileListBox1.DirectoryPath;
end;

procedure TWinForm.TFileListBox1_SelectedFileChanged(sender: System.Object; e: System.EventArgs);
begin
  Text:=TFileListBox1.FileName;
end;

end.
