|
|
|
|
|
- Not applying the skin template to one of the project windows
- ".WDY" file
- Deploying an application
- Font
- Style of controls
- Internal windows
ChangeSkinTemplate (Function) In french: ChangeGabarit Dynamically changes the skin template: - of all windows found in the current application,
- of the windows found in the WINDEV components used by the application,
- of a specific window found in the project.
Caution: - This function has no effect on the skin templates applied to a report.
- This function has no effect on the clipped windows. The skin template is not modified.
// Use the "Sea" skin template for all application windows ChangeSkinTemplate("", "C:\MyApp\Sea.WDY")
// Use the "Emerald" skin template for the current window ChangeSkinTemplate(MyWindow.Name, "EmeraldWDY")
Syntax
<Result> = ChangeSkinTemplate(<Element to modify> , <New skin template> [, <WLanguage procedure>])
<Result>: Boolean - True if the skin template was modified,
- False if a problem occurred.
<Element to modify>: Constant or character string This parameter can correspond to: | | "" (empty string) | The new skin template will be applied to all windows found in the current application (including the windows found in the WINDEV components used by the application). In a .NET assembly generated by WINDEV, the new skin template will be applied to all windows found in the current assembly and to all windows found in the WINDEV .NET assemblies that are loaded in parallel by the application. | AllComponents | The new skin template will be applied to the windows found in all the WINDEV components used by the application | "<Window name>" | The new skin template will be applied to the specified window |
<New skin template>: Character string Name of the skin template to be applied (name and path of the "*.WDY" file, if necessary). If this parameter corresponds to an empty string (""):- the skin template defined in the window editor will be applied by default.
Caution: If a skin template has been dynamically set with ChangeSkinTemplate, it will take precedence. - the windows already opened will keep the current skin template.
<WLanguage procedure>: Optional procedure name WLanguage procedure ("callback" procedure) called when the skin template is applied to an internal window further to the call to ChangeSourceWindow. This procedure has the following format:
PROCEDURE <Procedure name>(<Destination internal window>, <Skin template>) where: - <Destination internal window> is a Control variable corresponding to the internal window to which the skin template is applied.
- <Skin template> is a string corresponding to the name of the skin template used.
Remarks Not applying the skin template to one of the project windows To avoid applying the skin template to one of the project windows: - Open the description of the corresponding window.
- On the "Style" tab, check "Always keep the initial style/skin template".
- Validate.
".WDY" file The description of a skin template is stored in a ".WDY" file. The ".WDY" files corresponding to the skin templates proposed by WINDEV are provided with WINDEV. Remarks: - When creating a skin template, the ".WDY" file is automatically created.
- To generate the ".WDY" file of an existing skin template, open the "<NameOfSkinTemplate>.STY" file in WINDEV and save this file (
).
Deploying an application When creating the setup program of your application, the following elements must be added into the list of elements to install: - the ".WDY" file of the new skin template set with ChangeSkinTemplate.
- the image files used by the new skin template applied by ChangeSkinTemplate.
Caution: The images must have different names in the different skin templates used otherwise these images will not be modified. For the buttons, the image of the button is not affected by the change, only the image of the border is replaced by the image of the skin template. Remark: To add one or more elements to the list of project elements: - On the "Project" tab, in the "Project" group, expand "List of elements" and select "List of project elements".
- Click the "Add" button.
- Select the files to add and validate.
Font Dynamically loading skin templates has no effect on the font of the static controls. Indeed, systematically changing the font could trigger unexpected display effects (truncated or overlapping text) because the size of the static controls changes with the font. If a change of font must be done when a new skin template is applied through programming, use Font in addition to ChangeSkinTemplate. Style of controls ChangeSkinTemplate dynamically changes the skin template of ALL the controls (controls linked to a project style or dissociated controls). To apply the style of a skin template to some controls only, apply ChangeStyle to the relevant controls. Remark: You also have the ability to copy the style of a control to another one via Style. Internal windows Internal windows have the "Before changing skin template" and "After changing skin template" optional events. These events can be used to save and reapply specific properties to internal window controls when changing the skin template. You can also change one or more characteristics of the controls depending on the skin template applied. For more details, see Events associated with internal windows.
Related Examples:
|
Training (WINDEV): WD Changing Skin Templates
[ + ] The “WD Changing Skin Templates” example presents a solution allowing the users to dynamically change skin templates.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|