2
0
Эх сурвалжийг харах

form: on create check if Application<>nil to give hint about adding Fresnel to program

mattias 1 жил өмнө
parent
commit
9af72080ea

+ 3 - 2
src/base/fresnel.forms.pas

@@ -273,8 +273,7 @@ var
 
 Function FormManager : TFresnelFormManager;
 var
-  aclass : TFresnelFormManagerClass;
-
+  aClass : TFresnelFormManagerClass;
 begin
   if _FormManager = Nil then
     begin
@@ -531,6 +530,8 @@ end;
 
 constructor TFresnelCustomForm.CreateNew(AOwner: TComponent);
 begin
+  if Application=nil then
+    raise EFresnel.Create('Fresnel.Forms.Application=nil, check if unit Fresnel is in the program uses section');
   inherited Create(AOwner);
   FVisible:=true;
   Layouter:=TViewportLayouter.Create(nil);