Working with frames |
Top Previous Next |
What is base-frame and frame-copy.
Suppose you have created new project in Delphi IDE. Add a frame to this project by clicking on File|New|Frame main menu item. This will open the new unit with a frame. In designer architecture this frame instance is called base-frame. Now try to place the frame on the project's main form by selecting "frames" button on component palette, choosing our frame and clicking on the main form. You will see the newly inserted frame instance on the form. This instance is called frame-copy.
Note that since that, you have two distinct frame instances in the Delphi IDE: the base-frame and its frame-copy. Any count of frame-copies that will correspond to single base-frame can be added to designing forms.
What the instance of the base-frame is for?
How the root with frame-copies is loading?
Since the form dfm does not include all frame-copy properties, how to properly initialize the frame-copy while loading? The answer is to provide the base-frame to the form reader. That is every frame-copy loaing in two steps: first frame-copy and its children is initialized with base-frame property values, then the properties that has different from base-frame values are readed from forms dfm.
As opposed to other designer tool sets LMD-DesignPack provides two ways for providing a base-frame while loading a frame-copy:
In the IDE-Tools the instance of the base-frame is implied to exist in design-time mode. So, the first way should be usually used for providing a base-frame instance in the IDE application. Also note, that commonly if the opening in IDE form contain frame-copies of the not yet opened in IDE base-frame module, this module should be immediately opened (recursively).
As opposed to design-time, at run-time NO additional frame instances, except frame-copies are expected. That is the base-frame instance should not be created at run-time. This is very important, because the frame can contain heavy components, like database connections or opened tables, and fake base-frame instance will unnecessary eats computer resources. So, the advantage of the LMD-DesignPack is that it allows to initialize frame-copy from previously saved (at design-time) base-frame stream or file.
See also TLMDModule.OnQueryFrameData event to learn of how to provide a base-frame data for the frame-copies. |