Attributes

IUP - Portable User Interface

Attributes

Attributes are used to change properties of elements. Each element has a set of attributes that affect it, and each attribute can work differently for each element. Depending on the element, its value can be computed or simply verified. Also it can be internally stored or not.

The attribute is first checked at the element specific implementation in the driver (if mapped) or in the custom control. If not defined then it checks in the hash table. If not defined in its hash table, the attribute will be inherited from its parent and so forth, until it reaches the dialog. But if still then the attribute is not defined a default value for the element is returned (the default value can also be NULL).

Attribute names are always upper case, lower case names will not work. But attribute values like "YES", "NO", "TOP", are case insensitive, so "Yes", "no", "top", and other variations will work.

Only a few attributes are not inherited: "TIP", "ZORDER", "TITLE", "VALUE", "ALIGNMENT", "X", "Y", "RASTERSIZE" and "SIZE".

When an attribute is set it is always stored at the hash table unless the driver disables the storage. If the value is NULL, the attribute will be removed from the hash table. Then the driver or the custom control is updated. Finally the attribute is also updated for the children of the element in the driver if they do not have the attribute defined in their own hash table.