ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing for Linux
  • Overview
  • Function not available
  • A function is not available in Linux: how to adapt the existing code?
  • Unavailable control
  • Using the available controls
  • I must modify the UI of a window. How can I be sure to use controls that are available for all my configurations?
  • Paths of files
  • Tree structure
  • Case and accented characters
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
Linux application: Tips and tricks
HFSQL ClassicAvailable only with this kind of connection
Overview
In Windows/Linux multi-configuration applications, several limitations may appear: control not supported, functions not available, ...
The possible solutions are presented in this help page.
Function not available

A function is not available in Linux: how to adapt the existing code?

Some functions or properties may not be available in Linux configuration:
  • because they have no reason to exist (the RegistryXXX functions for example).
  • because the associated controls are not available (TreeXXX functions).
  • because they are not yet available in this version.
For a given treatment or event (click code of a Button control for example), the <ExecutionTarget...> statement is used to define the code that will be executed according to the current platform.
For example, for a Linux application, you can indicate the specific code to be executed:
<IF ExecutionTarget=LinuxApplication>
// Linux-specific process
<END>

Likewise, if a section of code is only available on Windows, you can use the following code:
<IF ExecutionTarget=WindowsApplication>
// Windows-specific process
<END>
Remark: There are many execution targets. You can combine them in the same statement.
Unavailable control
Some controls are not yet available in the Linux framework: TreeView, TreeView Table, Bar Code and Shape controls, for example.
At runtime in Linux, if one single control is not supported in the window, none of the controls will be displayed and a WLanguage error will occur.
In this case, several possibilities exist.
The control can be deleted
It is a "minor" control (the Shape control for example, used to identify areas in the UI). You can choose to depending on the case:
  • delete it,
  • replace it by an image or by an "empty" static with a border.
The control can be moved
It is an important control that cannot be deleted but that can be moved into another window (a Bar Code control for example). In this case, you must:
  • create a new window intended to the display of the control.
  • move the control into this new window.
  • add into the source window a button used to open the created window. This button must not be accessible in Linux.
The control cannot be deleted or moved
It is an important control that cannot be deleted or moved (a TreeView control or a TreeView Table table for example). In this case, the only solution consists in duplicating the window in order for each configuration to have its OWN window.
To duplicate a window:
  1. In the window editor, go to the "Home" tab, "General" group, expand "Save" and select "Save as".
  2. Give a new name to the window. A suffix can be added to the name according to the platform ("WIN_ CustomerForm_Linux" for example).
  3. Use a conditional target-code to call the window adapted to the runtime platform.
Caution: This solution must be used with care and only for windows that contain a few lines code and UI elements. Indeed, once the window is duplicated, all the modifications, corrections, ... must be performed twice, with the risk of forgetting some of them.
Using the available controls

I must modify the UI of a window. How can I be sure to use controls that are available for all my configurations?

WINDEV, WEBDEV and WINDEV Mobile clearly indicate the controls and the control parameters that are not available in one or more project configurations.
  • The different types of controls
    The options and the buttons found in the toolbar that are used to create the controls are grayed if the current configuration does not support this type of control.
    If you use a control that is not available in one of the project configurations, an error is displayed in the error pane.
  • The options of controls
    Some control parameters may not be available according to the runtime platform.
    These parameters can be modified in the control description window, but they will be signaled:
    • in gray if the parameter is not available for any of the project configurations.
    • in purple if the parameter is available for some configurations and not available for other configurations.
Paths of files
Differences can be noticed in the file management between Windows and Linux:
  • regarding the tree structure of the files.
  • regarding the case and the accented characters.

Tree structure

The separator used in the tree structure of the paths differs according to the platform:
  • "\" in Windows,
  • "/" in Linux.
Two WLanguage functions can be used to manage this problem:
  • fSep returns the separator corresponding to the platform currently run. This function is used to build a path regardless of the current platform.
    // Builds the path of the configuration file
    sConfigFile = fExeDir() + fSep() + "config.ini"
    Remark: CompleteDir is used to add the proper separator to a tree structure. However, the code becomes less readable after 2 inclusions.
  • fSeparator is used to retrieve a path with normalized separators. This function is very useful if the application uses paths stored/built on a different platform.
    sConfigFile = ".\Temp\MyFile.txt"
    // Normalizes the path
    sConfigFile = fSeparator(sConfigFile)
    // In Windows: ".\Temp\MyFile.txt"
    // In Linux : "./Temp/MyFile.txt"

Case and accented characters

Unlike Windows, Linux is case-sensitive.
For example, the following command line:
// Opens the "MyFile.Txt" file
fOpen("MyFile.txt")
will not open the "myfile.txt" file in Linux while it will be properly opened in Windows.
Therefore, don't forget to check the case of the files on disk and the case used in the WLanguage code.
Minimum version required
  • Version 16
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help