Characteristics (continued):
Class inheritance
The class hierarchy implicitly defines a class inheritance. A class that is a son of another class will inherit its parent-class' properties as long as a specific property has not been modified in the son. This means that the changes in a property at a parent-class level will be reflected in the sons, unless that property has been previously modified in the son, in which case it would lose the quality of inherited value.
Note: The "TagsHTML" inheritance concept does not exist. The HTML Tags hierarchy is used for representing the nesting of the tags in the generated HTML.
Theme allocation: Once a theme has been defined, it may be associated with the knowledge base, the model, or a specific object. In any of the cases, the Class property is available for the object's controls. At that point, the control may be assigned, either upon designing time or upon execution time, some of the classes defined in the associated theme, which are compatible with the control. GeneXus knows what kind of Classes apply to what types of objects, thus preventing the user from assigning classes to an object with which they are not compatible. There is also the concept of default class, in which, when a theme is associated to an object in GeneXus, each control defined in the object is associated to a class by default; this is a class that has been defined with the Set Default.
Control properties
If a control is somehow linked to a theme (either because the theme has been assigned to the object containing it, to the model or to the knowledge base), it will be assigned to a class (originally, the by-default class, as explained on the previous point, or the one selected by the user). However, the control's properties configured at control level itself will have priority over the properties defined in the corresponding class.
General Advantages
- A control's class may be changed in run-time to another compatible class.
- A class may be associated with a control and change some properties at control level itself (for example, for a font not to take it from the class, but from the control's property). This may be done on design or run-time.
- The program may be running, while entering into the themes editor, changing some properties, and seeing the changes by making a refresh of the browser.
- It will not be necessary to configure controls' properties. Adding classes and referencing them will suffice.
Compatibility with previous GeneXus versions
In the conversion of a knowledge base from GeneXus version 7.5 into the Olimar version, unless you are planning to use themes within this new, converted knowledge base (KB), it is not necessary to make any other change apart from the automatic conversion process. In a 7.5 knowledge base, many of the controls that are included in the objects will have their properties configured. These configurations have been kept in the Olimar version.
This means that the compatibility between version 7.5 and the Olimar version is kept even though themes are not defined in the converted KB.
Moreover, if the new themes object is used, which is recommended due to the advantages brought about by using this feature, it is necessary to keep in mind that the configuration of a control's properties is taken according to the following rules:
- If a property is not configured as default (if it has an asterisk in gray), the properties will be taken from the control, and not from the class associated to the control.
- If a property is configured as default (if the asterisk is in black), the properties will be taken from the class associated to the control.
This means that associating a theme to an object that used to belong to the GeneXus version 7.5 (either directly to the object or to the model or to the kb to which it belongs) implies a necessary configuration at theme level of properties from those classes assigned to controls that remain with settings by default.
This is due to the fact that the values of those properties from the moment that they are by default at control level - will be taken from the class assigned to the control, from the theme associated to the object containing it.