Difference between revisions of "Frames"

From Free Pascal wiki
Jump to navigationJump to search
Line 1: Line 1:
 
* What are frames?
 
* What are frames?
Frames are named containers for components. They can be embedded to forms or another frames.
+
Frames are named containers for components. They can be embedded to forms or another frames. As forms they are stored in 2 files: code is stored in .pas file and design in .lfm file.
  
 
* Are they VCL compatible?
 
* Are they VCL compatible?

Revision as of 14:29, 20 August 2009

  • What are frames?

Frames are named containers for components. They can be embedded to forms or another frames. As forms they are stored in 2 files: code is stored in .pas file and design in .lfm file.

  • Are they VCL compatible?

Yes, frames are fully compatible with VCL.

  • How to create a frame?

Press File->New... menu item and in the opened dialog select "Frame" item.

  • What can they be used for?

They are needed when you have the same set of controls and logic between them at different windows (forms) of your application. You can group that repeated controls and logic into one frame and use that frame in different places. Therefore you don't need to repeat work of control layouting and writing their logic.

For example, you have 2 listboxes and buttons to move items between them in your several project forms. So you can create a frame with 2 listboxes and needed button, write a logic of items moving and use then use your frame on all forms where needed. Moreover, if you find an error in frame code then you will fix it once in the frame code instead of fixing it n-times amoung all forms.