[Lazarus] What for Adding lrs file to Package?

Zaher Dirkey parmaja at gmail.com
Tue Sep 13 13:46:31 CEST 2011


On Tue, Sep 13, 2011 at 1:04 AM, Mattias Gaertner <nc-gaertnma at netcologne.de
> wrote:

> On Tue, 13 Sep 2011 00:08:37 +0200
> Hans-Peter Diettrich <DrDiettrich1 at aol.com> wrote:
>
> > Zaher Dirkey schrieb:
> >
> > > After i added lrs file to the unit that register my controls, the icons
> > > showed.
> >
> > IMO it's a matter of {$R some.res}, what makes icons (and other
> > resources) usable in code. AFAIK the standard {$R *.res} only includes
> > the <programname>.lrs file,
>
> No. lrs files are simple include files. They are included as
> string constants.
>
>
In onther words, If adding lrs file to the package, it automatically add it
to the package source like this

initialization
  {$i myctrls.lrs}

I like also if i add myfile.inc file it also add it to the source, so i can
add my register function instead of create new unit for it.

procedure Register;
begin
  RegisterComponents(...);
  RegisterComponentEditor(...);
end;

Hmm, it is not good idea, how can i add units to uses in package source!?



> > that's why it worked when you put your icons
> > into that file. But it should be possible to add further {$R ...}
> > directives, to include other resource files as well.
>
> The $R directive supports icons in ico format. AFAIK it does not
> support png.
>

It is a feature i like to have it in FPC.

Best Regards

Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110913/d526c430/attachment-0003.html>


More information about the Lazarus mailing list