PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Principle of inheritance and overload
  • Overloading the windows
  • Overloading the properties of windows
  • Overloading the code of windows
  • Overloading controls
  • Overloading the control style (GUI overload)
  • Overloading the control code (code overload)
  • Notes
  • Managing the overloaded properties of a control
  • Finding out the overloaded properties:
  • Overloading the local procedures
  • Overloading the code of a local procedure
  • Limitations
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
Window templates and inheritance
Overview

Principle of inheritance and overload

When a window template is applied to a window, all the controls and code found in the template are "copied" into the window. This is the concept of inheritance.
The template controls are visible in the window, in the window editor. A yellow square is found in the top left corner of each control. By default, the controls found in the template cannot be modified.
The code of the template is visible in the code editor, in the different processes of the window or window controls. This WLanguage code can be easily identified:
  • the processes associated with the template are followed by "(<Template Name> template)" (for example: "Click the Validate button (MyTemplate template)").
  • the background of the processes is grayed because the code cannot be modified.
For a template of templates, the inheritance is performed on several levels.
You have the ability to overload the controls, the local procedures and the code of the template. Overloading the controls, the local procedures and the code enables you to modify, for a given window, the code, the local procedures and/or the controls of the template.
Overloading the windows

Overloading the properties of windows

Overloading the properties of the template windows consists in modifying the characteristics of the window that uses the template (the characteristics displayed in the description window for example).
As soon as one of the characteristics of the window that uses the template is modified (the width of the window for example), this property is overloaded.
Note: The template window can use a skin template with "Layout" controls (the ActiveVista 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.

Overloading the code of windows

To overload the code of template windows:
  1. Display the processes of the window ("Code" from the popup menu).
  2. If a process exists in the template window, this process appears twice in the window that is using the template. Indeed, the following elements are displayed:
    • the process issued from the template. This process appears in gray and its caption is followed by "(<Template Name> template)".
    • the process of the window.
  3. The code typed in the window process will be run as follows:
    • the declaration process of global variables is merged between the template and the window that uses the template. Therefore, no variable with the same name must be used in this process.
    • for all the processes (except for the closing process of the window): the processes of the templates applied to the window are run according to their order of inclusion, then the process corresponding to the window is run.
    • for the closing process of window: the closing process of window is run, then the processes of templates applied to the window are run in reverse order of inclusion.
Overloading controls

Overloading the control style (GUI overload)

To overload the interface of a template control (a button for example):
  1. Display the popup menu of a template button found in the window.
  2. Select "Overload the control".
  3. The yellow square was replaced by a blue square, indicating that this control can be overloaded.
  4. You can now modify all the aspects of the button interface: dimensions, position, style, ...

Overloading the control code (code overload)

To overload the code of a template control (code of button for example):
  1. Display the popup menu of a template button found in the window.
  2. Select "Overload the control".
  3. The yellow square was replaced by a blue square, indicating that this control can be overloaded.
  4. Display the button code ("Code" from the popup menu).
  5. Two sections of click code are found:
    • the click code issued from the template.
    • the click code of the window. A function was automatically added: ExecuteAncestor. This procedure runs the click code of template.
  6. Add the code of the button specific to the current window, before and/or after the procedure for calling the template code. You have the ability to delete ExecuteAncestor if you do not want the template code to be run.

Notes

  • An overloaded button cannot be deleted from a template.
  • Overloading a table also overloads the columns. You have the ability to add columns into an inherited table.
  • You have the ability to add panes to a template tab and to include template controls in this pane.
  • No style overload is available.
Managing the overloaded properties of a control

Finding out the overloaded properties:

To find out the control properties that have been overloaded:
  1. Open the popup menu of control.
  2. Select "Overloaded properties".
  3. The window for overload management is opened.
This window allows you to delete the overloaded properties. To do so, select the requested property and delete it.
To entirely delete all the overloaded operations performed on a control, all you have to do is select the line called "Full overload".
Overloading the local procedures
Versions 15 and later

Overloading the code of a local procedure

To overload the code of a local procedure from the "Project explorer" pane:
  1. Select the element associated with the local procedure (window, page, report, ...).
  2. Expand the element options and select "Local procedures".
  3. Select the procedure to overload.
  4. Display the popup menu and select "Overload the code of the local procedure".
  5. Two sections of click code are found:
    Overloading a local procedure
    • the code of the procedure issued from the template.
    • the code of the new procedure. A function was automatically added: ExecuteAncestor. This function runs the code of the template procedure.
  6. Add the code of the new procedure specific to the current element, before and/or after the procedure for calling the template code. You have the ability to delete ExecuteAncestor if you do not want the template code to be run.
New in version 15

Overloading the code of a local procedure

To overload the code of a local procedure from the "Project explorer" pane:
  1. Select the element associated with the local procedure (window, page, report, ...).
  2. Expand the element options and select "Local procedures".
  3. Select the procedure to overload.
  4. Display the popup menu and select "Overload the code of the local procedure".
  5. Two sections of click code are found:
    Overloading a local procedure
    • the code of the procedure issued from the template.
    • the code of the new procedure. A function was automatically added: ExecuteAncestor. This function runs the code of the template procedure.
  6. Add the code of the new procedure specific to the current element, before and/or after the procedure for calling the template code. You have the ability to delete ExecuteAncestor if you do not want the template code to be run.

Overloading the code of a local procedure

To overload the code of a local procedure from the "Project explorer" pane:
  1. Select the element associated with the local procedure (window, page, report, ...).
  2. Expand the element options and select "Local procedures".
  3. Select the procedure to overload.
  4. Display the popup menu and select "Overload the code of the local procedure".
  5. Two sections of click code are found:
    Overloading a local procedure
    • the code of the procedure issued from the template.
    • the code of the new procedure. A function was automatically added: ExecuteAncestor. This function runs the code of the template procedure.
  6. Add the code of the new procedure specific to the current element, before and/or after the procedure for calling the template code. You have the ability to delete ExecuteAncestor if you do not want the template code to be run.
Limitations
  • No embedded query can be used in a template control. The execution of the window that uses the template will trigger an error.
  • No menu can be used in a template: the menu will not be copied into the window that uses the template.
  • No style overload is available.
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment