unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Templatep;
type
TMainform =
class(TTemplate)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
FLastActiveForm:TTemplate;
procedure ActiveFormInform(Sender: TObject);
{ Private-Deklarationen }
public
{ Public-Deklarationen }
Procedure RemoveLastActive(F:TTemplate);
end;
var
Mainform: TMainform;
implementation
{$R *.dfm}
procedure TMainform.ActiveFormInform(Sender:TObject);
begin
if Assigned(FLastActiveForm)
then FLastActiveForm.Color := clSilver;
if Screen.ActiveForm
is TTemplate
then
begin
FLastActiveForm := TTemplate(Screen.ActiveForm);
FLastActiveForm.Color := clBlue;
end;
end;
procedure TMainform.FormCreate(Sender: TObject);
begin
Screen.OnActiveFormChange := ActiveFormInform;
end;
procedure TMainform.RemoveLastActive(F: TTemplate);
begin
if F=FLastActiveForm
then FLastActiveForm :=
nil;
end;
procedure TMainform.Button1Click(Sender: TObject);
begin
Template.ShowModal;
end;
end.