Created a package and two components.
Both are derived from TPanel - one with an added scrollbar, the other width an added label.
Mostly to learn, but also for later serious use.
Created 2 24x24 .png's, converted to .lrs
Created a page (Tools/Options/Environtment/Component Palette) for my components.
It all compiles just fine.
Without errors that is.
In the package editor, in registered plugins section, when the .pas file is selected, one of the components has a wrong icon (the default one), but is on the right page, the other has the designated icon, but is not set to any page.
Installing and (re)compiling the IDE, only the one with the wrong icon shows up on the designated page - the other one, is nowhere to be found.
Hope someone can help me with this...
Apart from the additional componenets, both files are identical (And basically generated by Lazarus itself):
--------------
unit LabelListContainer;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, StdCtrls, ExtCtrls, Graphics;
type
TLabelListContainer = class(TPanel)
private
FScroller : TScrollBar;
FscrTop : integer;
protected
public
property scrTop : integer read FScrTop write FScrTop default 16;
constructor Create(TheOwner: TComponent); override;
published
property Scroller : TScrollBar read FScroller;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Mine',[TLabelListContainer]);
end;
constructor TLabelListContainer.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FScroller := TScrollBar.Create(Self);
FScroller.Parent := Self;
FScroller.Kind := TScrollBarKind.sbVertical;
FScroller.Name := 'Scroller';
FScroller.Align := TAlign.alRight;
FScroller.BorderSpacing.Top := scrTop;
FScroller.SetSubComponent(true);
FScroller.ControlStyle := FScroller.ControlStyle - [csNoDesignSelectable];
FScroller.Enabled := false;
end;
initialization
{$I TLabelListContainer.lrs}
end.
--------------
unit LabelList;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, StdCtrls, ExtCtrls, Graphics;
type
TLabelList = class(Tpanel)
private
FHeadLabel : TLabel;
function GetHeader : string;
procedure SetHeader(head : string);
protected
public
property HeadText : string read GetHeader write SetHeader;
constructor Create(TheOwner: TComponent); override;
published
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Mine',[TLabelList]);
end;
constructor TLabelList.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
FHeadLabel := TLabel.Create(Self);
FHeadLabel.Parent := Self;
FHeadLabel.Align := TAlign.alTop;
FHeadLabel.Font.Style := [fsBold];
FHeadLabel.Name := 'HeadLabel';
FHeadLabel.Caption := 'Header';
FHeadLabel.SetSubComponent(true);
FHeadLabel.ControlStyle := FHeadLabel.ControlStyle - [csNoDesignSelectable];
end;
function TLabelList.GetHeader : string;
begin
GetHeader := FHeadLabel.Caption;
end;
procedure TLabelList.SetHeader(head : string);
begin
FHeadLabel.Caption := head;
end;
initialization
{$I labellist.lrs}
end.