Difference between revisions of "Register (package)"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "Aa Lazarus package that is intended to be installed needs a '''Register''' procedure which declares all the packages components and corresponding files as well the tab onwhich...")
 
m (Fixed syntax highlighting)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Aa Lazarus package that is intended to be installed needs a '''Register''' procedure which declares all the packages components and corresponding files as well the tab onwhich te components are to be located.
+
A [[Lazarus Packages|Lazarus package]] that is intended to be installed needs a '''Register''' procedure which declares  
 +
* all the package components and corresponding files  
 +
* the tab on which the [[component]]s are to be located.
 +
 
 +
Related procedures/functions
 +
* [[RegisterUnit]]
 +
* [[RegisterPackage]]
 +
* [[RegisterComponents]]
 +
* [[RegisterPropertyEditor]]
 +
* [[RegisterIDEMenuCommand]]
 +
 
 +
<syntaxhighlight lang=pascal>
 +
unit RegisterMyPackage;
 +
 
 +
interface
 +
 
 +
  uses
 +
    LazarusPackageIntf, MyPackage1, MyPackage2, MyOtherPackage;
 +
 
 +
implementation
 +
 
 +
procedure Register;
 +
begin
 +
  RegisterUnit( 'MyTab', @MyPackage1.Register );
 +
  RegisterUnit( 'MyTab', @MyPackage2.Register );
 +
  RegisterComponents( 'OtherTab', [TOtherComponent1,TOtherComponent2] );
 +
end;
 +
 
 +
initialization
 +
  {$I myresourcefile.lrs}
 +
 
 +
  RegisterPackage( 'MyTab', @Register );
 +
end.
 +
</syntaxhighlight>
 +
 
  
 
[[Category:Packages]]
 
[[Category:Packages]]
 +
[[Category:Component Creation]]

Latest revision as of 08:38, 25 February 2020

A Lazarus package that is intended to be installed needs a Register procedure which declares

  • all the package components and corresponding files
  • the tab on which the components are to be located.

Related procedures/functions

unit RegisterMyPackage;

interface

  uses 
    LazarusPackageIntf, MyPackage1, MyPackage2, MyOtherPackage;

implementation

procedure Register;
begin
  RegisterUnit( 'MyTab', @MyPackage1.Register );
  RegisterUnit( 'MyTab', @MyPackage2.Register );
  RegisterComponents( 'OtherTab', [TOtherComponent1,TOtherComponent2] );
end;

initialization
  {$I myresourcefile.lrs}

  RegisterPackage( 'MyTab', @Register );
end.