PC SOFT

WINDEV的在线文档

  • Overview
  • How do I link a control to an existing style?
  • How do I create a style?
  • Creating a style from the control description (recommended)
  • Creating a style from the window for style management
  • Modifying the style of a control and overloading its style
  • Limitations regarding style overload
文档页面当前正在翻译。对于此延迟我们深表歉意。
您可以自愿地帮助我们翻译您想要的文档段落,然后只需通过以下地址与我们联系:info@cn.windev.com
产品
WinDevWebDev-服务器代码WebDev-浏览器代码WinDev Mobile报表和查询
平台
WindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPad
语言
JavaPHPAjax用户代码(MCU)外部语言
数据库
HFSQLHFSQL Client/Server存储过程HF 5.5OLE DBODBC本地访问

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 the 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 do I 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 to the control and the control stores the information regarding the linked style (identifier of the style, version of the style used, ...)

Note: To link several controls of the same type to the same style, all you have to do is select the controls (by keeping the [Ctrl] key down for example) before opening the window for editing the style sheets.

How do I create a style?

Creating a style from the control description (recommended)

A style can be created from an existing control: to do so, modify its style to get the new requested style.

To create a style from a control description:

  1. Display the control description.
  2. In the "Style" tab, perform the requested style modifications.
  3. In the "HideShow" window, select "Add this style to project" and specify the name of the new style. The "Add" button is used to create the style in the style sheet.
  4. Validate the description window of the control. During this validation, the control is automatically linked to the new style.
Note: 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 ( "Insert .. Control...") in a window of your project. For example, to create a new button style, create a button control.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 the style of a control and overloading its style
As soon as a style modification is performed on a control linked to a style, one or more "overloads" are performed.

The overload 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 overloaded control is modified:

  • The modifications that do not affect the overloaded characteristics are updated.
  • The control keeps the overloaded 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 overloaded.

The style of the control is automatically updated when validating the description window of the control. The overload 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: By clicking the number of overloads, a window lists the overloads performed. You can:

  • Cancel an overload.
  • Restore an overload.
We advise you to cancel the overload when the properties are identical between the control and the reference style.

17版本和更高版本
Note: The style overload is available for the window templates and for the control templates.
17新版本
Note: The style overload is available for the window templates and for the control templates.
Note: The style overload is available for the window templates and for the control templates.

Limitations regarding style overload

  • The overloads are not available for the style sheet.
  • A control linked to the style sheet of a skin template is overloaded. We advise you to keep the overloads. 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 overload is not available for the menus and for the menu options (main menu or popup menu).
  • The style overload is not available for the window templates and for the control templates. The style overload is lost when the template is refreshed.