2.2 Inheritance of Attributes
Attribute values at objects are always inherited from the underlying model. These attribute values can then be overwritten by new values. Doing so, the importance of attributes increases gradually from default values to model values to instance values. For example, when an instance is to have a certain color, the color is defined at the corresponding instance. Thus the instance gets the corresponding color, regardless of what has been defined in the underlying models.
Above the defaults which are defined in the dialog, there are Dialog Manager default values representing the values for individual attributes. The Dialog Manager can internally work with these attributes. You should never rely on these values when programming the dialog, since the values can always be re-adapted. In addition, there are also default values in the window system for certain attributes. Those default values become important when no value for the attribute was set neither at the instance nor at the model or the default. This is useful especially with layout attributes such as the background color or the font, as the user can change the corresponding values by system settings. The following diagram illustrates the hierarchy of these attributes.
If an instance is now made visible on the screen, an object is created which contains the attributes of the instance and the underlying model. The hierarchy is always searched through in the minimum scale necessary. As soon as there is a value defined for an attribute, the search for this attribute is cancelled and the found value is taken over. In the following table the columns represent the attributes, and the lines indicate the values of the used defaults, models, and instances The last line represents the attribute values for the shown object.
attribute 1 |
attribute 2 |
attribute 3 |
attribute 4 |
attribute | |
---|---|---|---|---|---|
window system |
FS |
FS |
|
|
FS |
internal default |
|
|
ID |
ID |
ID |
model 1 |
M1 |
|
|
|
|
model 2 |
|
|
M2 |
|
|
model 3 |
|
|
|
|
M3 |
instance |
|
|
|
I |
|
indicated value |
M1 |
FS |
M2 |
I |
M3 |