unit Unit_25;

interface

uses
  SysUtils, Types, Classes, QGraphics, QControls,
  QForms, QDialogs, QStdCtrls, QTypes, QExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    LCDNumber1: TLCDNumber;
    Start: TButton;
    Stop: TButton;
    Close: TButton;
    procedure TimerOnTimer(Sender: TObject);
    procedure StartClick(Sender: TObject);
    procedure StopClick(Sender: TObject);
    procedure CloseClick(Sender: TObject);
  private
    { Private declarations }
    FTimer: Boolean;
    procedure SetTimer(Value: Boolean);
  public
    { Public declarations }
    property Timer: Boolean read FTimer write SetTimer;
  end;

var
  Form1: TForm1;

implementation

{$R *.xfm}

procedure TForm1.SetTimer(Value: Boolean);
begin
  if FTimer <> Value then
    FTimer := Value;
end;
//---------------------------------------------------------
procedure TForm1.TimerOnTimer(Sender: TObject);
begin
  if Timer then
    LCDNumber1.Value := FormatDateTime('nn:ss:zzz', Now());
//nn:ss:zzz minuty:sekundy:dziesiąte,setne,tysieczne częsci sekundy
end;
//---------------------------------------------------------
procedure TForm1.StartClick(Sender: TObject);
begin
  Timer := TRUE;
end;
//---------------------------------------------------------
procedure TForm1.StopClick(Sender: TObject);
begin
  Timer := FALSE;
end;
//---------------------------------------------------------
procedure TForm1.CloseClick(Sender: TObject);
begin
   Application.Terminate();
end;
//---------------------------------------------------------
end.

