PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Principle of inheritance and overload
  • Overloading pages
  • Overloading the properties of pages
  • Overloading the code of pages
  • 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
Page templates and inheritance
Overview

Principle of inheritance and overload

When a page template is applied to a page, all the controls and code found in the template are "copied" into the page. This is the concept of inheritance.
The template controls are visible in the page, in the page 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 page or page 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 and the code of the template. Overloading the controls and the code enables you to modify, for a given page, the code and/or the controls of the template.
Overloading pages

Overloading the properties of pages

Overloading the properties of template pages consists in modifying the characteristics of the page that is using the template (the characteristics displayed in the description window for example).
As soon as one of the characteristics of the page that is using the template is modified, this property is overloaded.
Note: The following page properties can be overloaded: Image, Fixed background image, Background color, Text color, Link color, Color of visited link, Color of active link, Underlined link, Center the page, Anchor the controls in the page, Title, Control for displaying the progress bar, Position of Ajax progress bar. A template menu can also be overloaded.

Overloading the code of pages

To overload the code of template pages:
  1. Display the processes of the page ("Code" from the popup menu).
  2. If a process exists in the template page, this process appears twice in the page 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 page.
  3. The code entered in the page process will be run as follows:
    • the declaration process of global variables is merged between the template and the page 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 page): the processes of the templates applied to the page are run according to their order of inclusion, then the process corresponding to the page is run.
    • for the closing process of the page: the closing process of the page is run, then the processes of the templates applied to the page 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 page.
  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 page. A function was automatically added: ExecuteAncestor. This function runs the click code of the template.
  6. Add the code of button specific to the current page 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.
  • The styles cannot be overloaded. However, the style of the control can be overloaded.
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 page that uses the template will trigger an error.
  • No style overload is available.
Minimum required version
  • Version 11
Comments
Click [Add] to post a comment