unit Forms.MainForm;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls;
type
TMainForm =
class( TForm )
Button1: TButton;
Button2: TButton;
procedure Button1Click( Sender: TObject );
procedure Button2Click( Sender: TObject );
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
MainForm: TMainForm;
implementation
{$R *.fmx}
uses
Dialogs.FooDialog;
{Variante 1}
procedure TMainForm.Button1Click( Sender: TObject );
var
LDialog: TFooDialog;
begin
LDialog := TFooDialog.Create(
nil );
try
LDialog.ShowModal;
finally
LDialog.DisposeOf;
end;
end;
{Variante 2}
procedure TMainForm.Button2Click( Sender: TObject );
var
LOuter, LInner: TFooDialog;
begin
LOuter := TFooDialog.Create(
nil );
try
LInner := LOuter;
LInner.ShowModal(
procedure( r: TModalResult )
begin
LInner.Release;
end );
LOuter :=
nil;
finally
LOuter.DisposeOf;
end;
end;
end.