Hi,
Is there a way to modify the standard “file -> new unit” code template that is used? Or is what we see hard-coded into the Lazarus IDE executable?
I'm using Lazarus 1.7 r52715 FPC 2.6.4 x86_64-linux-gtk 2
Regards,
Graeme

Mailing lists / lazarus / 2017-04
4 messages · 2 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
Is there a way to modify the standard “file -> new unit” code template that is used? Or is what we see hard-coded into the Lazarus IDE executable?
I'm using Lazarus 1.7 r52715 FPC 2.6.4 x86_64-linux-gtk 2
Regards,
Graeme
Hi, Is there a way to modify the standard “file -> new unit” code template that is used? Or is what we see hard-coded into the Lazarus IDE executable?
Right click in the IDE coolbar on the "New unit" button to select another template.
A package can register other templates.
Mattias
Mattias Gaertner wroteRight click in the IDE coolbar on the "New unit" button to select another template.
I meant I want to modify the code that Lazarus IDE gives once I click “File -> New Unit”. I don't want a completely different template. eg: this is the default I see now...
====================
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
implementation
end.
===================I want to change that so the default has difference uses clauses, defines the text encoding of the source file etc. Where does the above code come from? Hard-coded?
eg:
MSEide has a ‘templates’ folder where all such auto-generated code is defined. Nothing is hard-coded in the MSEide executable. From your answer I assume Lazarus doesn’t do anything like this, and instead hard-codes such default unit templates. :-/
A package can register other templates.
I'll wait on your reply before I delve into this.
Regards,
Graeme
[...] I want to change that so the default has difference uses clauses, defines the text encoding of the source file etc. Where does the above code come from? Hard-coded?
Yes, components/ideintf/projectintf.pas TFileDescPascalUnit It creates the code from various IDE options and packages can define their descendants to replace whole or parts.
It should be easy to add a "user unit" template, that loads the source from a file and replaces some macros.
Mattias