unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, ExtCtrls, Menus;

type
  TForm2 = class(TForm)
    MainMenu1: TMainMenu;
    Akcja1: TMenuItem;
    Pokastan1: TMenuItem;
    N1: TMenuItem;
    Koniecpracy1: TMenuItem;
    RadioGroup1: TRadioGroup;
    rbNISKI: TRadioButton;
    rbSREDNI: TRadioButton;
    rbWYSOKI: TRadioButton;
    StatusBar1: TStatusBar;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Pokastan1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure Koniecpracy1Click(Sender: TObject);

  private

  public
    procedure Info();
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
	Info();
end;

procedure TForm2.FormShow(Sender: TObject);
begin
	rbSREDNI.Checked := true;
end;

procedure TForm2.Koniecpracy1Click(Sender: TObject);
begin
	if Application.MessageBox('Koniec pracy?', 'Uwaga', MB_YESNO or MB_ICONQUESTION) = mrYes then
   begin
		Close();
   end;
end;

procedure TForm2.Pokastan1Click(Sender: TObject);
begin
	Info();
end;

procedure TForm2.Info();
var
	kom : String;

begin
	kom := 'Zaznaczony stan: ';

   if rbNISKI.Checked then
   begin
		kom := kom + 'niski';
   end;

   if rbSREDNI.Checked then
   begin
		kom := kom +  'œredni';
   end;

   if rbWYSOKI.Checked then
   begin
		kom := kom +  'wysoki';
   end;

   ShowMessage(kom);
end;

end.

