PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Principle of inheritance and overload
  • Overloading the controls in the control template
  • Overloading the properties of controls
  • Overloading the code of controls
  • 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:
  • 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
Overview

Principle of inheritance and overload

When a control template is applied to a page or to a window, all the controls and code found in the template are "copied" into the page or window. This is the concept of inheritance.
The template controls are visible in the window in the window editor and 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 window controls 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 based on another template, 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 allows you to modify the code and/or the controls found in the template.
Overloading the controls in the control template

Overloading the properties of controls

Overloading the properties of template controls consists in modifying the characteristics of the controls found in the window or page that is using the template (the characteristics displayed in the description window for example).
As soon as one of the characteristics of the template control is modified, this property is overloaded.

Overloading the code of controls

To overload the code of template controls:
  1. Display the processes of the page or window ("Code" from the popup menu).
  2. If a process exists in a template control, this process appears twice in the window or 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 processes of the controls found in the page or window.
  3. The code typed in the process of the page control or window control will be run as follows:
    • the process of the template control.
    • the process of the overloaded control in the window or page.
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 or the window: right-click the control.
  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: right-click the control.
  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.
  • When a control template is based on another control template, the inheritance can be managed on several levels.
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".
Limitations
  • No embedded query can be used in a template control. The execution of the page or the window that use the template will trigger an error.
  • The styles cannot be overloaded.
  • The ancestors are not managed by the control overload (the control does not manage the parent). For example, an overloaded control is positioned on a tab pane. If the overloading operation is canceled, the control does not go back to the initial tab.
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment