Member attributes: VariantOf

This attribute determines the project member to override by a particular variant member.








The attribute VariantOf determines the original member to override by a particular class, autoobject, constant, bitmap resource or font resource variant member. Once overridden, the variant member can retrospectively adapt, extend or even completely substitute the original member. For example, a class variant can modify the implementation of the original class member.

The derivation of variants provides the fundamental technique to manage several product and design variants within one and the same GUI application. The selection of the appropriate variant occurs automatically depending on the condition specified in the VariantCond attribute of the corresponding variant member.

The value of the attribute VariantOf must be composed of two identifiers: the name of the unit containing the original member definition and the name of the member itself, both separated by :: (double colon). It is also possible for one variant member to be derived from another variant resulting in a forked variant hierarchy similar to the inheritance hierarchy of classes.

Modify the attribute

To inspect or modify the value of a VariantOf attribute, select first the affected class, autoobject, constant, bitmap resource or font resource variant member. Thereupon, the attribute is listed in the middle area of Inspector. Please note the available assistant you can activate by clicking on the button right to the attribute. The assistant lists all members, the variant member may override: