Published properties and property editor... how to?

+Sorry if these questios are already answered.... i'm pretty sure i've seen somewhat related but after 40 mins of searching i'm unable to find it.+

Working with BDS2006

I have a component, derived from another not developed by me, that need to show some properties in the Inspector. They are:
- FONT (the standard Font thing: the ancestor does not have this property, and basically i need to "expose" the Font of a TLabel.
2 pictures ("OnPicture" and "OffPicture"). 
I'm just unable to make these properties appears in the Object inspector, and to make them working as the standard ones.
I'm slightly aware that this involve the use of a property editor, but i really need a lot of help about it.


Last question:
If instead of a component i build a TFrame, is publishing properties in a TFrame the same for a component, or there's some difference that i will need to know?
0
parduz
10/13/2009 8:26:47 AM
embarcadero.cppbuilder.writing 359 articles. 0 followers. Follow

2 Replies
1081 Views

Similar Articles

[PageSpeed] 5
Get it on Google Play
Get it on Apple App Store

> {quote:title=parduz zudrap wrote:}{quote}
> +Sorry if these questios are already answered.... i'm pretty sure i've seen somewhat related but after 40 mins of searching i'm unable to find it.+
> 
> Working with BDS2006
> 
> I have a component, derived from another not developed by me, that need to show some properties in the Inspector. They are:
> - FONT (the standard Font thing: the ancestor does not have this property, and basically i need to "expose" the Font of a TLabel.
> 2 pictures ("OnPicture" and "OffPicture"). 
> I'm just unable to make these properties appears in the Object inspector, and to make them working as the standard ones.
> I'm slightly aware that this involve the use of a property editor, but i really need a lot of help about it.
> 
> 
> Last question:
> If instead of a component i build a TFrame, is publishing properties in a TFrame the same for a component, or there's some difference that i will need to know?


Does this help you: http://www.fast-report.com/en/documentation/frx3dev/Writing%20a%20property%20editor.htm ?
--
Wiggle your BIG toe.
0
Olavi
10/13/2009 9:55:10 AM
<parduz zudrap> wrote in message news:172243@forums.codegear.com...

> - FONT (the standard Font thing: the ancestor does not have this property,
> and basically i need to "expose" the Font of a TLabel.

That is simply to do.  All you have to do is declare your own Font property 
in your descendant component, and have its getter/setter methods access the 
TLabel's existing Font property, ie:

{code:cpp}
class TMyComp : public TOtherComp
{
private:
    TFont* __fastcall GetFont();
    void __fastcall SetFont(TFont *Value);
    ...
__published:
    __property TFont* Font = {read=GetFont, write=SetFont};
};

TFont* __fastcall TMyComp::GetFont()
{
    return TheInheritedLabel->Font;
}

void __fastcall TMyComp::SetFont(TFont *Value)
{
    TheInheritedLabel->Font = Value;
}
{code}

> 2 pictures ("OnPicture" and "OffPicture").
> I'm just unable to make these properties appears in the Object inspector

Then you are not coding them correctly.  Please show your actual code.

> and to make them working as the standard ones.

There are no standard OnPicture/OffPicture properties.

> I'm slightly aware that this involve the use of a property editor

No, it does not.

-- 
Remy Lebeau (TeamB)
0
Remy
10/13/2009 11:16:23 PM
Reply: