PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Creating a window template
  • Creating a window template
  • Creating a window template from an existing window
  • Applying a window template
  • Creating a new window based on a window template
  • Applying a template to an existing window
  • Notes
  • Opening the template associated with a window
  • Applying the modifications performed on a template
  • Running the test of a window template
  • List of templates used
  • Synchronizing the windows and the window templates
  • Example
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
WINDEV and WINDEV Mobile allow you to create window templates. These templates contain the graphic elements and the code common to all the windows found in your application.
The modifications performed in a window template are automatically applied to all the windows that use this template.
A window template allows you to comply with the style book defined for an application.
Using window templates in your applications allows you to:
  • simplify the creation of application windows.
  • simplify the layout of application windows.
  • simplify the update of the style book defined for the application.
Versions 15 and later
WINDEV MobileAndroid The window templates are available for the Android applications.
New in version 15
WINDEV MobileAndroid The window templates are available for the Android applications.
WINDEV MobileAndroid The window templates are available for the Android applications.
Versions 16 and later
WINDEV MobileUniversal Windows 10 App The window templates are available for the Windows Phone applications.
WINDEVLinux The window templates are now available for the WINDEV applications in Linux.
New in version 16
WINDEV MobileUniversal Windows 10 App The window templates are available for the Windows Phone applications.
WINDEVLinux The window templates are now available for the WINDEV applications in Linux.
WINDEV MobileUniversal Windows 10 App The window templates are available for the Windows Phone applications.
WINDEVLinux The window templates are now available for the WINDEV applications in Linux.
Versions 17 and later
WINDEV MobileiPhone/iPad The window templates are available for the iPhone/iPad applications.
New in version 17
WINDEV MobileiPhone/iPad The window templates are available for the iPhone/iPad applications.
WINDEV MobileiPhone/iPad The window templates are available for the iPhone/iPad applications.
Creating a window template
A window template can be created:
  • directly, like any other window.
  • from an existing window.

Creating a window template

To create a window template:
  1. Create a new window template ("File .. New .. Window .. Window template").Create a new window template:
    • Click among the quick access buttons.
    • In the wheel that is displayed, hover "Window" and click "Window template".The window for creating a new element is displayed: click "Window" then "Window template".
  2. You can:
    • Create a blank window template (based or not on the skin template used by the project),
    • Create a blank window template based on a skin template other than the one of the project,
    • If your project already uses window templates, create a window template based on another window template of the project. In this case, you will have the ability to perform cascading updates of the window templates.
  3. The window editor displays a new window inside a green border named "Window template".
  4. Create all the necessary controls. These controls will be included in all the windows that use the template.
  5. Enter (if necessary):
    • the processes associated with the window.
    • the processes associated with the controls found in the template.
      These processes will be automatically imported into the windows that use the template.
  6. Give a name to your template ("General" tab in the description window).
  7. Select "File .. Save".On the "Home" pane, in the "General" group, click "Save" (or click among the quick access buttons).
The window template corresponds to a file whose extension is ".WDT".

Creating a window template from an existing window

To create a window template from an existing window:
  1. Open the window chosen as template.
  2. Keep the controls required by the template. These controls will be included in all the windows that use the window template.
  3. Keep the code of processes required by the template. These processes will be automatically imported into the windows that use the template.
  4. Give a name to your window ("General" tab in the description window of the window).
  5. Select "File .. Save as template". The current window becomes a template:On the "Home" pane, in the "General" group, expand "Save" and select "Save as template". The current window becomes a template:
    • its name is preceded by "Template".
    • a green border appears around the window in the window editor.
    • the window template is displayed in the "Project" pane ("Templates of windows").
The window template corresponds to a file whose extension is ".WDT".
Applying a window template

Creating a new window based on a window template

To create a new window based on a window template:
  1. Create a new window ("File.. New.. Window").Create a new window:
    • Click among the quick access buttons.
    • Click "Window" in the wheel that is displayed. The window for creating a new element is displayed: click "Window" then "Window".
  2. In the wizard, select the "Based on a template" pane.
  3. Choose your template from the list of available templates.
  4. Validate. The new window is displayed in the editor.
A yellow square is used to identify the elements belonging to the window template. These elements can be modified:
  • in the window template: the modification will be effective for all the windows that use this template.
  • in the window, via the mechanism for "control overload": the modification will be effective for the window only.

Applying a template to an existing window

To apply a template to an existing window:
  1. Display the window in the window editor.
  2. Select "Insert .. A template (Inheritance)".On the "Window" pane, in the "Templates" group, expand "Templates" and select "Inherit from a template".
  3. Select the window template to apply.
  4. Validate.
  5. Specify whether you want to update the properties of the window from the template. If you answer "Yes", the list of properties to overload is displayed. In this window, you have the ability to select the properties of the initial window to keep. The window template will be automatically overloaded for the properties kept. For all the other characteristics, the window will be automatically linked to the template.
  6. Validate.
Note: By default, the size characteristics as well as the window title are automatically overloaded.

Notes

  • Several templates can be applied to a window. In this case, the controls found in the different templates are included in the window as well as the processes of these templates. The properties of the window (dimension, border, ...) can be linked to a single template only.
  • Some skin template use the "layout" controls (the ActiveVista skin template for example). These controls are used to display the title of the window, the system buttons, ... These layout controls are considered as being properties of the window.
  • In this version:
    • the menus of the template are not applied to the window that is using the template.
    • Android the action bar of the template is not applied to the window that is using the template.
  • The status bars cannot be overloaded.
  • No style overload is supported by the templates.
    Versions 17 and later
    The style overload is supported by the templates.
    New in version 17
    The style overload is supported by the templates.
    The style overload is supported by the templates.
  • Versions 20 and later
    You also have the ability to apply a window template to an existing internal window. See Internal Window control for more details.
    New in version 20
    You also have the ability to apply a window template to an existing internal window. See Internal Window control for more details.
    You also have the ability to apply a window template to an existing internal window. See Internal Window control for more details.
Opening the template associated with a window
To open the template associated with a window:
  1. Display the window in the window editor.
  2. In the popup menu of a template element, select "Open the template".
Other possibility:
  • List the templates associated with the window ("Windows .. List of templates used"). List the templates associated with the window: on the "Window" pane, in the "Templates" group, expand "Templates" and select "List of templates used".
  • Select the requested template and click the "Open the template" button.
Applying the modifications performed on a template
When a window template is modified, the modifications can be applied to one ore more windows that use this template in the current project.
Applying the modifications is proposed when the template is saved.Applying these modifications is proposed when closing the template.
It can also be performed at any time:
  • from the template, via "Windows .. Update the associated windows".from the template: on the "Window" pane, in the "Templates" group, expand "Templates" and select "Update the associated windows".
  • from any window that uses the template, by opening the list of templates used ("Windows .. List of templates used") and by clicking the "Update" button.from any window that is using the template:
    • by opening the list of templates used: on the "Window" pane, in the "Templates" group, expand "Templates" and select "List of templates used".
    • then by clicking the "Update" button.
  • Versions 17 and later
    from the window template, by clicking in the green bar of template.
    New in version 17
    from the window template, by clicking in the green bar of template.
    from the window template, by clicking in the green bar of template.
Note: The modifications made to the template are applied according to the overloaded characteristics of the windows that use the template.
Running the test of a window template
To run the test of a window template:
  1. Open the template whose test must be run ("Window .. List of templates used", "Open the template" button).Open the template whose test must be run:
    • On the "Window" pane, in the "Templates" group, expand "Templates" and select "List of templates used",
    • Click the "Open the template" button.
  2. Click the "Go" button ("Run the window test" icon) or select "Code .. Run the window test".Click among the quick access buttons.
List of templates used
To display the list of templates used for a window, select "Windows .. List of templates used".To display the list of templates used for a window, on the "Window" pane, in the "Templates" group, expand "Templates" and select "List of templates used".
From this window, you can:
  • "Open a template": opens the selected template in the window editor.
  • "Update": the controls and the code of the template are updated the window.
  • "Add": adds a template to the current window.
  • "Dissociate": the template controls found in the window are dissociated from the template. The template is deleted from the list of templates used but its controls are not deleted from the window.
  • "Delete": deletes the template (controls and code) from the window.
Synchronizing the windows and the window templates
You have the ability to synchronize the windows and their templates:
  • when creating executables, components, ... To do so, check "Synchronize the windows and the reports according to their templates when generating executables, libraries, components, ..." ("Options" tab of the project description).
  • Versions 17 and later
    when running the GO of the project. The window update is automatically proposed according to the window templates.
    New in version 17
    when running the GO of the project. The window update is automatically proposed according to the window templates.
    when running the GO of the project. The window update is automatically proposed according to the window templates.
Example
WINDEVWindows The "Sales Management" example supplied with WINDEV is using:
  • the mechanism of templates of templates,
  • the window templates,
  • the control templates,
  • the reverse modeling of templates.
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment