Hi, I am having some derivatives from Standardcontrols and try to include them into lazarus (had them im Delphi b4).
The components are in two units. Each unit contains a register procedure.
I haven't been able to install them in the way recommended here:
http://wiki.lazarus.freepascal.org/How_to_Write_a_Lazarus_ComponentMaybe the wiki needs some update.
What I did:
From MainMenu: Package -> New Package
+ named it myComponents.pas
+ Add the two units in question
+ Add New Requirement LCLBase
+ Compile
+ Install
Installing exits with a message:"The package does not have any procedure register..." (or very similar)
+ Save
+ Exit Lazarus
Edit the myComponents.pas-file for the new components:
Insert the following lines into procedure register
procedure Register;
begin
RegisterUnit(myUnit1', @myUnit1.Register);
RegisterUnit('myUnit2', @myUnit2.Register);
end;
Edit the myComponents.lpk-File and insert
<HasRegisterProc Value="True"/>for each used file.
<Files Count="2">
<Item1>
<Filename Value="myUnit1.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="myUnit1"/>
</Item1>
<Item2>
<Filename Value="myUnit2.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="myUnit2"/>
</Item2>
</Files>
Then restart Lazarus, open the package and compile it. Finally I could install it.
I wonder why those manual steps are required and why lazarus can't find the register-procedure by itself.Next problem is the icons for the new components.
I have created a *.lrs file using lazres.
Inserting the *.lrs-File into the package didn't get me anywhere.
So again
+exit Lazarus
+manually editing the myComponents.pas-File
+inserting LResources into the uses clause
+inserting {$i myComponents.lrs} in the initialization
+start Lazarus open and compile the component
The last step is undone - i.e. LResources is removed from the uses clause and the {$i myComponents.lrs} is removed as well.
How do I get my icons?