Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Advanced component design question
Thu, Oct 23 2008 5:37 PMPermanent Link

Sean
Hi,

Has anyone out there successfully implemented a nested component
property for use in the IDE?

Examples of what I am trying to do from the VCL are

TControl.Margins
TControl.Padding
TControl.Font

These properties are all themselves objects descended from TPersistent.
The properties appear in the object inspector as a nested property.

I've had no problem creating these type of properties and having them
come up in the object inspector. I can also edit them in the object
inspector with no problem. However, the streaming doesn't write the
values to the DFM file. I've looked in the source code for TControl and
can find nothing unusual about any of these properties. I suspect that
something needs to be done to register these sub-properties but I can't
find the VCL source code that registers the standard components which
probably holds the clue how to tell a nested property like Margins is
told to save to the stream.

Anyone know where this source is or have a solution?


Thanks,

Sean
Thu, Oct 23 2008 5:38 PMPermanent Link

Sean
Forgot to mention - I am doing this in Delphi 2007, but it is probably
the same in any version.

Sean wrote:
> Hi,
>
> Has anyone out there successfully implemented a nested component
> property for use in the IDE?
>
> Examples of what I am trying to do from the VCL are
>
> TControl.Margins
> TControl.Padding
> TControl.Font
>
> These properties are all themselves objects descended from TPersistent.
> The properties appear in the object inspector as a nested property.
>
> I've had no problem creating these type of properties and having them
> come up in the object inspector. I can also edit them in the object
> inspector with no problem. However, the streaming doesn't write the
> values to the DFM file. I've looked in the source code for TControl and
> can find nothing unusual about any of these properties. I suspect that
> something needs to be done to register these sub-properties but I can't
> find the VCL source code that registers the standard components which
> probably holds the clue how to tell a nested property like Margins is
> told to save to the stream.
>
> Anyone know where this source is or have a solution?
>
>
> Thanks,
>
> Sean
Thu, Oct 23 2008 6:48 PMPermanent Link

Sean
The problem appears to have been fixed by linking DesignIDE.DCP into the
package in the requires clause.


Sean wrote:
> Forgot to mention - I am doing this in Delphi 2007, but it is probably
> the same in any version.
>
> Sean wrote:
>> Hi,
>>
>> Has anyone out there successfully implemented a nested component
>> property for use in the IDE?
>>
>> Examples of what I am trying to do from the VCL are
>>
>> TControl.Margins
>> TControl.Padding
>> TControl.Font
>>
>> These properties are all themselves objects descended from
>> TPersistent. The properties appear in the object inspector as a nested
>> property.
>>
>> I've had no problem creating these type of properties and having them
>> come up in the object inspector. I can also edit them in the object
>> inspector with no problem. However, the streaming doesn't write the
>> values to the DFM file. I've looked in the source code for TControl
>> and can find nothing unusual about any of these properties. I suspect
>> that something needs to be done to register these sub-properties but I
>> can't find the VCL source code that registers the standard components
>> which probably holds the clue how to tell a nested property like
>> Margins is told to save to the stream.
>>
>> Anyone know where this source is or have a solution?
>>
>>
>> Thanks,
>>
>> Sean
Image