Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I hide inherited published properties in a runtime designer?

I am using a property inspector (for example the nice JvInspector in the JVCL library) which nicely lets me view and edit the published properties of my class 'TMyClass'. TMyClass descends from TFrame and has a few published properties that are the only ones that I require to see and edit. Of course TFrame has lots of VCL properties, all published, which I see too.

How can I suppress the ancestor property RTTI and just leave my own published properties? I'm using XE3 so the world is my oyster... maybe.

like image 572
Brian Frost Avatar asked Jan 24 '13 11:01

Brian Frost


1 Answers

Derive your class from TCustomFrame, and from your class publish only those properties you'll need. Although you can't basically hide already published properties, there's a lot of them that are protected and that will stay hidden by using of TCustomFrame class as the ancestor for your own class.

That's how almost every control in VCL is composed in the class hierarchy. For instance, TLabel is a TCustomLabel descendant, whose only role in the class chain is to publish properties you can see in the Object Inspector.

like image 197
TLama Avatar answered Nov 15 '22 08:11

TLama