[Up][Next] (#fpgui)

Embedded Forms as reusable Frames

fpGUI allows you to embed a Form inside another Form. This is similar to the Delphi-like TFrame idea. This is very handy if you want to reuse a UI design in multiple places in your application.

At first you will be tempted to design a "frame" using a TfpgForm descendant, because that is what the UI Designer will create for you by default. Please refrain from using TfpgForm descendants as "frames" because there are quite a few pitfalls. Instead, use TfpgFrame as the base class for a UI Frame design. This eliminates all the possible problems you might get. You can still use the UI Designer because, the UI Designer simply ignores the base class of any UI design - it only care about what is inside the designer comment markers.

What are the problems when you descend from TfpgForm

Simply using TfpgFrame as your base class for embedded forms/frames will resolve all these issues for you. For an example of this, take a look at the demo project in [fpgui]/examples/embedded_form/ directory.


Documentation generated on: 2015-04-04