WebView2 Support
10.5
PLBWIN and PLBCLIENT have been modified to support the 'Microsoft Edge WebView2 Runtime' when installed. By default the PLBWIN and PLBCLIENT execute as WIN32 Desktop Applications.
Note the following:
What is the 'Microsoft Edge WebView2'? See this link for detailed information:
Microsoft Introduction Overview:
"The Microsoft Edge WebView2 control allows you to embed web technologies (HTML, CSS, and JavaScript) in your native apps. The WebView2 control uses Microsoft Edge as the rendering engine to display the web content in native apps."
What does WebView2 bring to PL/B programs?
The normal Windows PL/B runtimes provide a feature rich GUI environment based on Microsoft WIN32 controls. These controls provide the required functionality and visual user interface to the PL/B program as determined by the Windows. PLBWIN and PLBCLIENT are Windows WIN32 Applications which depend on WIN32 controls with defined styling and states to provide flexibility to the behavior and visual aspects of the controls.
The Microsoft WebView2 support provides extended capabilities to the PWS objects used by a PL/B Web Server. Additional visual styles and features for PWS objects use web technologies (HTML, CSS, and JavaScript) that are now embedded by the runtimes. Also, the PL/B WebView2 implementation uses the 'Boot Strap 5' Framework that provides additional styles and features to the web technologies. See the Web Technologies section for more information.
The Sunbelt WebView2 implementation is merged into the normal PL/B constructs with expectations of the PL/B GUI Language behaviors. This functionality is provided without having to make any changes to existing PL/B programs. Also, existing PL/B programs can be executed in a mode where the PL/B GUI objects are created as PWS objects for new Visual styles/context. The Sunbelt runtimes are executing in a hybrid manner where a Microsoft native application includes embedded web content with Microsoft Edge WebView2.
How is WebView2 used by Plbwin or Plbclient?
By default, the runtimes execute as Windows WIN32 Applications. Existing PL/B programs continue to execute and appear normal using Windows WIN32 controls. In this case, the programs and environment remain the same as normally expected.
The WebView2 support is determined when a WINDOW object is created. In this case, the WebView2 usage is based on PL/B keyword settings or SETMODE states defined under program control.
The WebView2 usage is determined as follows:
There
are new runtime keywords that can be added to the PLBWIN and PLBSERVE configuration file(s). By setting
these keywords, the runtimes are configured to allow WebView2 support for all programs. There are no
keyword settings required for the PLBCLIENT configuration file. See the 'PL/B Runtime Reference' manual
for details on these keywords:
There
are new SETMODE and GETMODE keywords. The WebView2 support may be enabled by setting one or more of the
following keywords.
When
a WINDOW object is created and the WEBMODE property is set, the PL/B runtime uses the WEBMODE property
setting to determine the current WINDOW object mode used for creating children objects described below.
However, if the WEBMODE is not used when a WINDOW object is created, the PL/B runtime identifies the current
state flags that have been declared using runtime keywords and SETMODE operations. Once a WINDOW is created
and the mode for creating children objects is known, the WINDOW object allows other children objects to
to created as follows:
The
WINDOW object only allows WIN32 controls.
The
WINDOW object allows both WIN32 controls and WebView2 controls. (i.e., PWS objects)
The
WINDOW object only allows WebView2 controls.
What is the best way to evaluate WebView2 controls?
The Visual PL/B Designer has been enhanced to allow WebView2 controls. It is very simple with a few steps as follows:
Start the PL/B Designer
Use the 'File\New' menu selection to create a PL or /PWF form.
Select the 'WebView Mode' to include 'WebView'.
Using the 'Web' tab on the Toolbox, select objects to be added to the new form. All web objects are created using HTML, CSS, and JavaScript.
Add a web button to the form. Now, change 'Context Styling' property. Also, change the 'Button Style State' property.
Add a web checkbox to the form. Change the 'Switch' property.
Click the "Test" button in the Designer's toolbar.
WebView2 System Requirements
Windows 10
Windows 11
Sunbelt Runtime/Client require a 32 bit WebView2 runtime.
WebView2 Installation - Windows 10
The 'Microsoft Edge WebView2 Runtime' must be installed on the Windows 10 System where the runtime command ( Plbwin or Plbclient ) is being executed. Tthe 'Microsoft Edge WebView2 Runtime' can be installed manually using the following link:
Scroll Down to 'Evergreen Standalone Installer'
Download and execute the 'x86' Installer.
WebView2 Installation - Windows 11
The 'Microsoft Edge WebView2 Runtime' is released with the Windows 11 OS and requires no additional installation.
See Also: Introduction
![]() |