unit Main;

interface

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

type
  TMainForm = class(TForm)
    Panel1: TPanel;
    imgKONIEC: TImage;
    sg1: TStringGrid;
    sg2: TStringGrid;
    Splitter1: TSplitter;
    procedure FormShow(Sender: TObject);
    procedure imgKONIECClick(Sender: TObject);

  private

  public
	 procedure Koniec();
  end;

var
  MainForm: TMainForm;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TMainForm.FormShow(Sender: TObject);
var
	ACol : Integer;
   ARow : Integer;

begin
	ACol := 0;
   ARow := 0;


   sg1.ColCount := 100;
   sg1.RowCount := 100;

   for ARow := 0 to 99 do
	begin
      for ACol := 0 to 99 do
   	begin
         sg1.Cells[ACol, ARow] := IntToStr(ACol);
         sg1.Cells[0, ARow]    := IntToStr(ARow);
      end;
   end;
	
   sg2.ColCount := 100;
   sg2.RowCount := 100;

   for ARow := 0 to 99 do
   begin
      for ACol := 0 to 99 do
		begin
         sg2.Cells[ACol, ARow] := IntToStr(ACol);
         sg2.Cells[0, ARow]    := IntToStr(ARow);
      end;
   end;
end;

procedure TMainForm.imgKONIECClick(Sender: TObject);
begin
	Koniec();
end;

procedure TMainForm.Koniec();
begin
	if Application.MessageBox('Koniec pracy', 'Uwaga', MB_ICONINFORMATION or MB_YESNO) = mrYes then
	begin
		Close();
   end;
end;


end.
