Wishlist: alternative form of Application.CreateForm()
Original Reporter info from Mantis: MarkMLl @MarkMLl
-
Reporter name: Mark Morgan Lloyd
Original Reporter info from Mantis: MarkMLl @MarkMLl
- Reporter name: Mark Morgan Lloyd
Description:
Please add an alternative form of Application.CreateForm() to the Forms unit, returning a TForm to allow the result to be assigned to a property.
Something like
function CreateForm(instanceClass: TComponentClass): TForm;
begin
Application.CreateForm(instanceClass, result);
end;
Additional information:
The intention is to allow units to contain a Lazarus-built form as a property, protecting it from unauthorised modification, in which case the .lpr file needs to look like
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
// Application.CreateForm(TForm1, Form1);
Form1 := Application.CreateForm(TForm1) as TForm1;
...
Mantis conversion info:
- Mantis ID: 37717
- Version: 2.0.10