Page 1 of 5

SWV: A simple HTML/JS desktop GUI engine for PB

Posted: Sun Feb 09, 2020 4:52 pm
by firace
I am working on a Simple Webview control (hence the name: SWV) for PB developers, designed to be more useful and flexible than the standard WebGadget, while still being very lightweight.

SWV's primary purpose is to facilitate building HTML/JS GUIs for PureBasic desktop applications.
It aims to provide tight integration and seamless two-way communication between JS and PB.

Note that for security reasons, SWV is not intended, and not optimized for web browsing.


The SWV control will offer the following functions:
  • SWV_New

    SWV_SetUserAgent

    SWV_SetLocation

    SWV_GetLocation

    SWV_SetHTML

    SWV_GetHTML

    SWV_SetDOM

    SWV_GetDOM

    SWV_RunJS

    SWV_Resize

    SWV_Free



A couple screenshots:

Image

Image

Image

I will release SWV as a very easy-to-use DLL (for a reasonable price), if enough people are interested.

So please share your thoughts / questions / suggestions :)

However do keep in mind that I will be travelling the next few days and might take a while to respond.


Edit: Demo #1 is available!


https://www.radsix.com/files_swv/SWV_De ... ve_x86.zip (Download size: 91KB)

Unzip the package to a location of your choice (preserving the folder structure),
and either just run the demo executable, or compile it from source.

Notes:
This is a very early preview for demonstration purposes only, so be aware that many UI elements have no effect, and only a subset of the intended functionality has been implemented.

Have a look at the sample applications, and be sure to check out the test view by pressing F12.

Keep in mind that to build an HTML/JS UI for your desktop application, a UI framework is required in addition to SWV.
The following popular frameworks are confirmed to be supported so far:
  • BootStrap
    Pure.css
    Bulma.css
    Mint.css
All comments, bug reports, suggestions welcome :)

If there's enough interest, a CEF (Chromium) version will follow, but of course keep in mind that resulting applications will be much much bigger (about 130MB for a simple Hello world application, vs 100-150KB for the current native version).

Re: SWV: A better webview control

Posted: Sun Feb 09, 2020 5:36 pm
by Fred
Looks very interesting, on which browser code is it based ?

Re: SWV: A better webview control

Posted: Sun Feb 09, 2020 6:01 pm
by Kiffi
That sounds promising. But only if it does not use the Internet Explorer.

Greetings ... Peter

Re: SWV: A better webview control

Posted: Sun Feb 09, 2020 7:40 pm
by chi
Nice, looking forward to it ^^

Re: SWV: A better webview control

Posted: Sun Feb 09, 2020 8:34 pm
by firace
Fred wrote:Looks very interesting, on which browser code is it based ?
I am making it for both Trident (with hardware acceleration) and Chromium.
Tests are looking good on both engines so far.

The Chromium version will certainly take a little more time to complete, but for desktop GUI rendering purposes, the Trident version should be quite usable already.

Re: SWV: A better webview control

Posted: Mon Feb 10, 2020 2:26 am
by ozzie
Looking forward to the demo!

Re: SWV: A better webview control

Posted: Mon Feb 10, 2020 12:20 pm
by diskay

Re: SWV: A better webview control

Posted: Mon Feb 10, 2020 5:55 pm
by the.weavster
I'd rather pay firace a few bob and avoid the frustration of trying to figure that out :wink:

Re: SWV: A better webview control

Posted: Tue Feb 11, 2020 2:00 pm
by firace
the.weavster wrote:
I'd rather pay firace a few bob and avoid the frustration of trying to figure that out :wink:
Yes using SWV should be much easier to figure out :)

A couple more screenshots (SWV + Bootstrap UI theme):

Image

Image

Re: SWV: A better webview control

Posted: Tue Feb 11, 2020 2:28 pm
by Kiffi
@firace: Can you do me a favor and test the following page?

https://www.spiderbasic.com/showcase/on ... rview.html

This is a demonstration of the SpiderBasic gadgets. When I display the page in a PureBasic WebGadget (Internet Explorer), I can't select the ListView and ListIconGadget entries with the mouse.

Thanks in Advance & greetings ... Peter

Re: SWV: A better webview control

Posted: Tue Feb 11, 2020 4:26 pm
by firace
Kiffi wrote:@firace: Can you do me a favor and test the following page?

https://www.spiderbasic.com/showcase/on ... rview.html

This is a demonstration of the SpiderBasic gadgets. When I display the page in a PureBasic WebGadget (Internet Explorer), I can't select the ListView and ListIconGadget entries with the mouse.

Thanks in Advance & greetings ... Peter
I just tested it and yes, I do see issues with selection on those gadgets when using the IE11-based web control. In fact the browser control does appear to pick up the mouse events (see below screenshot), but does not highlight the selected item for some reason. I will try using the CEF (Chromium) engine later.

Image

Re: SWV: A better webview control

Posted: Wed Feb 12, 2020 12:24 pm
by firace
And here's a first little demo:

https://www.radsix.com/files_swv/SWV_De ... ve_x86.zip

Unzip the package to a location of your choice (preserving the folder structure),
and either just run the executable, or compile it from source (SWV_EXE_X6.pb)

Notes:
This is a very early preview for demonstration purposes only, so be aware that many UI elements have no effect, and only a subset of the intended functionality has been implemented.

Have a look at the sample applications, and be sure to switch to the full test view by pressing F12.

Keep in mind that to build an HTML/JS UI for your desktop application, a UI framework is required in addition to SWV.
The following popular frameworks are confirmed to be supported so far:
  • BootStrap
    Pure.css
    Bulma.css
    Mint.css
All comments, bug reports, suggestions welcome :)

If there's enough interest, a CEF (Chromium) version will follow, but of course keep in mind that resulting applications will be much much bigger (about 100MB for a simple Hello world application, vs 100KB for the current native version).

Re: SWV: A better webview control

Posted: Wed Feb 12, 2020 12:45 pm
by Kwai chang caine
If i have good understand, it's not a webbrowser, but a GUI application like PB but create with local HTML5/CSS, you can't go to a site on the web ?
Works great here, thanks for your demonstration 8)

Re: SWV: A better webview control

Posted: Wed Feb 12, 2020 12:59 pm
by srod
Works well here on Win 7. Had to change the compiler settings so that the temporary exe is created in the source directory - otherwise the html file is not found.

Very impressive. :shock:

I take it that is using the Trident engine?

Will the chromium version be cross-platform?

Re: SWV: A better webview control

Posted: Wed Feb 12, 2020 1:22 pm
by Kiffi
I'm sorry to say it, but SWV scores too low on HTML5test

Image

(Btw: i'm using Windows 10)

CEF would get a higher score, but there is already the PB.Ex WebGadget (Windows) (WebKit) from RSBasic.

Greetings ... Peter