1. Create Form1;
2. Creation of Fmxframe (New-Other->delphi Files, fmxframe); The unit name is Unitframe, the form named frm puts a button in the form, a memo, and here is just a test with a wood reference to it.
3. Call.
Uses unitframe;var frm:tfrm;begin frm: = UnitFrame.TFrm.Create (self); First create the frm. Name: = ' frm1 '; frm. Speedbutton1.text: = ' this is test! '; frm. Parent: = self. Rectangle1; Select Parent object to place on Rectanglel above frm. Memo1.Lines.Add (frm. Name) End;
Tests can be added.
This idea, like creating a component dynamically, defines an object of that component class, creates it, and then selects the parent class.
Perhaps the essence of object-oriented I am not so clear, but slowly learn more, naturally understand it.
Just said here, then I went to the mother there to fill a lesson, so understand the best:
The frm is an object of the Tfrm class, and this object is actually a pointer, which must be created when used, so the object is the same,
Therefore, frm is required: = UnitFrame.TFrm.Crate (self);
Create and invoke frame under XE