PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
As soon as it is created, a control is associated with a style. A control style corresponds to:
  • the appearance of the control (background color, font, border, ...),
  • the information regarding the aspect of control (background image, dimension, ...).
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:
  • via the window for style selection ("Choose a style" from the popup menu of the control).
  • via the description window of the control ("Style" tab, "Choose a style" action, "Choose" button).
When validating the selected style, the style is linked to the control. The selected style is copied onto the control and the control stores the information regarding the linked style (style identifier, version of style used, ...)
Remark: To link several controls of the same type to the same style, all you have to do is select the controls (hold the Ctrl key down for example) before opening the window for editing the style sheets.
How to create a style?

Creating a style from the control description (recommended)

A style can be created from an existing control: to do so, modify it to get the new desired style.
To create a style from a control description:
  1. Open the control description.
  2. In the "Style" tab, make the necessary style changes.
  3. In the "Drawer" window, select "Add this style to project" and specify the name of the new style. The "Add" button creates the style in the style sheet.
  4. Validate the control description window. During this validation, the control is automatically linked to the new style.
Remark: If the project is found in the SCM, creating a style triggers the check-out of the style sheet as well as the update or the creation of the .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:
  1. Create a control ("Creation" pane) in a window of your project. For example, to create a new button style, create a button control.
  2. Display the window for editing the style sheets ("Choose a style" from the popup menu).
  3. Click the "Create" button. The description window of the style is displayed.
  4. Specify the requested 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 is using 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 be able to follow the evolutions of the "Header" style, all you have to do is modify the color of the font in the style description: the style of the control is automatically overridden.
The style of the control is automatically updated when the description window is validated. 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.
Remark: By clicking the number of overrides, a window lists the overrides performed. You can:
  • Cancel an override.
  • Restore an override.
We advise you to cancel the override if the control and the reference style have the same properties.
Versions 17 and later
Remark: Style overrides are available in window and control templates.
New in version 17
Remark: Style overrides are available in window and control templates.
Remark: Style overrides are available in window and control 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 popup menu).
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment