Hello,
i try to create new component with a TShape fields attached. It inherits from TMemo and in fact it is a simple memo with shape located under, working as a colour indicator (you write some text and colour is changing, nevermind

).
I have some start (with static shape placement on component create) but after component installation when i put my component on the form the tshape element is not visible. What can I do to make it be visible below my memo?
This is what i have now:
unit DMemo;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
type
{ TDMemo }
TDMemo = class(TMemo)
private
FShape: TShape;
protected
{ Protected declarations }
public
constructor Create(AOwner: TComponent); override;
published
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Experimental',[TDMemo]);
end;
{ TDMemo }
constructor TDMemo.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
if FShape <> nil then Exit;
FShape := TShape.Create(self);
FShape.Visible:= Visible;
FShape.Parent := Parent;
FShape.Top:=10;
FShape.Width:=100;
FShape.Left:=10;
FShape.Height:=20;
FShape.Shape:= stRectangle;
FShape.Pen.Style:= psSolid;
FShape.Pen.Color:= clRed;
end;
end.
I work with Lazarus 1.2.4 and FPC 2.6.4 on Ubuntu 14.04.
Best!