ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Window functions
  • Not applying the skin template to one of the project windows
  • ".WDY" file
  • Deploying an application
  • Font
  • Style of controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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.
Example
// 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.
AllComponentsThe 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:
  1. Open the description of the corresponding window.
  2. In the "Style" tab, check "Always keep the initial style/skin template".
  3. 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 (Backup icon).

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:
  1. On the "Project" tab, in the "Project" group, expand "List of elements" and select "List of project elements".
  2. Click the "Add" button.
  3. 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.
Related Examples:
WD Changing Skin Templates Training (WINDEV): WD Changing Skin Templates
[ + ] The “WD Changing Skin Templates” example presents a solution allowing the users to dynamically change skin templates.
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video ChangeSkinTemplate
https://youtu.be/P1BD1695FE8

https://windevdesenvolvimento.blogspot.com/2019/03/dicas-2050-windev-comandos-48.html

// BTN ALTERA SKIN_CHANGESKINTEMPLATE

sARQUIVO_SKIN is string=fSelect("","","Seleciona Arquivo Template","*.wdy","*.wdy")

ChangeSkinTemplate("",sARQUIVO_SKIN)
amarildo
21 Mar. 2019
EXEMPLO
//ALTERA SKIN DA TELA - IMPORTANTE COPIAR O DIRETORIO DE TEMPLATE PARA O SEU CLIENTE

sFileSkin is string = "C:\WINDEV 23\Personal\Templates\WD\110 Office2007\Office2007.wdy"
IF fFileExist(sFileSkin) = True
IF ChangeSkinTemplate("",sFileSkin) = False THEN

Info(ErrorInfo())

RETURN

END
END
BOLLER
01 Mar. 2019

Last update: 06/22/2023

Send a report | Local help