Recent

Author Topic: Package Configuration  (Read 2778 times)

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Package Configuration
« on: September 27, 2016, 10:44:17 am »
Hi all,

I just installed a package, and was wondering where to find the new component.
After searching a while, I found it in MISC.  But why ?

I appended a screenshot, the field marked with a blue frame is empty.
Does a component by default go into MISC ?

When pressing the HELP button, I get the "IDE Window: IDE Options Dialog" website
Code: Pascal  [Select][+][-]
  1. http://wiki.lazarus.freepascal.org/IDE_Window:_IDE_Options_Dialog
which does not help ..  :'(
« Last Edit: September 27, 2016, 10:46:57 am by PeterX »
usually using latest Lazarus release version with Windows 10

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Package Configuration
« Reply #1 on: September 27, 2016, 12:13:08 pm »
There is no default page where components added to the component palette are placed.

A design package will include a Register procedure for the components that get installed.
This in turn uses the standard RegisterComponents procedure:

Code: Pascal  [Select][+][-]
  1. procedure RegisterComponents(const Page: string;
  2.   ComponentClasses: array of TComponentClass);    

where the Page parameter is a string (such as 'Misc') where the installed component is placed. This string is chosen by the package developer, and if s/he is any good they will document which page is used. If Page is blank ('') the component is not installed at all.

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: Package Configuration
« Reply #2 on: September 27, 2016, 12:33:10 pm »
This is the content of the Package PAS file

Code: Pascal  [Select][+][-]
  1. { This file was automatically created by Lazarus. Do not edit!
  2.   This source is only used to compile and install the package.
  3.  }
  4.  
  5. unit MultiFramePackage;
  6.  
  7. interface
  8.  
  9. uses
  10.   MultiFrame, ChildFrame, LazarusPackageIntf;
  11.  
  12. implementation
  13.  
  14. procedure Register;
  15. begin
  16.   RegisterUnit('MultiFrame', @MultiFrame.Register);
  17. end;
  18.  
  19. initialization
  20.   RegisterPackage('MultiFramePackage', @Register);
  21. end.    

I expected there would be a category "MultiFramePackage" afterwards.
But the component appears in MISC (the next one after SYSTEM in the component palette).
« Last Edit: September 27, 2016, 12:36:30 pm by PeterX »
usually using latest Lazarus release version with Windows 10

PeterX

  • Sr. Member
  • ****
  • Posts: 404
Re: Package Configuration
« Reply #3 on: September 27, 2016, 12:40:16 pm »
Oh .. yes .. found now ..  :(

Code: Pascal  [Select][+][-]
  1. procedure Register;
  2. begin
  3.   RegisterComponents('Misc',[TMultiFrame]);
  4. end;  
usually using latest Lazarus release version with Windows 10

 

TinyPortal © 2005-2018