Page 1 of 1

HTML GUI Renderer

Posted: Thu May 24, 2018 11:16 am
by Kukulkan
Hi,

I really wish that PB GUI is using some built-in HTML renderer (eg Chrome, Webkit etc) for GUI. By this, we would be able to use HTML and CSS for any GUI layout inside of a Window. We simply may add some PB-Related identifier to access the elements like we do for Dialog library?

Code: Select all

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>My test dialog</title>
  <link rel="stylesheet" href="css/styles.css?v=1.0">
</head>

<body>
  <script src="js/scripts.js"></script>
  <input name="txtFirstname" type="text"> 
  <input name="btnTest" type="button" value="OK"> 
</body>
</html>
Later on, we might be able to get the gadget ID (and bind events) using:

Code: Select all

Html.i = LoadHTML(htmlString.s)
HtmlDialog.i = OpenHTMLDialog(#PB_Any, Html.i, HTMLTitle(HtmlDialog.i), 400, 400)
Gadget.i = HTMLGadget(HtmlDialog.i, "btnTest")
; and
BindGadgetEvent(Gadget.i, @ButtonCallback(), #PB_EventType_LeftClick)
LoadHTML(), OpenHTMLDialog(), HTMLTitle() and HTMLGadget() are, of course, the new functions needed.

Just dreaming...
(Yes, I know about the Node.js and other techniques some users already posted. But this is handicapped and complicated stuff. We need some real native implementation).

Of course, it is needed to provide some more functionality:
* Accessing and manipulating all elements in DOM (eg like jQuery using name or id)
** Example: SetHTML(HtmlDialog.i, "btnTest", "value", "okay") -> will set attribute "value" of button to be "okay"
** Example: Ret.s = GetHTML(HtmlDialog.i, "btnTest", "value") -> will return attribute "value" of button
* Allow calling PB functions from JS and get returned value (string, integer, float, bool)
** Example: Ret.s = CallHTML(HtmlDialog.i, "ScriptName", Params.s) -> Will call JS function "ScriptName"
* Allow calling JS functions incl. parameters from within a PB function (eg HTMLExecute("function", ParameterMap))
** Example: JS is calling PB_Call("PBFunctionName", Para1, ParaN) to call PB function

So, I never said it was easy, but really cool, huh?

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 3:32 am
by Seymour Clufley
I like this idea, because a native solution always makes for tidier code. But what you describe can already be done using code available on the forum, however, we are limited to HTML4-era web technology because of the webgadget's reliance on Internet Explorer, which is literally a dead browser. IMHO it should be seen as a high priority to get PB up to date with HTML5.

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 4:00 am
by JHPJHP
Seymour Clufley wrote:... however, we are limited to HTML4-era web technology because of the webgadget's reliance on Internet Explorer, which is literally a dead browser.
I agree that it would be great to have access to web features provided by the latest browser technology, but also wanted to mention that some HTML5 features are accessible from the WebGadget.
- see MP4 Player and YouTube Player

HTML5test:
- Internet Explorer 11.461.16299.0: 312 out of 555 points
- Microsoft Edge 41.16299.461.0: 476 out of 555 points

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 1:50 pm
by Seymour Clufley
Yes, but as CSS evolves, IE11's CSS support doesn't evolve, which means that HTML which displays one way in all the modern browsers will display differently in the webgadget. And then you've got all the newer HTML5 things that IE11 doesn't support - even the "download" attribute on hyperlinks! It's ridiculous to be stuck in 2010.

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 2:30 pm
by Kukulkan
I also think that the current Webgadget is not sufficient. This is why I wrote
I really wish that PB GUI is using some built-in HTML renderer (eg Chrome, Webkit etc) for GUI.
I believe, especially because of the Linux issues, PB has to come with it's own component (like cURL, Ogre etc). Maybe the license of Webkit or Blink should be compatible with such product enhancements? So PB would have to compile/link the render engine into such projects. By this, it would be independent and still cross platform. Of course, the executables would be bigger.

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 3:21 pm
by JHPJHP
I fully agree with you both, my post was only meant to clarify HTML5 support for people not familiar with its limitations.

I also recognize that this is the Feature Requests and Wishlists forum, and not the proper place to discuss features of the WebGadget; my mistake.

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 4:15 pm
by davido
+1

@JHPJHP,
Thank you for the explanation, regarding the WebGadget; I found it useful.

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 4:54 pm
by CELTIC88
I propose to integrate 'Chromium Embedded Framework' for pb

https://bitbucket.org/chromiumembedded/cef

8)

Re: HTML GUI Renderer

Posted: Fri May 25, 2018 8:38 pm
by chi
+1 for CEF

Re: HTML GUI Renderer

Posted: Sat May 26, 2018 11:36 am
by The8th
The old Trident rendering machine of Internet Explorer is really hopelessly out of date.
The Edge machine has e. g. built in audio features (like live streaming) which IE never can do reguardless of what browser code you enter in FEATURE_BROWSER_EMULATION in the registry. This hint is often given when users complain that they cannot see up to date web pages in the WebGadget. But this hint is really useless. It does not make an Edge rendering machine out of an old IE renderer.

Recently I read somewhere that Microsoft has delivered a new browser emulation with Windows 10/1803 update which can simulate Edge. But it does not replace the old one automatically. Unfortunately I have lost the url and do not have further informations.

73s, Henry

Re: HTML GUI Renderer

Posted: Sat May 26, 2018 12:22 pm
by DarkDragon
Wah please no. HTML/CSS/JavaScript grew to a big mess of historical crap. Use something like Android's XML language, but not HTML! Please, no! Btw. if you are concerned about your customer's security, then you'd basically have to update your application every hour or so, because new security flaws will be found in your "browser" you ship to them.