[Lazarus] How to add your own 'New Project' template?

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Aug 20 12:43:31 CEST 2008


On 8/19/08, Tom Verhoeff <T.Verhoeff at tue.nl> wrote:
>
>   1. What is the default location for the project templates?

Under my system (Linux) in was $HOME/.lazarus/templates/

>From this I gather it defaults to wherever the Lazarus settings folder
is plus the templates directory.  Obviously this location is
customizable via Tools | "Project template options".


>   6. When creating a New Project from a template, a dialog window appears
>     to set the project name and the directory name, and also to
>  set additional variables.

Oh, and on my system the label captions don't fit and even if I resize
the dialog, only the edit boxes resize, the captions always stay
partially visible. Lazarus compiled with GTK1.


>   7. It is not clear to me what the requirements are for naming files
>     in the template, and how these names get changed when the template
>  is instantiated.  Should I put files like project.ini, project.lpi,
>  project.pas, unit1.pas in the template directory,

Yes

> and will
>  project.{lpi,pas} be renamed depending on the name chosen by
>  the user when instantiating the template?

Good question!  I was wondering the same thing and it seems it doesn't
rename the files. They are copied as-is. Which makes we wonder what
the Project Name variable is used for?

I know in Pascal you can't rename the unit or program name inside the
file and yet the file itself still has the old name. I always thought
this strange of Pascal, but that's the rules of Pascal!  Physical
filename and 'program' or 'unit' line must match.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the Lazarus mailing list