PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Developing an external component
  • Note
  • Creating an external component
  • Advanced options of the external component
  • Modifying the advanced component options
  • Access rights of component on the application elements that use the component
  • Style: Mode for managing the skin templates on the component elements.
  • Generating an external component
  • Generating an existing external component
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
A component must be created from a project containing all elements required for the component to operate. We recommend that you use a specific project to develop each external component.
The creation of an external component is performed in several steps:
  1. Developing the elements of external component.
  2. Creating the external component.
  3. Defining the advanced options of external component.
  4. Generating the external component.
Then, the external component can be distributed and re-used. See Distributing an external component and Using an external component in an application for more details.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Developing an external component
The development of an external component is performed from a WINDEV, WEBDEV or WINDEV Mobile project. We recommend that you use a specific project to develop each external component.
The following points must be taken into account when developing the different elements of an external component:
  1. Code comments
    When developing the elements of external component, don't forget to insert comments in your code. These comments will be used to create the documentation of your component. These comments will provide help to the users of your components. See Automatic documentation of components for more details.
    If these comments are not found in your code, the accessible elements of the component will be automatically documented by specifying the input/output parameters expected by each element.
    For example:
    Description of input/output parameters of 'Window1':
    Parameters:
    Param1: <specify the role of Param1>
    Return value:
    None
  2. Declaration and visibility of elements
    Depending on the declaration mode of elements (classes, procedures, sets of procedures), the elements will be more or less accessible by the user of external component. See Visibility of element found in an external component for more details.
    Note: If an external component uses an analysis and data files, the HFSQL functions will handle these elements in an independent HFSQL context. This operating mode can be modified in the advanced options of the component.
  3. To run, from the external component, a procedure of the project that is hosting the external component, use ExecuteProcess associated with the trtProjectProcedure constant.

Note

An external component can include classes in its interface. You have the ability to derive these classes in the host project, to overload the virtual methods, to provide polymorphism. The inheritance is available between several levels of external components.
Creating an external component
To create an external component:
  1. Select "Workshop .. External component .. Define a new component from this project". The wizard for creating the external component starts.
    Note: If you did not create a project configuration specific to the creation of an external component, the wizard for creating a project configuration starts. To optimize the organization of your projects, we advise you to use the project configurations. See Project configuration for more details.
    In this case, the wizard asks for:
    • the name and description of project configuration.
    • the compatibility options of configuration:
      • Multi-product: The external component will be generated for a specific type of project or for a use in all products (WINDEV, WEBDEV and WINDEV Mobile).
      • Platform: The compilation errors can be enabled (or not) for the 64-bit or Linux compatibility.
    • the elements included in the project configuration.
  2. The wizard for generating an external component starts.
  3. In the wizard for creating the external component:
    • Specify the name and caption of external component.
    • Select the elements of current project required for the external component to operate.
    • For each element of external component, specify whether this element must be accessible from the project that is using the external component. If the element is accessible, the developer (of the project that is using the external component) will be able to use the element like any other project element. See Visibility of element found in an external component for more details.
  4. Validate. The external component is created. To distribute it, it must be generated beforehand.
    The external component can be immediately generated. This option is recommended if all elements of external component have been developed, checked and are ready to be distributed.
To create an external component:
  1. Create a project configuration for the external component: on the "Project" pane, in the "Project configuration" group, expand "New configuration" and select "External component (.WDK)". The wizard for creating a project configuration starts and asks for:
    • the name and description of project configuration.
    • the compatibility options of configuration:
      • Multi-product: The external component will be generated for a specific type of project or for a use in all products (WINDEV, WEBDEV and WINDEV Mobile).
      • Platform: The compilation errors can be enabled (or not) for the 64-bit or Linux compatibility.
    • the elements included in the project configuration.
  2. Develop the external component.
To distribute it, it must be generated beforehand. See Generating an external component for more details.
Advanced options of the external component
The advanced options of external component are used to define:
  • the access rights of component on the application elements that use the component.
  • the management mode of skin templates on the component elements.

Modifying the advanced component options

To modify the advanced component options:
  1. Select "Workshop .. External component .. List of components generated from this project".On the "Project" pane, in the "Project" group, expand "List of elements" and select "List of generated components".
  2. Select the component.
  3. Click the "Options..." button.

Access rights of component on the application elements that use the component

Three possibilities:
  • the component and its host application use independent contexts (default option):
    The component cannot handle the data files or the elements of the host project.
    Versions 15 and later
    You also have the ability to define the runtime context of the component in the host project. The runtime context can be:
    • global. In this case, the same context will be used if the external component is loaded by the project and by another external component of project.
    • isolated (by default). In this case, if the same component is loaded by the project and by a project component, each component will use a specific context.
    New in version 15
    You also have the ability to define the runtime context of the component in the host project. The runtime context can be:
    • global. In this case, the same context will be used if the external component is loaded by the project and by another external component of project.
    • isolated (by default). In this case, if the same component is loaded by the project and by a project component, each component will use a specific context.
    You also have the ability to define the runtime context of the component in the host project. The runtime context can be:
    • global. In this case, the same context will be used if the external component is loaded by the project and by another external component of project.
    • isolated (by default). In this case, if the same component is loaded by the project and by a project component, each component will use a specific context.
  • the component is allowed to handle the data files of host application. In this case, the HFSQL contexts will be identical.
  • the component is allowed to handle the data files of host application as well as its elements (windows, reports, ...) . In this case, the runtime contexts will be identical.
When should I allow the component to handle the data files of host application?
For example, if the application contains a main application and some options supplied as components. In this case, the components handle the data files of main application.
Note: If the component is allowed to handle the data files and if it has its own analysis, the component analysis will be ignored. The component will use the analysis of host project.
In our example, when developing a component, this component can be associated with the analysis of main application. Therefore, there is no need to use the external declarations to handle the data files. Furthermore, the completion will be automatically performed in the code editor.
See HFSQL context for more details.

Style: Mode for managing the skin templates on the component elements.

By default, the skin template of host project can be applied to the different elements of external component. See Skin template for more details.
Notes:
  • The "Style" tab of options of external component is used to allow (or not) the skin template to be applied by the client project.
  • Versions 23 and later
    To avoid applying the skin template of client project to a window of external component:
    1. Display the description window of component.
    2. In the "Style" tab, check "Always keep the initial style/skin template".
    3. Validate.
    New in version 23
    To avoid applying the skin template of client project to a window of external component:
    1. Display the description window of component.
    2. In the "Style" tab, check "Always keep the initial style/skin template".
    3. Validate.
    To avoid applying the skin template of client project to a window of external component:
    1. Display the description window of component.
    2. In the "Style" tab, check "Always keep the initial style/skin template".
    3. Validate.
Generating an external component
An external component can be distributed and re-used once it has been generated. The generation of the external component is used to create the files required for distributing the external component.
This generation can be performed:
  • when creating the external component.
  • at any time:
    • via "Workshop .. External component .. Generate a component",
    • from the list of components found in the project ("Workshop .. External component .. List of components generated from this project").
This generation can be performed at any time:
  • from the project configuration of component:
    • on the "Project" pane, in the "Generation" group, click "Generate".
    • in the quick access buttons, click the icon for generating the component:
  • from the list of components found in the project: On the "Project" pane, in the "Project" group, expand "List of elements" and select "List of generated components". Select the component and click "Generate".
Note: If the external component was modified, it must be re-generated before it can be distributed again. See Modifying an external component for more details.

Generating an existing external component

To generate an existing external component:
  1. Select "Workshop .. External component .. Generate a component".Display the project configuration of component ; then, on the "Project" pane, in the "Generation" group, click "Generate".
  2. The wizard for generating the external component starts.
  3. Select (if necessary) the name of external component to generate.
  4. Select the elements of current project required for the external component to operate.
  5. For each element of external component, specify whether this element must be accessible from the project that is using the external component. If the element is accessible, the developer (of the project that is using the external component) will be able to use the element like any other project element. See Visibility of element found in an external component for more details.
  6. Specify whether the external component can be translated. If the option "Allow the component to be translated" is checked, select the different elements of external component that will be translated. The checked elements can be translated while the unchecked elements will not be proposed for translation.
    See Translating an external component for more details.
  7. Choose the languages supported by the project that must be included in your external component. The lower the number of languages supported by the external component is, the smaller the size of external component.
  8. If components are found in the project, these components can be included in the component that is currently generated (nested components for example).
  9. Specify whether the version number of external component must be changed (for a modification of an external component). See Modifying an external component for more details.
  10. Specify (if necessary) the information about the external component: Owner, caption, copyright, ... The information will be visible:
    • when including the external component in a WINDEV or WEBDEV project.
      This information is also displayed in the description of external component, accessible from the "Wizards, Examples and Components" pane ("Description" from the popup menu of component).
    • in the properties of WDI and WDK files in the Windows explorer ("PC SOFT" tab).
  11. Select the image of external component. This image will be used in the Windows explorer and in the "Wizards, Examples and Components" pane.
    Reminder: The components found on the current computer are accessible from the "Wizards, Examples and Components" pane ("Components" option). See Managing the components from the "Wizards, Examples and Components" pane for more details.
    Select the image of external component. This image will be used in the Windows explorer.
  12. Type the general overview of external component.
    This overview will be automatically displayed in WINDEV when the external component found in the "Wizards, Examples and Components" pane is hovered by the mouse cursor.
    Reminder: The components found on the current computer are accessible from the "Wizards, Examples and Components" pane ("Components" option). See Managing the components from the "Wizards, Examples and Components" pane for more details.
    Type the general overview of external component.
    This general overview will be automatically included in the description of external component.
  13. The generation wizard automatically presents the technical documentation associated with the external component.
    See Automatic documentation of components for more details.
  14. Specify whether a help system (in CHM format) must be generated. This help system will be copied beside the component. This help system contains the technical documentation of external component.
  15. Specify whether the input of UMC (User Macro-Code) is allowed. See Managing the user macro-codes for more details.
  16. Specify whether the external component must:
    • Be published in a directory of the SCM. This option is used to make the external component available to the projects of SCM. See external component and SCM for more details.
    • Be saved in the reusability center. In this case, it can be made available to the other developers (whether they are using the SCM or not).
  17. Specify the physical name of the external component. This name will be assigned to the files corresponding to the external component.
  18. Validate. The external component is generated.
The following files are created in the EXE directory of the current project:The following files are created in the generation directory of the project configuration:
<ComponentName>.WDKThis file contains all the elements that must be distributed (windows, reports, ...).
This file is required when deploying applications that use the external component.
<ComponentName>.WDIInterface of external component. This file contains:
  • a help for using the external component when it is checked back in.
  • the elements required for using the external component in the project (compilation information, ...).
Caution: The generation of the external component may be quite long if the external component contains several accessible elements.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment