unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, Forms, Controls, Graphics, StdCtrls, ExtCtrls, BGRAShape;
type
{ TForm1 }
TForm1 = class(TForm)
BGRAShape1: TBGRAShape;
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
ModalForm: TForm;
begin
BGRAShape1.Left := 0;
BGRAShape1.Top := 0;
BGRAShape1.Width := Width;
BGRAShape1.Height := Height;
BGRAShape1.FillOpacity := 0;
BGRAShape1.Visible := True;
Timer1.Enabled := True;
ModalForm := TForm.Create(Self);
ModalForm.Caption := 'This is a modal form';
ModalForm.Top := Top + 100;
ModalForm.Left := Left + 120;
ModalForm.ShowModal;
ModalForm.Free;
BGRAShape1.Visible := False;
Timer1.Enabled := False;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
BGRAShape1.FillOpacity := BGRAShape1.FillOpacity + 1;
if (BGRAShape1.FillOpacity > 50) then
Timer1.Enabled := False;
end;
end.