Are component templates available for Lazarus? lazarus / 13-General ---------------------------------------------------------------------- vfclists · 2014-07-17 10:52 Delphi has a feature called component templates that enables you to layout and group a set of UI components grouped and laid out in a desired manner. You can the add the group to the component palette just as with a frame, and pick and place it when you need it. Does Lazarus have this facility? I think I have seen it before but I am not sure. ---------------------------------------------------------------------- vfclists · 2014-07-18 17:02 Quote from: vfclists on July 17, 2014, 12:52:33 pmDelphi has a feature called component templates that enables you to layout and group a set of UI components grouped and laid out in a desired manner. You can the add the group to the component palette just as with a frame, and pick and place it when you need it. Does Lazarus have this facility? I think I have seen it before but I am not sure. No reply in over 24 hrs. Is that a no? ---------------------------------------------------------------------- taazz · 2014-07-18 17:15 I do not know anything about component templates when were they introduced and what is the difference with the lcl frames (other than the various bugs that is)? ---------------------------------------------------------------------- vfclists · 2014-07-18 17:35 Quote from: taazz on July 18, 2014, 07:15:31 pmI do not know anything about component templates when were they introduced and what is the difference with the lcl frames (other than the various bugs that is)? There is a good example here http://delphi.wikia.com/wiki/Creating_Component_Templates There is also this interesting code-oriented alternative from Stack Overflow, which isn't a graphic component, but might apply better to Lazarus http://stackoverflow.com/questions/11243208/delphi-creating-component- template ---------------------------------------------------------------------- taazz · 2014-07-18 18:13 no nothing like exists as far as I know. ---------------------------------------------------------------------- vfclists · 2016-02-25 00:03 Still/not yet available in Lazarus? http://docwiki.embarcadero.com/RADStudio/Seattle/en/Creating_and_Using _Component_Templates ---------------------------------------------------------------------- FTurtle · 2016-02-25 01:43 Quote from: vfclists on February 25, 2016, 01:03:49 amStill/not yet available in Lazarus? http://docwiki.embarcadero.com/RADStudio/Seattle/en/Creating_and_Using _Component_Templates You can use it in Lazarus right now. The only shortcoming is you can not include pre-configured components in palette. Steps for creating: 1. Create new form. 2. Name it  _Templates_Form 3. Save as  _templates.pas 4. Be sure that form is not autocreated 5. Put buttoin on the form 6. Set properties (Anchors, Caption, ModalResult, etc.) 7. Save Usage: 1. Open _Templates_Form 2. Select your button (dialog, etc) 3. Right click / Copy 4. Go to form that you develop 5. Right click / Paste ---------------------------------------------------------------------- vfclists · 2016-02-25 09:51 Does this mean that all the component templates must be placed in only that form, ie does the form have to be named _Templates_Form and the file named _templates.pas, or can you have different _templates1.pas, _templates2.pas etc, with the proviso that the form is named _Templates_Form? Which versions of Lazarus have this feature? Quote from: FTurtle on February 25, 2016, 02:43:54 amQuote from: vfclists on February 25, 2016, 01:03:49 amStill/not yet available in Lazarus? http://docwiki.embarcadero.com/RADStudio/Seattle/en/Creating_and_Using _Component_Templates You can use it in Lazarus right now. The only shortcoming is you can not include pre-configured components in palette. Steps for creating: 1. Create new form. 2. Name it  _Templates_Form 3. Save as  _templates.pas 4. Be sure that form is not autocreated 5. Put buttoin on the form 6. Set properties (Anchors, Caption, ModalResult, etc.) 7. Save Usage: 1. Open _Templates_Form 2. Select your button (dialog, etc) 3. Right click / Copy 4. Go to form that you develop 5. Right click / Paste ---------------------------------------------------------------------- Graeme · 2016-02-25 10:02 Quote from: taazz on July 18, 2014, 07:15:31 pmI do not know anything about component templates when were they introduced They've been in Delphi since D5 or D6 if I remember correctly. ---------------------------------------------------------------------- JuhaManninen · 2016-02-25 10:19 You can do similar things using frames and form inheritance. ---------------------------------------------------------------------- vfclists · 2016-02-25 11:49 Quote from: JuhaManninen on February 25, 2016, 11:19:38 amYou can do similar things using frames and form inheritance. I use frames and embedded forms, but they seem overkill for simple controls. ---------------------------------------------------------------------- FTurtle · 2016-02-25 15:33 Quote from: vfclists on February 25, 2016, 10:51:41 amDoes this mean that all the component templates must be placed in only that form, ie does the form have to be named _Templates_Form and the file named _templates.pas, or can you have different _templates1.pas, _templates2.pas etc, with the proviso that the form is named _Templates_Form? Which versions of Lazarus have this feature? I mean that you can achieve the results that provide component templates without  component templates, using the existing features of IDE, but a little less convenient. You can simply copy any component from any form to another form with current (changed) properties. This works in all versions of Delphi and Lazarus. But in working form usually assigned event handlers and etc which you dont need. Therefore, I propose to use a separate form for pre-configured components. This form (or forms) will only serve as a container for pre-configured components, something like analog of palette. Name of the form and the number of forms may be arbitrary. After finishing of developing you may exclude that form from project.