ThemeClasses

Unofficial Content

Theme Editor Classes

Starting from the "Classes" node of the Theme Editor, a group of predefined classes corresponding to GeneXus controls is displayed.

Each class has a group of properties that the designer can configure, and constitutes a "design" for a type of GeneXus control (there is an exception with the "Messages" Class, which is not a GeneXus control, the meaning of this class is explained further in this document).

A class can be assigned to a control in design time, and in runtime through the "Class Property."

Predefined Classes

1. Attribute
2. Button
3. Error Viewer
4. FreeStyle Grid
5. Grid
6. HyperLink
7. Image
8. Messages
9. Table
10. Textblock
11. Form

Messages Class

The Messages class is used in order to configure the settings of web client side validation messages displayed on the screen.

ErrorMessages:All "error" rules are associated to this class
WarningMessages: All "msg" rules are associated to this class

In order to use it, you have to configure the class properties, as well as any other class. The difference is that you haven´t any GeneXus control to associate to these classes. The association to ErrorMessages and WarningMessages is automatic (to the error and messages rules respectively).

themeclasses01

Special classes for buttons

There are specific button classes, corresponding to those that are automatically generated by GeneXus in Web Transactions and Web Prompts.
When such objects are created, the buttons are associated to the corresponding classes.
These classes are direct descendants of the "SpecialButtons" class, child of the "Button" class:

· BTnCancel
· BtnCheck
· BtnDelete
· BtnEnter
· BtnFirst
· BtnGet
· BtnHelp
· BtnLast
· BtnNext
· BtnPrevious
· BtnRefresh
· BtnSelect

Special classes derived from Attribute

If you define a class in the Theme Editor (named X), derived from Attribute, four additional classes are created:

1. ReadonlyX (descendant of X)

BLOBS:

2. BlobContentX (descendant of X)
3. ReadonlyBlobContentX (descendant of BlobContentX)

4. BlobInputX

BlobContentX and BlobInputX are classes asigned in runtime to blob controls.
A blob control consists of the contents and the upload control (edit plus button) If the X class has been associated to the blob in design time, the BlobContentX class is assigned to the content, and the BlobInputX class is assigned to the upload control.

The settings cannot be seen in design time, only in runtime.
The ReadonlyBlobContentX class is assigned in runtime to readonly blobs, that were associated in design time to the X class.

If a class is renamed (a father class), all those classes which were mentioned before, will be renamed accordingly. For instance, if X is renamed to Y, you will have:

1. ReadonlyY

BLOBS:

2. BlobContentY
3. ReadonlyBlobContentY
4. BlobInputY

Derived Classes

It is possible to create classes derived from predefined classes. The process to define a class means for the developer to right click on the father class, click "New Class", assign it a name and to set up the properties corresponding to it.

Children or derived classes remain specifically linked in an inheritance relation to the classes they derive from. Consequently, modifications made in the parent class will be reflected in the children classes, with some exceptions. Modifications consist in changing the values of some of the classes properties.

The hierarchy at editor classes level is not conceptually related to any classes relation at CSS level. It is an "inheritance" relation aimed at providing the user with greater facilities for the maintenance task.

The way to identify if the value of a property is inherited or not, is that in one case is in bold, otherwise it isn´t.
The value of a property appears in bold when it is not inherited, otherwise, if it inherits the value from it parents, it doesn´t appear in bold.

If a property of a class is Inherited, this means that its value reflects the value of the same property of the parent class. I.e.: any change made to the parent class will result in a change in the same property of the child.

On the other hand, not to inherit implies that a change made to the property in the parent class will not be reflected in the child class. Inheritance of properties' values is lost when they are altered in the children classes.

Errors and Warnings

If you use a class associated to a control; for instance "Attribute" class, if an error or warning occurs, you can personalize further how the error or warning is displayed. At runtime, the class will be modified with a 'warning' or 'error' prefix and a new class will be assigned, for the case ErrorAttribute or WarningAttribute .

As a rule, consider that the pattern is the following

  • Errors:  "Error" + ClassName
  • Warnings: "Warning" + ClassName

Default Class

It is possible to define a class as default. Therefore, when in GeneXus we associate a "theme" to an object, a default class is associated to each control defined in the object. The default class assigned is the one that was defined with the "Set as GeneXus Default".

If the default class is not explicitly indicated, it will be the class predefined by GeneXus .

A default class is identified in the Themes Editor by a blue triangle on the right top corner of the class icon.

themeclasses02

Inheritance

If the value of the property of a class is marked as NOT Inherited (it is marked as bold), it is possible to revert the situation.
By clicking with the right button on the corresponding property, the "Inherit Value" menu appears. By selecting this option, the property will inherit the value of the same property of the parent class.

themeclasses03

The class derivation, and particularly the "heritage," provides the user with facilities in the maintenance task of Classes and clarity in the design.

For example, a class "Bullet", derived of textblock, is defined, with the purpose of defining texts properties in lists with bullets.

Let us suppose now that you want another class for the texts nested in those associated to the "Bullet" class, and you want them to have the same characteristics that the "Bullet" class, except for the indentation. We will call this class "SubBullet" and create it as a child of "Bullet". This class will only differ from its parent in the "TextIndent" property. Therefore, that will be the only property that will not be inherited, and the only property that, having been modified in the parent, will not be reflected in the "SubBullet" class.