|
|
|
|
|
- Overview
- How to link a control to an existing style?
- How to create a style?
- Creating a style from the control description (recommended)
- Creating a style from the window for style management
- Modifying and overriding the style of a control
- Limitations regarding style overrides
WINDEV/WINDEV Mobile field styling
As soon as it is created, a control is associated with a style. A control style corresponds to: - field appearance (background color, font, outline, etc.),
- field appearance information (background image, size, etc.).
When it is created, the control can be: - associated with a style (a style from the custom style sheet or a style from the style sheet of the skin template for example).
- associated with no style (the control is dissociated). In this case, the control uses the style proposed by default.
How to link a control to an existing style? The style of a control can be chosen: - directly via the style selection window ("Choose a style" option in the field context menu).
- or via the field description window ("Style" tab, "Choose another style" link).
When validating the selected style, the style is linked to the control. The selected style is copied to the control and the control stores the information regarding the linked style (style identifier, version of the style used, etc.). Note To link several fields of the same type to the same style, simply select the fields (e.g. by holding down the Ctrl key) and open the style selection window via the selection context menu. Creating a style from the control description (recommended) A new style can be created from an existing field: simply modify its style to obtain the desired new style. To create a style from a control description: - Open the control description.
- On the "Style" tab, make the necessary style changes.
- Create a new style based on the changes you have made:
Two methods are available:
- Click on the "Convert to new style" link.
- Scroll down the
menu and select "Transform into new style".
- Enter the name of the style and, if necessary, the style sheet concerned.
- Confirm.
Note: If the project is already in the SCM, creating a style sheet means extracting the style sheet, updating it or creating a .sty file if necessary. If the style sheet was created, it is added to the SCM. Creating a style from the window for style management To create a style from the window for style management: - Create a control ("Creation" pane) in a window of your project. For example, to create a new button style, create a button control.
- Display the window for editing the style sheets ("Choose a style" in the context menu).
- Select a style and display its context menu. Select the "New blank style" option. The style description window appears.
- Specify the desired style options ("General" and "Style" tabs) and validate. This new style is automatically added to the custom style sheet of the current project. This style can be applied to the controls of the same type in all the projects that use this style sheet.
Modifying and overriding the style of a control As soon as a style modification is made on a control linked to a style, one or more overrides are created. An override is used to modify one or more characteristics of the style while remaining linked to the style of the control for all the other characteristics. Therefore, if the style linked to the overridden control is modified: - The modifications that do not affect the overridden characteristics are updated.
- The control keeps the overridden characteristics.
For example, a static control uses the "Header" style. The font for this style is black by default. For a specific window, the color of the font must be red. To avoid creating a new style and to continue to follow the evolution of the "Header" style, simply change the font color in the style description: the field style is automatically overridden.
The style of the control is automatically updated when validating the description window of the control. The override is taken into account. If the "Header" style is modified, all the attributes of the style will be updated except for the color of the font. Note Clicking on the number of overrides opens a window listing the overrides performed. It is possible to: - Cancel an override.
- Restore an override.
We advise you to cancel the override if the control and the reference style have the same properties.
Note: Style override is available in window and field templates. Limitations regarding style overrides - Style sheets cannot be overridden.
- A control linked to the style sheet of a skin template is overridden. We advise you to keep the overrides. Therefore, if the style is added to the style sheet of the project, the control loses the link with the skin template and it will no longer inherit from the modifications performed in the style of the skin template.
- The style override is not available for menus and menu options (main menu or context menu).
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|