unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DiskInfo;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.FormCreate(Sender: TObject);
const
  przes=10;
  wys=50;
var
  litera :Char;
  panel :TDiskInfoPanel;
  paneleDiskInfo :array of TDiskInfoPanel;
  iloscPaneli :Byte;
begin
iloscPaneli:=0;
for litera:='c' to 'z' do
  begin
  panel:=TDiskInfoPanel.Create(Self);
  panel.LiteraDysku:=litera;
  if panel.Informacje.czyDyskDostepny then
    begin
    Inc(iloscPaneli);
    SetLength(paneleDiskInfo,iloscPaneli);
    panel.SetBounds(przes,przes+(iloscPaneli-1)*(wys+przes),ClientWidth-2*przes,wys);
    panel.Parent:=Self;
    paneleDiskInfo[iloscPaneli-1]:=panel;
    end
    else
    panel.Free;
  end;

ClientHeight:=paneleDiskInfo[iloscPaneli-1].Top+paneleDiskInfo[iloscPaneli-1].Height+przes;
end;

end.
