ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV 2024 feature!
Help / WINDEV Tutorial / Tutorial - An SCM for WINDEV
  • Sharing your source code with the SCM
  • Overview
  • How the SCM works
  • The repository
  • Importing an existing project into the SCM
  • Opening a project from the SCM for the first time
  • Manipulating the project via SCM
  • Changing a project feature
  • Modifying a project window
  • Checking the checked-out element back in
  • Further information
  • Conclusion

Tutorial - An SCM for WINDEV

Sharing your source code with the SCM
We will cover the following topics:
  • What is the Source Code Manager?
  • Characteristics of the repository.
  • Practical example: using the Source Code Manager:
    • Adding a project to the Source Code Manager.
    • Editing elements.
Durée de la leçon 30 min
Overview
The development of a large IS system requires the participation of multiple developers. These developers must work on a single WINDEV project and share different resources (windows, classes, etc.).
WINDEV offers a Source Code Manager (SCM) used to share the source codes of different projects between developers and get the full history of changes in the code, interface, etc.
How the SCM works
The Source Code Manager is used to store and share projects and their elements.
The principle is as follows:
  • A reference version of each of your projects is stored on a server. This set of versions is called "Repository".
  • Each developer has a local copy of the different projects.
    How the SCM works
  • When developers want to make changes to the element of a project (window, report, query, etc.), they notify the SCM that they temporarily own this element. To do so, the developer will check out the element from the repository.
  • This developer gets exclusive rights on this element: all the desired modifications can be performed on this element.
  • The other developers continue to work on the copy of the reference version of the element (located in the repository).
  • Once the developer has finished, the checked out element is checked back into the repository.
  • The other developers are automatically notified of this check-in operation. They can now update their local copy.
    How the SCM works
The SCM manages teamwork and allows you to get the history of all the changes. It can also be used to manage and control elements shared between multiple projects.
SCM or GitHub?
You can also share source elements through GitHub.
The environment allows saving projects, windows, pages, reports, classes, sets of procedures and code in a Git repository. For more details, see Share your projects via Git.
However, it is recommended to use the SCM. In addition to text comparison, the SCM allows for rich object comparison (control properties, for example). An SCM-specific interface allows you to easily merge and compare elements.
The repository
To share a project via the Source Code Manager, you must create a repository. This repository must be created only once on the server.
When should the repository be created?
The repository can be created at different times:
  • when installing WINDEV.
  • when creating a project that uses the SCM.
  • when importing a project into the SCM.
  • whenever you want, from WINDEV directly or from the SCM administrator.
What are the different types of repositories?
The repository can be created in one of the following modes:
  • HFSQL Classic.
  • HFSQL Client/Server.
    If the repository is in HFSQL Client/Server format, it can be used remotely.
  • PCSCloud (paid turnkey solution). The PCSCloud mode allows you to access the sources of the projects from anywhere, at any time. This mode corresponds to a private Cloud (dedicated server) and offers numerous options (dedicated platform, Control Centers, etc.). For more details, see PCSCloud.
  • SCMDrive (paid turnkey solution). The SCMDrive mode allows you to access the sources of the projects from anywhere, at any time. This solution uses a shared server. For more details, see SCMDrive.
In the rest of this tutorial, we will create our repository when importing a project into the SCM.
Importing an existing project into the SCM
To use an existing project with the Source Code Manager, simply add it to the repository. We will add our "WD Full Application" project.
To make things easier, we will import the project into a new local HFSQL Classic repository on the development computer. The operation would be similar for another type of repository.

Opening the example project
This tutorial uses the "WD Full Application" project. To open this example:
  1. Go to the WINDEV home page (Ctrl + <).
  2. On the home page, click "Tutorial", then in "Tutorial - WINDEV Application: Manage data", double-click "Full application - Answers".
Creating the repository and importing the project
Let's import the project into an SCM repository:
  1. On the "SCM" tab, in the "Add project" group, click "Add project to SCM". The wizard for adding projects to the SCM appears:
    Wizard for adding a project to the SCM
    The repository has not been created yet. We are going to create one.
  2. Click "Local repository" to create a local repository on the development computer. The repository creation window appears.
    New repository
  3. Specify the repository directory (e.g., "C:\My Projects\SCM Local repository).
  4. Click "Create repository" to confirm the creation of the new repository.
  5. The new repository is automatically selected in the wizard. We will add our project to this repository.
  6. Go to the next step.
  7. The wizard prompts you to save the project in the "Projects" subdirectory of the repository.
    Select remote directory
    Accept this location. Go to the next step.
  8. Select the project elements that will be added to the repository.
    Select elements
    Add all project elements. Go to the next step.
  9. The wizard asks you to select the project dependencies that will be added to the repository. These dependencies correspond to all external elements required by the project (images, style sheets, etc.).
    Add all project dependencies. Go to the next step.
  10. Click "Finish" to import the project into the SCM. The project and its elements have been added to the repository.
    Sharing project elements
    When projects with shared resources (analysis, windows, etc.) are added to the SCM, these resources can also be shared with other projects present in the SCM. Therefore, the shared element is checked in only once and the changes made to that element are automatically applied to the other projects.

Opening a project from the SCM for the first time

In our example, the project is checked into the SCM and can be used directly.
In a real case, in order for other developers to work on a project located in the Source Code Manager, they must get a copy of this project locally.
To do so, follow these steps:
  1. Open the project from the Source Code Manager: on the "Home" tab, in the "General" group, expand "Open" and select "Open a project from the SCM".
  2. Specify the location of the repository and close the window (this step is only required if the current project has not been imported into the SCM):
    Repository location parameters
  3. In the window that appears, indicate the connection and local directory if necessary:
    Connection and local directory
Remark: If you have already opened the project from the SCM, it prompts you to open the project as usual or to overwrite the content (to retrieve the entire project). This operation must be performed only once by each developer who uses the project. The developer who added the project to the Source Code Manager (you in this case) has no operations to perform.
Next time, you will be able to open a project imported into the SCM as any other project: simply open the local copy of the project.
Manipulating the project via SCM
We will work with the SCM in real conditions by performing the following operations:
  • Change a project feature.
  • Modify a project window.

Changing a project feature

We will apply the skin template on the system windows:
  1. Open the project description: on the "Project" tab, in the "Project" group, click "Description".
  2. Click the "Style" tab.
  3. For the "Info, YesNo, Confirm, and Dialog system windows (WINDEV configurations)" option, select "Custom (integrated into the project)".
  4. Click "OK" to validate the project description window.
Several SCM windows appear:
  1. First, the automatic project check-out window is displayed. To change a project feature, it must be checked out.
    Automatic check-out

    By default, the SCM uses an automatic check-out mode: if you try to modify an element that has not yet been checked out, the SCM automatically prompts you to check it out.
    WINDEV offers several check-out modes. For more details, see Project management modes.
  2. The "Check in the project automatically at the end of the operation" option checks the project in once all changes have been made. Keep this option.
  3. Click "OK" to validate the window.
  4. Different check-in and check-out windows open allowing you to add the internal component "WDFAA.wci" and its elements to the project in the repository and extract them to the local project. This component contains the different system windows to customize. Validate these different windows.
  5. The project description window is closed and the project is automatically checked back into the repository.

Modifying a project window

We will now modify the "WIN_Product_form" window: we should be able to modify the image by clicking on it (like the "Modify" button).
A checked-out element (UI, code, etc.) can be modified as any other element of a project that is not included in the SCM.
However, the other developers cannot see the changes made to the element.
If other developers need to work on the checked-out element, they will use the one in the repository.
This allows you to make an application evolve while keeping a stable version in the repository.

To modify the "WIN_Product_form" window:
  1. Select the "WIN_Product_form" window in the project explorer and double-click the element to open it in the window editor.
    Window editor
  2. Automatic check-out is enabled when the first change is made: simply move a control to check out the element. You can also click the "Check out" icon in the ribbon (Check out).
  3. The check-out window opens:
    Checking out an element
  4. The SCM shows three check-out modes:
    • Exclusive (recommended mode): nobody can check out this element until it is checked back in. The element can be checked out for tests only.
    • For tests: the element can be modified but the modifications will not be checked back in.
    • Multiple: the element can also be checked out by other users. In this case, the differences between the different element versions can be viewed when the element is checked back in. This mode is reserved to specific cases and to experienced developers.
  5. The window will be checked out in exclusive mode. Keep the "Exclusive" option checked.
  6. Type a comment ("Image modification" for example). This comment will be useful for the other developers.
  7. Confirm the check-out. The window is checked out.
  8. Open the Image control description window (select "Description" in the context menu).
  9. In the "UI" tab, modify the cursor used: select the "System hand" cursor.
  10. Validate the control description window.
  11. Open the code of the Image control: select the Image control and press F2 for example.
  12. Write the following code in the "Click..." event:
    // Runs the click code of the button that modifies the image
    BTN_Modify.ExecuteProcess(trtClick)
  13. Close the code window.
  14. Save your window (Ctrl + S).


Let's test our changes:
  1. Test the project (click Test project in the quick access buttons).
  2. Select a product and click "Modify".
  3. In the form that is displayed, click the product image: the file picker is opened to modify the product image. This is the expected operating mode.
  4. Close the test window.

Checking the checked-out element back in

Now that the modifications have been made and tested, we are going to check the window back into the repository. The other developers will be able to access your changes.
On the "SCM" tab, in the "Current element" group, click "Check in". The following window appears:
Checking an element back in
This window is used to:
  • view the changes made by comparing the element from the repository with the checked out element ("My changes...").
    Merging code
    You can compare an element with one of its earlier versions. This allows you to compare the code in order to retrieve a code section that was "lost" or accidentally deleted by another developer.
  • access the history of the element in the repository ("Properties...").
  • write a comment about the changes made. By default, WINDEV proposes the comment typed during the check-out.
  • send a message to the other developers.
  • check in the changes made while keeping the element checked out ("Keep element checked out" option).
    If you are using the Control Centers, the current task can be ended when the element is checked back into the Source Code Manager. This feature is useful to monitor tasks, fix bugs, etc.
Validate the check-in window. The window is displayed in the editor.
Further information
In this tutorial, we have learned how to create, add and manipulate a project in an SCM repository.
The SCM offers many other options and features:
We advise you to make backup copies of the repository on a regular basis. These backups can be made via the SCM administrator.
To learn more about the SCM, see The Source Code Manager.
Conclusion
In the next tutorials, we will use the "WD Full Application" project. To simplify the operations, it is recommended to disconnect from the SCM:
  1. Open the project description window: on the "Project" tab, in the "Project" group, click "Description".
  2. In the "SCM" tab, select "No SCM or external manager (GIT)".
  3. Validate the project description window.
Table of contents
Minimum version required
  • Version 2024
Comments
Click [Add] to post a comment

Last update: 12/04/2023

Send a report | Local help