[Lazarus] Custom Form design time rendering problem

Horacio Jamilis hjamilis at pymesoft.com.ar
Tue Jun 2 00:01:13 CEST 2015


I am migrating a Delphi system to Lazarus.

Each object of the system is represented in a TFrame.

The declaration of TSystemObject (base object/frame) is:

   TSystemObject = class(TObject)
   TSystemObject = class(TFrame)
     constructor Create(AOwner : {$ifdef 
BASE_SYSTEMOBJECT_ON_OBJECT}TObject{$else}TComponent{$endif}); {$ifdef 
     constructor CreateObject(aOwner : {$ifdef 
BASE_SYSTEMOBJECT_ON_OBJECT}TObject{$else}TComponent{$endif}{; const 
aSystemData : TSystemData = nil}); virtual;

The conditional BASE_SYSTEMOBJECT_ON_OBJECT make it act as a frame at 
design time, and as a TObject at runtime. Then at runtime I create the 
designed frame by code when required.
In Delphi (any version) it works. In Lazarus, I can not see the 
components at design time (I don't know at runtime because I did not 
finished the porting and does not compile yet).

I registered it with 
The registration went well! I installed the package ok. The properties 
of the TSystemObject are on the object inspector as expected.

When I open a unit with a SystemObject created in Delphi, it opens, but 
the components inside it (in the frame) are not rendered at design time.
I can select them with a mouse clic, and the properties of them are ok 
in the object inspector, but the component is not visible on the form.
Even if I add a TButton, it is not visible.

What could be wrong?

Using .dfm in place of .lfm could be a problem?

Then I changed the base class to TForm (in place of TFrame), and 
registered it as in the custom form example with 
This worked as it appears in the new menu dialog. How to do this with 

Thank you!

Horacio Jamilis
Buenos Aires, Argentina

More information about the Lazarus mailing list