Hi!
Hi!
how to hide a property in object inspector?
i have my custom components for my project. in the base one i have a complex public property which i need to make a sort of serialize using rtti and so on...
so i created ad hoc "myproperty_asString" published ,with getter and setter, to permit me to do this need.
it works fine! but, for my personal wish, i want to hide this property in object inspector, because it's should use only by code....
only way i find is to use UnlistPublishedProperty , but i should use it on every derivated component (a lot ... ) .
there's any other way?
thanks
how to hide a property in object inspector?
i have my custom components for my project. in the base one i have a complex public property which i need to make a sort of serialize using rtti and so on...
so i created ad hoc "myproperty_asString" published ,with getter and setter, to permit me to do this need.
it works fine! but, for my personal wish, i want to hide this property in object inspector, because it's should use only by code....
only way i find is to use UnlistPublishedProperty , but i should use it on every derivated component (a lot ... ) .
there's any other way?
thanks
You cannot undo things that are inherited. What you can do is not make that property published but overwrite the streaming mechanism of your component for instance by using http://docwiki.embarcadero.com/Libraries/en/System.Classes.TPersistent.DefineProperties
ReplyDeletei hoped in a easy way loke attribute [hide] just to do this ... well ... maybe it can stay!
ReplyDeleteYou could just make your property public instead of published:
ReplyDeleteNot visible in OI but accessable via source code.
Use the TCustomXYZ pattern (with unpublished properties) to allow descendants to publish them selectively.
ReplyDeleteTake a look at selection editor (ISelectionpropertyFilter). For example see how TMobileFormFilter works at FmxReg.pas in Source\Property Editors
ReplyDeleteFabian S. Biehn must be published to r/w it via rtti
ReplyDelete