You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a need to use a TFormClass to instantiate a Form in TFormStand so I added a new method.
Return a TFormInfo is reasonable for me since my form implement an interface I used to communicate to them.
The reason I needed it is I have a set of Forms I register with my system at startup and I instantiate the form based upon user selection and I need to form(s) to go in the same container.
I basically have a TDictionary<String, TFormClass> I used to select from.
With this be something reasonable to add to TFormStand?
function TFormStand.New(const FormClass: TFormClass; const AParent: TFmxObject; const AStandStyleName: string): TFormInfo;
var
LForm: TForm;
LParent: TFmxObject;
LStandName: string;
begin
LParent := AParent;
if not Assigned(LParent) then
LParent := GetDefaultParent;
LStandName := AStandStyleName;
LForm := FormClass.Create(nil);
try
LForm.Name := '';
Result := Use(LForm, LParent, LStandName);
Result.FormIsOwned := True;
except
LForm.Free;
raise;
end;
end;
The text was updated successfully, but these errors were encountered:
I had a need to use a TFormClass to instantiate a Form in TFormStand so I added a new method.
Return a TFormInfo is reasonable for me since my form implement an interface I used to communicate to them.
The reason I needed it is I have a set of Forms I register with my system at startup and I instantiate the form based upon user selection and I need to form(s) to go in the same container.
I basically have a TDictionary<String, TFormClass> I used to select from.
With this be something reasonable to add to TFormStand?
function TFormStand.New(const FormClass: TFormClass; const AParent: TFmxObject; const AStandStyleName: string): TFormInfo;
var
LForm: TForm;
LParent: TFmxObject;
LStandName: string;
begin
LParent := AParent;
if not Assigned(LParent) then
LParent := GetDefaultParent;
LStandName := AStandStyleName;
LForm := FormClass.Create(nil);
try
LForm.Name := '';
Result := Use(LForm, LParent, LStandName);
Result.FormIsOwned := True;
except
LForm.Free;
raise;
end;
end;
The text was updated successfully, but these errors were encountered: