Difference between revisions of "Frames"

From Lazarus 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.
 +
 
* Are they VCL compatible?
 
* Are they VCL compatible?
* What can it be used for?
+
Yes, frames are fully compatible with VCL.
 +
 
 
* How to create a frame?
 
* How to create a frame?
* How can I add a frame to my project?
+
Press File->New... menu item and in the opened dialog select "Frame" item.
* How can I re-use frame in another project?
+
 
 +
* 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.

Revision as of 14:26, 20 August 2009

  • What are frames?

Frames are named containers for components. They can be embedded to forms or another frames.

  • 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.