PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Creating the external component
  • Developing an external component
  • Remark
  • Advanced options of the external component
  • Defining and modifying the advanced options of the component
  • Access rights of the component on the client project
  • Style: Mode for managing the skin templates on the component elements.
  • Generating an external component
  • Generating an external component
  • Generating an external component for Android
  • Generating an external component for iOS
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
There are several steps to creating an external component:
  1. Creating the external component.
  2. Developing the elements of the external component.
  3. Defining the advanced options of the external component.
  4. Generating the external component.
Then, the external component can be distributed and re-used. For more details, see Distributing an external component and Using an external component in an application. Remark: From version 19, HFSQL is the new name of HyperFileSQL.
Creating the external component
An external component can be created:
  • from an existing project, using an "External component" configuration. This configuration contains the elements of the project that the external component needs to run properly.
  • from an "External component" project. By default, this project only contains an "External component" configuration.
To create an external component from an existing project:
  1. Create a project configuration for the external component: on the "Project" tab, in the "Project configuration" group, expand "New configuration" and select "External component (WDK)".
  2. The project configuration wizard starts and requests:
    • the name and description of the project configuration.
    • the compatibility options of the configuration: select the different platforms on which the external component can be used.
      Caution: depending on the selected platforms, it may be necessary to use a version of WINDEV with WEBDEV and WINDEV Mobile.
    • the compilation options: you can enable and disable compilation errors for 64-bit compatibility, Linux or compilation errors related to pre-launched sessions. Compilation errors related to pre-launched sessions are only available in Site configurations.
    • the elements to be integrated into the project configuration.
  3. Validate the wizard. The description of the "External component" project configuration is completed.
  4. You can select the "Component" project configuration in the "Project explorer" pane and start developing the external component.
To create an external component from a "Component " project:
  1. Click in the quick access buttons. In the window that is displayed, click "Project". The project creation wizard opens.
  2. Choose the type of project generation: "Component". Go to the next step.
  3. Specify:
    • the different platforms on which the external component can be used.
      Caution: depending on the selected platforms, it may be necessary to use a version of WINDEV with WEBDEV and WINDEV Mobile.
    • the compilation options: you can enable and disable compilation errors for 64-bit compatibility, Linux or compilation errors related to pre-launched sessions (this option is only available when generating a Site configuration).
  4. Go to the next step.
  5. Specify the different options of the project:
    • The name and location. These options cannot be modified. The project corresponds to a ".WDP" file for WINDEV. This file can be opened by WEBDEV and WINDEV Mobile. For more details, see Common project.
      All the objects associated with the project will be created in the specified directory.
    • The description that summarizes the purpose of the project. This description is used in the project documentation.
  6. Go to the next step. The steps that appear next are the different steps to create a WINDEV, WEBDEV or WINDEV Mobile project.
  7. The project is created. This project contains a single project configuration. This project configuration is of type "Component".
Developing an external component
External components are developed just like any other WINDEV, WEBDEV or WINDEV Mobile project.
The following points must be taken into account when developing the different elements of an external component:
  1. Elements of the external component:
    For each element of your project, specify if it is associated with the "Component" project configuration.
    1. Select the element (window, report, etc.) in the "Project explorer" pane.
    2. Right-click to open the context menu and select select "Configurations".
      In the menu that appears:
      • the checked configurations correspond to the configurations associated with the element.
      • the unchecked configurations correspond to the configurations not associated with the element.
      • Versions 26 and later
        "All" associates the element with all the configurations.
        New in version 26
        "All" associates the element with all the configurations.
        "All" associates the element with all the configurations.
      • Versions 26 and later
        "None" dissociates the element from a configuration.
        New in version 26
        "None" dissociates the element from a configuration.
        "None" dissociates the element from a configuration.
      • Versions 26 and later
        "Multiple" allows you to choose the configurations you want to associate the element with.
        New in version 26
        "Multiple" allows you to choose the configurations you want to associate the element with.
        "Multiple" allows you to choose the configurations you want to associate the element with.
  2. Developing an external iOS or Android component
    You can create an Android or iOS component:
    • from a WINDEV Mobile version integrated into WINDEV,
    • from WINDEV Mobile.
    New windows will always be of type Windows. To create an Android or iOS window:
    • Create an Android or iOS configuration.
    • Create the window in this configuration. If the window already exists in the project, make sure this window is associated with an iOS or Android configuration.
    • Associate the window with the component configuration.
  3. Code comments
    When developing the elements of the 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. For more details, see Automatic documentation of components.
    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
  4. 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 the external component. For more details, see Visibility of element in an external component.
    Remark: 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.
  5. To run a procedure of the project that hosts the external component, from the component itself, use ExecuteProcess associated with the trtProjectProcedure constant.

Remark

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.
Advanced options of the external component
The advanced options of the 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.

Defining and modifying the advanced options of the component

To modify the advanced component options:
  1. Open the description window of the "Component" configuration:
    • If the component configuration is currently open: on the "Project" tab, in the "Project configuration" group, click "Current configuration".
    • In the "Project explorer" pane, open the context menu of the component configuration and select "Description".
  2. Select the component.
  3. In the window that appears, in the "General" tab, click "Component options"..

Access rights of the component on the client project

Three possibilities:
  • The component will not access the data files, windows, pages and reports of the client project.:
    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 execution 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 execution 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 execution 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.
    If this option is selected, the "Initializing" event of the component project will be called when the component is loaded by the host project.
  • The component will access the data files of the client project.:
    The component is allowed to handle only the data files of the host application. In this case, the HFSQL contexts will be identical.
    If this option is selected, the "Initializing" event of the component project will be called when the component is loaded by the host project.
  • The component will access the data files, windows, pages and reports of the client project.:
    The component is allowed to handle the data files of the host application as well as its elements (windows, reports, etc.). In this case, the execution contexts will be identical.
    If this option is selected, the "Initializing" event of the component project will not be called when the component is loaded by the host project.
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.
Remark: 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.
For more details on HFSQL contexts, see HFSQL context.

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

By default, the skin template of the host project can be applied to the different elements of the external component. For more details on skin templates, see Skin template.
Remarks:
  • You can allow or prevent the client project from applying the skin template. Go to the "Style" tab of the advanced options of the external component.
  • Versions 23 and later
    To avoid applying the skin template of the client project to a window of the external component:
    1. Open the component description window.
    2. In the "Style" tab, in "Skin templates", check "Always keep the initial style/skin template".
    3. Validate.
    New in version 23
    To avoid applying the skin template of the client project to a window of the external component:
    1. Open the component description window.
    2. In the "Style" tab, in "Skin templates", check "Always keep the initial style/skin template".
    3. Validate.
    To avoid applying the skin template of the client project to a window of the external component:
    1. Open the component description window.
    2. In the "Style" tab, in "Skin templates", check "Always keep the initial style/skin template".
    3. Validate.
Generating an external component
Once generated, an external component can be distributed and reused. All the files required to distribute the external component are generated along with the component. This generation can be done at any time from the component project configuration:
  • on the "Project" tab, in the "Generation" group, click "Generate".
  • in the quick access buttons, click the icon for generating the component: Generate a component
Remark: If the external component was modified, it must be re-generated before it can be distributed again. For more details, see Modifying an external component.

Generating an external component

To generate an external component:
  1. Open the project configuration of the component to be generated, then go to the "Project" tab, "Generation" group and click "Generate".
  2. The external component generation wizard starts.
  3. Check "Recompile project before generating the component" (if necessary). Go to the next step.
  4. For each element of the external component, specify whether this element must be accessible from the project that uses the external component. If the element is accessible, the developer (of the project that uses the external component) will be able to use the element like any other project element. For more details, see Visibility of element in an external component.
    Remark: The list of accessible elements corresponds to the elements associated with the project configuration of the current component.
    Go to the next step.
  5. Specify whether the external component can be translated. If the "Allow component translation" option is checked, you can select which elements of the component can be translated. Elements that are left unchecked will not be available for translation.
    For more details, see Translating an external component.
    Go to the next step.
  6. If components are found in the project, these components can be included in the component that is currently generated (nested components for example).
    Go to the next step.
  7. Specify whether the version number of the external component must be changed (when modifying an external component). For more details, see Modifying an external component.
    Go to the next step.
  8. Specify (if necessary) the information about the external component: Owner, caption, copyright, ... The information will be visible:
    • when the external component is integrated into a WINDEV, WEBDEV or WINDEV Mobile project.
    • in the properties of WDI and WDK files in the Windows explorer ("PC SOFT" tab).
    Go to the next step.
  9. Select the image of the external component. This image will be used in the Windows explorer.
    Go to the next step.
  10. Type the general overview of the external component.
    This general overview will be automatically included in the external component description.
    Go to the next step.
  11. The generation wizard automatically presents the technical documentation associated with the external component.
    For more details on the rules for creating comments, see Automatic documentation of components.
    Go to the next step.
  12. 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 the external component.
    Go to the next step.
  13. Indicate if the external component should be published in an SCM directory. This option is used to make the external component available to the projects of the SCM. For more details, see external component and SCM.
  14. Versions 27 and later
    If the generated component can be used by an Android platform, the Android component generation wizard opens. This wizard allows you to configure the Android-specific features of the component. For more details on the different steps, see Generating a component for Android.
    New in version 27
    If the generated component can be used by an Android platform, the Android component generation wizard opens. This wizard allows you to configure the Android-specific features of the component. For more details on the different steps, see Generating a component for Android.
    If the generated component can be used by an Android platform, the Android component generation wizard opens. This wizard allows you to configure the Android-specific features of the component. For more details on the different steps, see Generating a component for Android.
  15. Versions 27 and later
    If the generated component can be used by an iOS platform, the iOS component generation wizard opens. This wizard allows you to configure the iOS-specific features of the component. For more details on the different steps, see Generating a component for iOS.
    New in version 27
    If the generated component can be used by an iOS platform, the iOS component generation wizard opens. This wizard allows you to configure the iOS-specific features of the component. For more details on the different steps, see Generating a component for iOS.
    If the generated component can be used by an iOS platform, the iOS component generation wizard opens. This wizard allows you to configure the iOS-specific features of the component. For more details on the different steps, see Generating a component for iOS.
  16. Specify the physical name of the external component. This name will be assigned to the files corresponding to the external component.
  17. Validate. The external component is generated.
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 the 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, ...).
<ComponentName>.WDZThis file contains the dependencies of the WDK file (only for WEBDEV and WINDEV Mobile components). This information is extracted in the project when the component is:
  • For a WEBDEV component, this file contains the generated WEBDEV pages, images, ...
  • For a Mobile component (iOS or Android), this file contains the Android generation files, etc.

Caution: The generation of the external component may be quite long if the external component contains several accessible elements.

Generating an external component for Android

If the generated component can be used by an Android platform, the wizard will display the following additional steps:
  1. The Android SDK and Gradle are required to generate the Android component. You can:
    • Download and install these tools automatically. In this case, WINDEV Mobile downloads and installs all necessary tools with the requested options. Only an Internet connection is required.
      This method is recommended. Caution: The first download can be quite long.
    • Use the tools automatically installed. This option is available if the tools have been downloaded and installed during a previous generation.
    • Use the tools already installed on your computer. In this case, you just need to specify the installation paths of Gradle and the Android SDK. For more details, see Installing the Android SDK.
    If you are using a proxy to access Internet, click the "Proxy" button to configure or check the Proxy management. For more details, see General options of WINDEV, WEBDEV and WINDEV Mobile.
  2. Go to the next step.
  3. Indicate the name of the package corresponding to the component. This name identifies the component. By convention, it is composed of the company name (or its domain name in reverse order) followed by the name of the component. The name of the component will be in the default language of the project.
  4. Go to the next step.
  5. The component is generated for a fleet of devices. You can limit the size of the application by selecting a specific processor architecture.
    Note: If a device is connected to the PC, use the "Detect hardware automatically" option. Thus, next time an application is generated, this device will be automatically selected.
  6. Go to the next step.
  7. The list of files integrated into the component is displayed. This list is built from the files in the "Other" folder of the "Project explorer" pane. For example, you can integrate:
    • specific resources: images, ...
    • HFSQL data files used by the application, ...
    By default, the files included in the archive are read-only ("Read" option checked). They can:
    • be used directly in the component in read-only mode.
      For example, if a read-only image is included in the Android component, it can be directly assigned to a control by specifying its name. For example:
      IMG_Image = image1
    • extracted from the archive through programming (fExtractResource). In this case, the file can be modified later.
    You have the ability to specify the destination directory in the l'APK (which means the destination directory in the archive). The "Automatic" option is selected by default: the file is automatically placed in the proper directory according to its type. You have the ability to choose a specific directory.
    Versions 22 and later
    Remark: The "Asset" directory is also proposed.
    New in version 22
    Remark: The "Asset" directory is also proposed.
    Remark: The "Asset" directory is also proposed. If the "Write" option is checked:
    • the file extraction is automatically performed when starting the application (before running the project initialization code).
    • you have the ability to specify an extraction directory. By default, the data files are extracted into the database directory (<DB Directory>)
      Caution: if the files in "Write" mode already exist on the mobile during the setup, they will not be re-extracted from the archive.
  8. Go to the next step.
  9. Indicate if there are libraries to be integrated into the Android component. You can include:
    • specific Java libraries (*.jar or *.aar files).
    • native libraries (SO files).
    • the HFSQL library.
      This library is required if your component uses HFSQL data files.
  10. Go to the next step.
  11. The wizard prompts you to integrate remote dependencies (e.g., JCenter) into the Android component.
    It is also possible to specify additional repositories (other than JCenter and Google).
  12. Go to the next step.
  13. Select the permissions the component needs to work properly. The component must indicate to Android which services it needs to access in order to work properly (Internet, camera, etc.). WINDEV Mobile automatically adds the necessary permissions according to the statements used in the component.
    Remarks:
    • If procedures written in native Java have been used, the corresponding permissions must be specified.
    • Versions 22 and later
      From Android version 6, the authorization is requested the first time the feature is used (previously all requests were made grouped during the setup).
      New in version 22
      From Android version 6, the authorization is requested the first time the feature is used (previously all requests were made grouped during the setup).
      From Android version 6, the authorization is requested the first time the feature is used (previously all requests were made grouped during the setup).
  14. Go to the next step.
  15. If the application that will use the component is available on Google Play, you can make the component available only for devices that support the features used by the application. For example, if your component uses inertial scrolling, you can make it available only for devices that support this feature.
    You can choose to add or remove specific features.
  16. Go to the next step.
  17. Specify the configuration parameters.
  18. The component is compiled and generated.

Generating an external component for iOS

If the generated component can be used by an iOS platform, the wizard will display the following additional steps:
  1. Indicate if there are files to be integrated into the component.
    The list of files integrated into the component is displayed. Selected files are highlighted in blue. These files can be found in the "Other" folder of the "Project explorer" pane. For example, you can integrate:
    • specific resources.
    • specific images.
    • data files.
  2. Specify the options of files:
    • If the "Write" option is checked for the files, these files will be automatically extracted (e.g., files that must be modified by the application). In this case, specify the application directory into which this file must be extracted ("Documents" directory or "Library" directory).
    • If the "Write" option is unchecked for the files, these files can be:
      • used directly (files to read for example: sound files, image files, etc.). These files are included in the application and they will not be extracted. fResourceDir is used to access these files in read-only mode.
      • extracted through programming with fExtractResource.
        Caution: the iOS system is case-sensitive.
  3. Go to the next step.
  4. If you publish the iOS application that contains the component to the App Store, you must include a short explanation of each feature used. The first time the end user uses any of these features, an authorization window will display this text.
  5. Validate the wizard. The component is compiled and generated.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment