[Lazarus] Installing custom control in Lazarus - where can I find it?

Bo Berglund bo.berglund at gmail.com
Thu Aug 27 22:51:00 CEST 2020

I am (again) trying to port a Delphi application to Lazarus/FPC.
This time I need a customized version of TListView, which I converted
to use in Lazarus back in 2018.
See thread titled:
"Converting a component package Delphi->Lazarus using built-in

I found the files for the converted component on my disk as:
easylistview.lpk THis is the package file 

No using Lazarus 2.0.8 and FPC 3.0.4 I did the following:
- Started Lazarus
- Told it to start a new project (to not interfere with my current
- Package/Open package file
- Navigated to the easylistview.lpk file
- Clicked the Compile button. Finished successfully.
- Use/Install. Lazarus started to rebuild itself
- No visible errors shown
- Lazarus restarted

Now, how do I find the component I just installed so I can use it?
I expected a new tab named AGI to appear with the component inside of
it but I cannot find it...

This is what is (or rather was, see below) in the register procedure
in EasyListView.pas:

procedure Register;
	RegisterComponents('AGI', [TEasyListView]);

And this is the lpk file content after the compile/install:

<?xml version="1.0" encoding="UTF-8"?>
  <Package Version="4">
    <PathDelim Value="\"/>
    <Name Value="EasyListView"/>
    <Type Value="RunAndDesignTime"/>
      <Version Value="11"/>
      <PathDelim Value="\"/>
        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    <Files Count="1">
        <Filename Value="EasyListView.pas"/>
        <UnitName Value="EasyListView"/>
    <RequiredPkgs Count="1">
        <PackageName Value="IDEIntf"/>
      <UnitPath Value="$(PkgOutDir)"/>
      <Version Value="2"/>
    <CustomOptions Items="ExternHelp" Version="2">
      <_ExternHelp Items="Count"/>

Now the strangest thing is that in this process Lazarus has completely
mangled the EasyListView.pas source file so it now only has this
content wheras the original was 27 kbytes....:

{ This file was automatically created by Lazarus. Do not edit!
  This source is only used to compile and install the package.

unit EasyListView;

{$warn 5023 off : no warning about unused units}



procedure Register;

  RegisterPackage('EasyListView', @Register);

So it is overwriting the source file for the component with a
basically empty file, which it successfully installs and is nowhere to
be found....

Apparently I am doing something completely wrong here, but what?

Bo Berglund
Developer in Sweden

More information about the lazarus mailing list